Dynamic configuration implementation method based on Modbus protocol and terminal
By dynamically updating the Modbus protocol configuration of industrial equipment in the data acquisition center, the problems of poor compatibility of data acquisition equipment for industrial equipment and difficulty in upgrading and maintenance of protocols are solved, and data acquisition results with high versatility, flexibility and low maintenance costs are achieved.
Patent Information
- Application Number
- CN202411406142.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-21
AI Technical Summary
Existing data acquisition equipment has poor compatibility with industrial equipment, and it is difficult to upgrade and maintain data protocols, resulting in trouble in production and maintenance and increased maintenance costs.
The Modbus configuration information of different industrial equipment is stored in a readable and writeable data format through the data acquisition center, and dynamically update the Modbus protocol configuration on the acquisition device according to the changes in the Modbus protocol between the industrial equipment and the acquisition device.
When industrial equipment protocols change, there is no need to recycle the acquisition equipment and update the firmware one by one, which improves the universality and flexibility of the data acquisition module, reduces maintenance time and workload, and reduces operating costs.
Smart Images

Figure CN119496798A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial Internet of Things communications, and in particular to a method and a terminal for implementing dynamic configuration based on the Modbus protocol. Background Art
[0002] Modbus protocol is a universal communication protocol that has been widely used in today's industrial control field. With the rise of Internet of Things technology, the demand for data acquisition functions is getting higher and higher. How to adapt to the ever-changing data needs and respond to the remote maintenance needs of industrial and commercial systems has become an increasingly important topic. At present, most industrial equipment data acquisition uses Modbus protocol to transmit data with acquisition equipment. There are many existing industrial equipment models. Different models of the same manufacturer may use different data addresses and command addresses. The data addresses and command addresses of products from different manufacturers are more different.
[0003] Therefore, due to these differences, the following questions arise:
[0004] 1. The compatibility of data acquisition equipment with industrial equipment is relatively poor. At present, data acquisition equipment encodes the required data address and command address into the firmware of the acquisition equipment. Each industrial equipment has different data address and command address, which leads to low versatility of data acquisition equipment and troublesome production and maintenance.
[0005] 2. Data protocol upgrades and maintenance are difficult. After industrial equipment upgrades its firmware, the data addresses and command addresses in some of the original data protocols may change and no longer apply. Therefore, the data acquisition equipment needs to be upgraded and updated synchronously. Since the data addresses and command addresses are encoded in the data acquisition equipment firmware, the only option is to recycle the data acquisition equipment or go to the site to update the equipment one by one, which is cumbersome and increases maintenance costs. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a method and a terminal for realizing dynamic configuration based on Modbus protocol, so as to overcome the defects and shortcomings in the prior art and solve the problem of poor compatibility of the existing data acquisition center with industrial equipment.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0008] A method for implementing dynamic configuration based on Modbus protocol, comprising the steps of:
[0009] S1. The Modbus configuration information of different industrial devices is stored in a readable and writable data format through the data acquisition center;
[0010] S2. According to the change of the Modbus protocol between the industrial equipment and the corresponding acquisition equipment, the configuration information of the industrial equipment stored in the data acquisition center is changed accordingly;
[0011] S3. Update the Modbus protocol of the corresponding industrial equipment stored in the acquisition device according to the changed configuration information issued by the data acquisition center, and perform data acquisition on the industrial equipment based on the updated Modbus protocol.
[0012] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0013] A dynamic configuration implementation terminal based on the Modbus protocol includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0014] S1. The Modbus configuration information of different industrial devices is stored in a readable and writable data format through the data acquisition center;
[0015] S2. According to the change of the Modbus protocol between the industrial equipment and the corresponding acquisition equipment, the configuration information of the industrial equipment stored in the data acquisition center is changed accordingly;
[0016] S3. Update the Modbus protocol of the corresponding industrial equipment stored in the acquisition device according to the changed configuration information issued by the data acquisition center, and perform data acquisition on the industrial equipment based on the updated Modbus protocol.
[0017] The beneficial effects of the present invention are as follows: a dynamic configuration implementation method and terminal based on the Modbus protocol of the present invention stores the Modbus protocol configuration of the equipment in the data acquisition center, and when the Modbus protocol of the industrial equipment is changed, the Modbus configuration information in the data acquisition center is changed accordingly, and the configuration information is sent to the acquisition equipment to complete the update of the Modbus protocol stored on the acquisition equipment, so that when the industrial equipment protocol is changed, there is no need to recycle the acquisition equipment and update the firmware of the acquisition equipment one by one, thereby overcoming the defect of poor compatibility of the existing data acquisition center with industrial equipment; at the same time, in the case of the same equipment and the same protocol, only the configuration needs to be copied for reuse without updating the firmware of the acquisition equipment, and at the same time, the operation is simple and easy to use, which greatly improves the versatility and flexibility of the data acquisition module, greatly reduces the maintenance time and workload, and reduces the operating cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1A flow chart of a method for implementing dynamic configuration based on the Modbus protocol according to an embodiment of the present invention;
[0019] Figure 2 A flow chart of a data acquisition center configuration change of a dynamic configuration implementation method based on the Modbus protocol according to an embodiment of the present invention;
[0020] Figure 3 This is a structural diagram of a terminal for dynamically configuring a Modbus protocol-based implementation in this embodiment;
[0021] Description of labels:
[0022] 1. A dynamic configuration implementation terminal based on Modbus protocol; 2. Memory;
[0023] 3. Processor. DETAILED DESCRIPTION
[0024] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0025] Please refer to Figure 1 The present invention provides a method for implementing dynamic configuration based on the Modbus protocol, comprising the steps of:
[0026] S1. The Modbus configuration information of different industrial devices is stored in a readable and writable data format through the data acquisition center;
[0027] S2. According to the change of the Modbus protocol between the industrial equipment and the corresponding acquisition equipment, the configuration information of the industrial equipment stored in the data acquisition center is changed accordingly;
[0028] S3. Update the Modbus protocol of the corresponding industrial equipment stored in the acquisition device according to the changed configuration information issued by the data acquisition center, and perform data acquisition on the industrial equipment based on the updated Modbus protocol.
[0029] From the above description, it can be seen that the beneficial effects of the present invention are: a dynamic configuration implementation method based on the Modbus protocol of the present invention stores the Modbus protocol configuration of the device in the data acquisition center, and when the Modbus protocol of the industrial equipment is changed, the Modbus configuration information in the data acquisition center is changed accordingly, and the configuration information is sent to the acquisition device to complete the update of the Modbus protocol stored on the acquisition device, so that when the industrial equipment protocol changes, there is no need to recover the acquisition device and update the firmware of the acquisition device one by one, thereby overcoming the defect of poor compatibility of the existing data acquisition center with industrial equipment; at the same time, in the case of the same device and the same protocol, only the configuration needs to be copied for reuse without updating the firmware of the acquisition device. At the same time, the operation is simple and easy to use, which greatly improves the versatility and flexibility of the data acquisition module, greatly reduces the maintenance time and workload, and reduces the operating cost.
[0030] Further, step S3 includes:
[0031] S31. According to the changed configuration information sent by the data center, analyze and obtain the device model and corresponding acquisition device ID of the industrial device whose configuration information has been changed;
[0032] S32, reading the configuration information according to the device model and converting it into a key-value pair and sending it to the network communication module of the acquisition device;
[0033] S33. The network communication module performs matching according to the acquisition device ID and the device model in the configuration information. Only when the acquisition device ID and the device model match, the Modbus protocol of the corresponding industrial device stored in the acquisition device is updated, and data is collected from the industrial device based on the updated Modbus protocol.
[0034] From the above description, it can be seen that by parsing the device model and corresponding acquisition device ID of the industrial equipment whose configuration information has changed, it is ensured that only the relevant acquisition devices are accurately updated, avoiding unnecessary operations and waste of resources, and ensuring the accuracy and effectiveness of the update.
[0035] Furthermore, step S3 further includes the following steps:
[0036] S4. Upload the data collected by the collection device to the data collection center in the form of key-value pairs.
[0037] From the above description, it can be seen that uploading the data collected by the collection equipment to the data collection center facilitates centralized management and storage of data and subsequent data processing and analysis; at the same time, uploading data in the form of key-value pairs ensures the uniformity of the data format, making the data easier to understand and process.
[0038] Further, the Modbus configuration information in step S1 includes a data identifier, a register address, a data length, an operation code, a read / write type, a scaling factor, and a correction value, and the data identifier corresponds to the data type;
[0039] The data types are basic properties of the device, including current, voltage, power generation, charging capacity, software version number, and hardware version number.
[0040] From the above description, it can be seen that the configuration information includes key information such as register address, data length, read / write type, and operation code, which facilitates the acquisition device to obtain target data from the corresponding industrial equipment or change the Modbus protocol stored on the acquisition device; at the same time, the data type also covers a variety of basic attributes of the equipment, which can comprehensively describe the characteristics and status of industrial equipment, adapt to the needs of different equipment, and meet the data acquisition needs of different types of industrial equipment, with strong versatility.
[0041] Furthermore, the configuration information of the industrial equipment stored in the data acquisition center is changed accordingly in step S2, including adding a Modbus configuration, modifying a Modbus configuration, deleting a Modbus configuration, querying a Modbus configuration, and exporting a Modbus configuration.
[0042] From the above description, it can be seen that the configuration information can be flexibly changed according to actual needs to meet the requirements for industrial equipment data collection in different scenarios.
[0043] Please refer to Figure 3 , a dynamic configuration implementation terminal based on Modbus protocol, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor completes the following steps when executing the computer program:
[0044] S1. The Modbus configuration information of different industrial devices is stored in a readable and writable data format through the data acquisition center;
[0045] S2. According to the change of the Modbus protocol between the industrial equipment and the corresponding acquisition equipment, the configuration information of the industrial equipment stored in the data acquisition center is changed accordingly;
[0046] S3. Update the Modbus protocol of the corresponding industrial equipment stored in the acquisition device according to the changed configuration information issued by the data acquisition center, and perform data acquisition on the industrial equipment based on the updated Modbus protocol.
[0047] From the above description, it can be seen that the beneficial effects of the present invention are: a dynamic configuration implementation terminal based on the Modbus protocol of the present invention stores the Modbus protocol configuration of the device in the data acquisition center, and when the Modbus protocol of the industrial equipment is changed, the Modbus configuration information in the data acquisition center is changed accordingly, and the configuration information is sent to the acquisition device to complete the update of the Modbus protocol stored on the acquisition device, so that when the industrial equipment protocol changes, there is no need to recover the acquisition device and update the firmware of the acquisition device one by one, thereby overcoming the defect of poor compatibility of the existing data acquisition center with industrial equipment; at the same time, in the case of the same device and the same protocol, only the configuration needs to be copied for reuse without updating the firmware of the acquisition device. At the same time, the operation is simple and easy to use, which greatly improves the versatility and flexibility of the data acquisition module, greatly reduces the maintenance time and workload, and reduces the operating cost.
[0048] Further, step S3 includes:
[0049] S31. According to the changed configuration information sent by the data center, analyze and obtain the device model and corresponding acquisition device ID of the industrial device whose configuration information has been changed;
[0050] S32, reading the configuration information according to the device model and converting it into a key-value pair and sending it to the network communication module of the acquisition device;
[0051] S33. The network communication module performs matching according to the acquisition device ID and the device model in the configuration information. Only when the acquisition device ID and the device model match, the Modbus protocol of the corresponding industrial device stored in the acquisition device is updated, and data is collected from the industrial device based on the updated Modbus protocol.
[0052] From the above description, it can be seen that by parsing the device model and corresponding acquisition device ID of the industrial equipment whose configuration information has changed, it is ensured that only the relevant acquisition devices are accurately updated, avoiding unnecessary operations and waste of resources, and ensuring the accuracy and effectiveness of the update.
[0053] Furthermore, step S3 further includes the following steps:
[0054] S4. Upload the data collected by the collection device to the data collection center in the form of key-value pairs.
[0055] From the above description, it can be seen that uploading the data collected by the collection equipment to the data collection center facilitates centralized management and storage of data and subsequent data processing and analysis; at the same time, uploading data in the form of key-value pairs ensures the uniformity of the data format, making the data easier to understand and process.
[0056] Further, the Modbus configuration information in step S1 includes a data identifier, a register address, a data length, an operation code, a read / write type, a scaling factor, and a correction value, and the data identifier corresponds to the data type;
[0057] The data types are basic properties of the device, including current, voltage, power generation, charging capacity, software version number, and hardware version number.
[0058] From the above description, it can be seen that the configuration information includes key information such as register address, data length, read / write type, and operation code, which facilitates the acquisition device to obtain target data from the corresponding industrial equipment or change the Modbus protocol stored on the acquisition device; at the same time, the data type also covers a variety of basic attributes of the equipment, which can comprehensively describe the characteristics and status of industrial equipment, adapt to the needs of different equipment, and meet the data acquisition needs of different types of industrial equipment, with strong versatility.
[0059] Furthermore, the configuration information of the industrial equipment stored in the data acquisition center is changed accordingly in step S2, including adding a Modbus configuration, modifying a Modbus configuration, deleting a Modbus configuration, querying a Modbus configuration, and exporting a Modbus configuration.
[0060] From the above description, it can be seen that the configuration information can be flexibly changed according to actual needs to meet the requirements for industrial equipment data collection in different scenarios.
[0061] The present invention discloses a method and a terminal for realizing dynamic configuration based on Modbus protocol, which are applicable to the field of industrial technology for remotely changing the Modbus protocol of corresponding industrial equipment stored in a collection device.
[0062] Please refer to Figure 1 and Figure 2 , Embodiment 1 of the present invention is:
[0063] A method for implementing dynamic configuration based on Modbus protocol, comprising the steps of:
[0064] S1. The Modbus configuration information of different industrial devices is stored in a readable and writable data format through the data acquisition center;
[0065] In this embodiment, the data collection center stores the Modbus protocol configuration information of the industrial equipment in the form of a Json file. The Json file is named after the device model of the device. In other equivalent embodiments, it is not limited to the Json file.
[0066] Among them, the Modbus configuration information includes data identifier code, register address addres, length Length, operation code Operation, read-write type IOType, scaling factor Offset, and correction value ModifyRule; each data identifier corresponds to a data type, and the data type includes the basic properties of the device (such as current, voltage, power generation, charging amount, software version number, hardware version number, etc.).
[0067] S2. According to the change of the Modbus protocol between the industrial equipment and the corresponding acquisition equipment, the configuration information of the industrial equipment stored in the data acquisition center is changed accordingly;
[0068] like Figure 2 In this embodiment, there are at least five situations for changing the configuration information stored in the data acquisition center, namely: adding a new Modbus configuration, modifying the Modbus configuration, deleting the Modbus configuration and querying the Modbus configuration; when adding a new Modbus configuration, you can select and fill in the Modbus configuration parameters or directly import the Modbus protocol; when modifying the Modbus configuration, you need to select the modification object first, and then modify it; when deleting the Modbus configuration, you need to select the object to be deleted, and then delete it; when searching for new Modbus configuration, you can enter the keyword to be queried, and if there is corresponding content, the new search information will be displayed; when exporting the Modbus configuration, you need to first select the object to be exported, then select the export format, and finally perform the export operation.
[0069] S3. Update the Modbus protocol of the corresponding industrial equipment stored in the acquisition device according to the changed configuration information issued by the data acquisition center, and perform data acquisition on the industrial equipment based on the updated Modbus protocol.
[0070] Please refer to Figure 1 , Embodiment 2 of the present invention is:
[0071] A dynamic configuration implementation method based on the Modbus protocol, based on the first embodiment, step S3 includes:
[0072] S31. According to the changed configuration information sent by the data center, analyze and obtain the device model and corresponding acquisition device ID of the industrial device whose configuration information has been changed;
[0073] S32, reading the configuration information according to the device model and converting it into a key-value pair and sending it to the network communication module of the acquisition device;
[0074] In this embodiment, the corresponding configuration information file is found according to the device model, the configuration information is read and converted into a key-value pair such as Code:address, and sent to the network communication module of the acquisition device, wherein the sent configuration information carries the ID and device model of the acquisition device.
[0075] S33. The network communication module performs matching according to the acquisition device ID and the device model in the configuration information. Only when the acquisition device ID and the device model match, the Modbus protocol of the corresponding industrial device stored in the acquisition device is updated, and data is collected from the industrial device based on the updated Modbus protocol.
[0076] In this embodiment, after the network communication module of the acquisition device receives the configuration information, it obtains the device ID and device model in the configuration information. When the device ID and device model match, it continues to parse and obtain the Code:addres key-value pair, which is recorded in the cache inside the acquisition device to complete the update of the Modbus protocol. The acquisition module of the acquisition device requests data from the industrial device connected to it through the register address addres in the configuration information.
[0077] Step S3 also includes the following steps:
[0078] S4. The data collected by the collection device is uploaded to the data collection center in the form of key-value pairs.
[0079] In this embodiment, the collection device receives the return data of the corresponding industrial device, and uploads the data to the data collection center in the form of a key-value pair of Code:Value.
[0080] Please refer to Figure 3 , Embodiment 3 of the present invention is:
[0081] A dynamic configuration implementation terminal based on the Modbus protocol comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the dynamic configuration implementation method based on the Modbus protocol described in the first or second embodiment above are implemented.
[0082] In summary, the present invention provides a dynamic configuration implementation method and terminal based on the Modbus protocol, which stores the Modbus protocol configuration of the device in the data acquisition center, and when the Modbus protocol of the industrial device is changed, the Modbus configuration information in the data acquisition center is changed accordingly, and the configuration information is sent to the acquisition device to complete the update of the Modbus protocol stored on the acquisition device, so that when the industrial device protocol is changed, there is no need to recycle the acquisition device and update the firmware of the acquisition device one by one, thereby overcoming the defect of poor compatibility of the existing data acquisition center with industrial equipment; at the same time, in the case of the same device and the same protocol, only the configuration needs to be copied for reuse without updating the firmware of the acquisition device, and at the same time, the operation is simple and easy to use, which greatly improves the versatility and flexibility of the data acquisition module, greatly reduces the maintenance time and workload, and reduces the operating cost.
[0083] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for implementing dynamic configuration based on Modbus protocol, characterized in that: Includes steps: S1. The Modbus configuration information of different industrial devices is stored in a readable and writable data format through the data acquisition center; S2. According to the change of the Modbus protocol between the industrial equipment and the corresponding acquisition equipment, the configuration information of the industrial equipment stored in the data acquisition center is changed accordingly; S3. Update the Modbus protocol of the corresponding industrial equipment stored in the acquisition device according to the changed configuration information issued by the data acquisition center, and perform data acquisition on the industrial equipment based on the updated Modbus protocol.
2. A method for implementing dynamic configuration based on Modbus protocol according to claim 1, characterized in that: Step S3 includes: S31. According to the changed configuration information sent by the data center, analyze and obtain the device model and corresponding acquisition device ID of the industrial device whose configuration information has been changed; S32, reading the configuration information according to the device model and converting it into a key-value pair and sending it to the network communication module of the acquisition device; S33. The network communication module performs matching according to the acquisition device ID and the device model in the configuration information. Only when the acquisition device ID and the device model match, the Modbus protocol of the corresponding industrial device stored in the acquisition device is updated, and data is collected from the industrial device based on the updated Modbus protocol.
3. A method for implementing dynamic configuration based on Modbus protocol according to claim 1, characterized in that: Step S3 also includes the following steps: S4. Upload the data collected by the collection device to the data collection center in the form of key-value pairs.
4. A method for implementing dynamic configuration based on Modbus protocol according to claim 1, characterized in that: The Modbus configuration information in step S1 includes a data identifier, a register address, a data length, an operation code, a read / write type, a scaling factor, and a correction value, wherein the data identifier corresponds to the data type; The data types are basic properties of the device, including current, voltage, power generation, charging capacity, software version number, and hardware version number.
5. A method for implementing dynamic configuration based on Modbus protocol according to claim 1, characterized in that: The step S2 is to make corresponding changes to the configuration information of the industrial equipment stored in the data acquisition center, including adding a Modbus configuration, modifying a Modbus configuration, deleting a Modbus configuration, querying a Modbus configuration, and exporting a Modbus configuration.
6. A terminal for realizing dynamic configuration based on Modbus protocol, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the following steps are implemented: S1. The Modbus configuration information of different industrial devices is stored in a readable and writable data format through the data acquisition center; S2. According to the change of the Modbus protocol between the industrial equipment and the corresponding acquisition equipment, the configuration information of the industrial equipment stored in the data acquisition center is changed accordingly; S3. Update the Modbus protocol of the corresponding industrial equipment stored in the acquisition device according to the changed configuration information issued by the data acquisition center, and perform data acquisition on the industrial equipment based on the updated Modbus protocol.
7. A Modbus protocol-based dynamic configuration implementation terminal according to claim 6, characterized in that: Step S3 includes: S31. According to the changed configuration information sent by the data center, analyze and obtain the device model and corresponding acquisition device ID of the industrial device whose configuration information has been changed; S32, reading the configuration information according to the device model and converting it into a key-value pair and sending it to the network communication module of the acquisition device; S33. The network communication module performs matching according to the acquisition device ID and the device model in the configuration information. Only when the acquisition device ID and the device model match, the Modbus protocol of the corresponding industrial device stored in the acquisition device is updated, and data is collected from the industrial device based on the updated Modbus protocol.
8. A Modbus protocol-based dynamic configuration implementation terminal according to claim 6, characterized in that: Step S3 also includes the following steps: S4. Upload the data collected by the collection device to the data collection center in the form of key-value pairs.
9. A Modbus protocol-based dynamic configuration implementation terminal according to claim 6, characterized in that: The Modbus configuration information in step S1 includes a data identifier, a register address, a data length, an operation code, a read / write type, a scaling factor, and a correction value, wherein the data identifier corresponds to the data type; The data types are basic properties of the device, including current, voltage, power generation, charging capacity, software version number, and hardware version number.
10. A Modbus protocol-based dynamic configuration implementation terminal according to claim 6, characterized in that: The step S2 is to make corresponding changes to the configuration information of the industrial equipment stored in the data acquisition center, including adding a Modbus configuration, modifying a Modbus configuration, deleting a Modbus configuration, querying a Modbus configuration, and exporting a Modbus configuration.