Modbus protocol maintenance method and device, electronic equipment, storage medium and computer program product
By presetting maintenance macros in the target Excel file, the Modbus protocol maintenance file is automatically generated, which solves the problem of the complexity of the Modbus protocol maintenance in large-scale industrial control scenarios, and achieves an efficient and accurate maintenance process.
Patent Information
- Application Number
- CN202411271376.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-01-14
AI Technical Summary
In large-scale industrial control scenarios, the maintenance of the Modbus protocol becomes complicated and inconvenient, especially due to frequent equipment updates and diverse network topology changes, which makes manual modification of source code and configuration parameters time-consuming and error-prone, and the description document update is lagging.
By detecting the maintenance events of Modbus protocol data in the target Excel file, the preset maintenance macro is called to generate the Modbus protocol maintenance file, including source code files, configuration files and description documents, and automatically perform source code maintenance, configuration parameter maintenance and description document maintenance. Use Excel's own macro function to automatically generate maintenance files.
It reduces the workload and potential errors of manually writing maintenance files, improves the accuracy and consistency of maintenance files, and realizes unified, efficient, batch-accurate Modbus protocol maintenance in large-scale industrial control scenarios.
Smart Images

Figure CN119311622A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial control technology, and in particular to a Modbus protocol maintenance method, device, electronic device, storage medium and computer program product. Background Art
[0002] The Modbus protocol is a serial communication protocol widely used in the field of industrial control. It defines a master-slave communication mode that allows data exchange between devices.
[0003] Although the Modbus protocol is widely used in the field of industrial control, in actual use, due to factors such as frequent equipment updates and diverse changes in network topology, the maintenance of the Modbus protocol has become increasingly complex, requiring maintenance personnel to manually update and maintain the source code, configuration parameters, and documentation of the Modbus protocol.
[0004] However, manually modifying source code and configuration parameters is not only time-consuming but also error-prone. Especially when facing large-scale industrial control systems, a large amount of manpower is often required to maintain the Modbus protocol. In addition, the update of the documentation often lags behind the actual modification operation, further exacerbating the inconvenience of Modbus protocol maintenance. Summary of the invention
[0005] The main purpose of this application is to provide a Modbus protocol maintenance method, device, electronic device, storage medium and computer program product, aiming to solve the technical problem of inconvenient Modbus protocol maintenance in large-scale industrial control scenarios.
[0006] To achieve the above objectives, the present application provides a Modbus protocol maintenance method, comprising:
[0007] After detecting that a Modbus protocol maintenance event is triggered based on the Modbus protocol data of the target device in the target Excel file, calling a Modbus protocol maintenance macro preset in the target Excel file to generate a Modbus protocol maintenance file of the target device according to the Modbus protocol data, wherein the Modbus protocol maintenance file includes a Modbus protocol source code file, a Modbus protocol configuration file, and a Modbus protocol description document;
[0008] Based on the Modbus protocol maintenance file, performing Modbus protocol maintenance on the target device, the Modbus protocol maintenance including Modbus protocol source code maintenance, Modbus protocol configuration parameter maintenance, and Modbus protocol description document maintenance;
[0009] Among them, the Modbus protocol source code file is used to perform Modbus protocol source code maintenance on the target device, the Modbus protocol configuration file is used to perform Modbus protocol configuration parameter maintenance on the target device, and the Modbus protocol description document is used to perform Modbus protocol description document maintenance on the target device.
[0010] In one embodiment, the Modbus protocol maintenance macro includes a Modbus protocol source code macro, and the Modbus protocol source code file is generated as follows:
[0011] Calling a Modbus protocol source code macro preset in a target Excel file, performing code generation on the Modbus protocol data, obtaining a Modbus protocol source code, and generating a Modbus protocol source code file according to the Modbus protocol source code;
[0012] Wherein, according to the Modbus protocol source code, the step of generating a Modbus protocol source code file comprises:
[0013] writing the Modbus protocol source code into a first form preset in the target Excel file, and after detecting a source code export instruction based on the first form, exporting the Modbus protocol source code in the first form into a Modbus protocol source code file according to the source code export instruction; or,
[0014] The Modbus protocol source code is imported into a preset source code file to obtain a Modbus protocol source code file.
[0015] In one embodiment, the Modbus protocol maintenance macro includes a Modbus protocol configuration macro, and the Modbus protocol configuration file is generated as follows:
[0016] Calling the Modbus protocol configuration macro preset in the target Excel file, performing configuration analysis on the Modbus protocol data, obtaining Modbus protocol configuration parameters, and generating a Modbus protocol configuration file according to the Modbus protocol configuration parameters;
[0017] Wherein, according to the Modbus protocol configuration parameters, the step of generating a Modbus protocol configuration file comprises:
[0018] Writing the Modbus protocol configuration parameters into a second form preset in the target Excel file, and after detecting a configuration parameter export instruction based on the second form, exporting the Modbus protocol configuration parameters in the second form as a Modbus protocol configuration file according to the configuration parameter export instruction; or,
[0019] The Modbus protocol configuration parameters are imported into a preset configuration file to obtain a Modbus protocol configuration file.
[0020] In one embodiment, the Modbus protocol maintenance macro includes a Modbus protocol description macro, and the Modbus protocol description document is generated as follows:
[0021] Calling a Modbus protocol description macro preset in a target Excel file, performing description analysis on the Modbus protocol data, obtaining Modbus protocol description information, and generating a Modbus protocol description document according to the Modbus protocol description information;
[0022] Wherein, the step of generating a Modbus protocol description document according to the Modbus protocol description information includes:
[0023] Writing the Modbus protocol description information into a third form preset in the target Excel file, and after detecting a description information export instruction based on the third form, exporting the Modbus protocol description information in the third form as a Modbus protocol description document according to the description information export instruction; or,
[0024] The Modbus protocol description information is imported into a preset description document to obtain a Modbus protocol description document.
[0025] In one embodiment, the method further comprises:
[0026] After detecting that the Modbus protocol data of the target device in the target Excel file is changed, determining that a Modbus protocol maintenance event is triggered based on the Modbus protocol data of the target device in the target Excel file.
[0027] In one embodiment, before the step of performing Modbus protocol maintenance on the target device based on the Modbus protocol maintenance file, the method further includes:
[0028] The Modbus protocol maintenance file is verified, wherein the verification includes integrity verification, consistency verification, security verification and compatibility verification.
[0029] In addition, to achieve the above-mentioned purpose, the present application also provides a Modbus protocol maintenance device, the device comprising:
[0030] A first maintenance module is used to call a preset Modbus protocol maintenance macro in a target Excel file after detecting a Modbus protocol maintenance event trigger based on Modbus protocol data of a target device in a target Excel file, so as to generate a Modbus protocol maintenance file of the target device according to the Modbus protocol data, wherein the Modbus protocol maintenance file includes a Modbus protocol source code file, a Modbus protocol configuration file, and a Modbus protocol description document;
[0031] A second maintenance module is used to perform Modbus protocol maintenance on the target device based on the Modbus protocol maintenance file, wherein the Modbus protocol maintenance includes Modbus protocol source code maintenance, Modbus protocol configuration parameter maintenance, and Modbus protocol description document maintenance;
[0032] Among them, the Modbus protocol source code file is used to perform Modbus protocol source code maintenance on the target device, the Modbus protocol configuration file is used to perform Modbus protocol configuration parameter maintenance on the target device, and the Modbus protocol description document is used to perform Modbus protocol description document maintenance on the target device.
[0033] In addition, to achieve the above-mentioned purpose, the present application also provides an electronic device, which includes: a memory, a processor, and a Modbus protocol maintenance program stored in the memory and executable on the processor, wherein the Modbus protocol maintenance program implements the steps of the Modbus protocol maintenance method as described above when executed by the processor.
[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a storage medium, which is a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the Modbus protocol maintenance method as described above are implemented.
[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, including a computer program, which implements the steps of the Modbus protocol maintenance method as described above when executed by a processor.
[0036] The present application provides a Modbus protocol maintenance method, device, electronic device, storage medium and computer program product. The technical solution of the present application is to call the preset Modbus protocol maintenance macro in the target Excel file after detecting that a Modbus protocol maintenance event based on the Modbus protocol data of the target device in the target Excel file is triggered, so as to generate a Modbus protocol maintenance file of the target device according to the Modbus protocol data, wherein the Modbus protocol maintenance file includes a Modbus protocol source code file, a Modbus protocol configuration file, and a Modbus protocol description document, and then perform Modbus protocol maintenance on the target device based on the Modbus protocol maintenance file, wherein the Modbus protocol maintenance includes Modbus protocol source code maintenance, Modbus protocol configuration parameter maintenance, and Modbus protocol description document maintenance, the Modbus protocol source code file is used to perform Modbus protocol source code maintenance on the target device, and the Modbus protocol configuration file is used to perform Modbus protocol configuration parameter maintenance on the target device Maintenance, the Modbus protocol description document is used to maintain the Modbus protocol description document of the target device, so that this application can use the macro function of Excel to pre-write the Modbus protocol maintenance macro for automatically converting the Modbus protocol data organized in a specified format and stored in an Excel file into a Modbus protocol maintenance file including a Modbus protocol source code file, a Modbus protocol configuration file and a Modbus protocol description document. Then, when it is necessary to perform Modbus protocol maintenance on a specified device, it is only necessary to adjust the Modbus protocol data of the specified device stored in the Excel file, and the Modbus protocol maintenance file for maintaining the Modbus protocol of the specified device can be automatically generated with the help of the pre-written Modbus protocol maintenance macro, so as to avoid the workload and potential errors caused by manually writing Modbus protocol maintenance files, improve the accuracy and consistency of Modbus protocol maintenance files, and realize unified, efficient, and accurate batch Modbus protocol maintenance in large-scale industrial control scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0039] Figure 1 A flow chart of the first embodiment of the Modbus protocol maintenance method of the present application;
[0040] Figure 2 This is a schematic diagram of the module structure of the Modbus protocol maintenance device of the embodiment of the present application;
[0041] Figure 3 The present invention is a schematic diagram of the device structure of the hardware operating environment involved in the Modbus protocol maintenance method in the embodiment of the present application.
[0042] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0043] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0045] At present, due to factors such as frequent equipment updates and diverse changes in network topology, the maintenance of the Modbus protocol is extremely inconvenient in large-scale industrial control scenarios.
[0046] The main solution of the embodiment of the present application is: after detecting the triggering of a Modbus protocol maintenance event based on the Modbus protocol data of the target device in the target Excel file, calling the Modbus protocol maintenance macro preset in the target Excel file to generate a Modbus protocol maintenance file of the target device according to the Modbus protocol data, the Modbus protocol maintenance file including a Modbus protocol source code file, a Modbus protocol configuration file, and a Modbus protocol description document; based on the Modbus protocol maintenance file, performing Modbus protocol maintenance on the target device, the Modbus protocol maintenance including Modbus protocol source code maintenance, Modbus protocol configuration parameter maintenance, and Modbus protocol description document maintenance; wherein the Modbus protocol source code file is used to perform Modbus protocol source code maintenance on the target device, the Modbus protocol configuration file is used to perform Modbus protocol configuration parameter maintenance on the target device, and the Modbus protocol description document is used to perform Modbus protocol description document maintenance on the target device.
[0047] The embodiment of the present application can pre-write a Modbus protocol maintenance macro for automatically converting Modbus protocol data organized in a specified format and stored in an Excel file into a Modbus protocol maintenance file including a Modbus protocol source code file, a Modbus protocol configuration file and a Modbus protocol description document through the macro function provided by Excel. Further, when it is necessary to perform Modbus protocol maintenance on a specified device, it is only necessary to adjust the Modbus protocol data of the specified device stored in the Excel file, and the Modbus protocol maintenance file for maintaining the Modbus protocol of the specified device can be automatically generated with the help of the pre-written Modbus protocol maintenance macro, so as to avoid the workload and potential errors caused by manually writing Modbus protocol maintenance files, improve the accuracy and consistency of Modbus protocol maintenance files, and realize unified, efficient, and batch-accurate Modbus protocol maintenance in large-scale industrial control scenarios.
[0048] It should be noted that the execution subject of the embodiments of the present application is an electronic device, which may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (Televisions), desktop computers, etc., or any electronic device that can achieve the above functions, and the embodiments of the present application do not specifically limit this. The following uses electronic devices as the execution subject as an example to illustrate the following embodiments of the present application.
[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0050] Please refer to Figure 1 , Figure 1 A flowchart of the first embodiment of the Modbus protocol maintenance method of the present application is provided.
[0051] The present application proposes a Modbus protocol maintenance method of a first embodiment, comprising steps S100 to S200:
[0052] Step S100, after detecting that a Modbus protocol maintenance event is triggered based on the Modbus protocol data of the target device in the target Excel file, calling a Modbus protocol maintenance macro preset in the target Excel file to generate a Modbus protocol maintenance file of the target device according to the Modbus protocol data, wherein the Modbus protocol maintenance file includes a Modbus protocol source code file, a Modbus protocol configuration file, and a Modbus protocol description document;
[0053] Step S200, based on the Modbus protocol maintenance file, performing Modbus protocol maintenance on the target device, wherein the Modbus protocol maintenance includes Modbus protocol source code maintenance, Modbus protocol configuration parameter maintenance, and Modbus protocol description document maintenance;
[0054] Among them, the Modbus protocol source code file is used to perform Modbus protocol source code maintenance on the target device, the Modbus protocol configuration file is used to perform Modbus protocol configuration parameter maintenance on the target device, and the Modbus protocol description document is used to perform Modbus protocol description document maintenance on the target device.
[0055] It should be noted that the Modbus protocol source code refers to the source code of the Modbus protocol, that is, a set of programming codes that implement the Modbus protocol functions, mainly including the code for initializing the serial communication port, the function for processing the received Modbus request and responding according to the request type, the function for writing and reading register values, the code snippets for error handling and logging, etc. Modbus protocol configuration parameters refer to the configuration parameters of the Modbus protocol, that is, the configurable parameters that affect the Modbus communication behavior, including but not limited to the baud rate, the number of data bits, parity, stop bits, timeout, address mapping, etc. Modbus protocol description documents refer to the description documents of the Modbus protocol, that is, the documents provided to users or developers, mainly including configuration guides, function descriptions, troubleshooting, version history and other description information (that is, Modbus protocol description information), which can help maintenance personnel understand and maintain the Modbus protocol and improve the accuracy and efficiency of Modbus protocol maintenance.
[0056] Those skilled in the art will know that Modbus protocol maintenance refers to the maintenance of the Modbus protocol, which aims to ensure that the device can continue to communicate stably through the Modbus protocol, reduce problems caused by communication failures, and improve the reliability and efficiency of the system. Specifically, Modbus protocol maintenance includes Modbus protocol source code maintenance, Modbus protocol configuration parameter maintenance, and Modbus protocol description document maintenance.
[0057] Among them, Modbus protocol source code maintenance refers to the maintenance of Modbus protocol source code, that is, the maintenance of software code that implements Modbus protocol functions, mainly including correcting errors in the code, updating outdated functions, adding new features, or optimizing existing code to improve performance. For example, if it is found that some functions no longer work as expected during the Modbus communication process, such as failure to read register data, then it is necessary to check and repair the source code responsible for the function and perform Modbus protocol source code maintenance.
[0058] Modbus protocol configuration parameter maintenance refers to the continued maintenance of Modbus protocol configuration parameters, that is, adjusting the configuration parameters related to Modbus communication, in order to ensure the stability and reliability of the communication link. The configuration parameters involved mainly include baud rate, data bit, parity check, stop bit, etc. For example, if the communication between devices is unstable, it may be caused by improper baud rate setting. At this time, it is necessary to adjust the baud rate parameters and perform Modbus protocol configuration parameter maintenance to better adapt to the current communication environment.
[0059] Modbus protocol description document maintenance refers to the maintenance of Modbus protocol description information, that is, updating and maintaining Modbus protocol related description information to ensure the accuracy, completeness and timeliness of its content. For example, with the update of the Modbus protocol version, some information in the old description document may no longer be applicable, so it is necessary to update the description document, perform Modbus protocol description document maintenance, add new function descriptions or correct outdated information.
[0060] In the present embodiment, the Modbus protocol maintenance file is a set of files required for Modbus protocol maintenance, including a Modbus protocol source code file, a Modbus protocol configuration file, and a Modbus protocol description document. Wherein, the Modbus protocol source code file contains the latest Modbus protocol source code, which is used to update the Modbus protocol firmware or software of the device and perform Modbus protocol source code maintenance. The Modbus protocol configuration file stores the latest Modbus protocol configuration parameters, which are used to update the Modbus configuration parameters of the device and perform Modbus protocol configuration parameter maintenance. The Modbus protocol description document includes the latest Modbus protocol description information, which is used to update the Modbus protocol description information of the device and perform Modbus protocol description document maintenance.
[0061] It should also be noted that, in the present embodiment, Modbus protocol data is Modbus protocol related information required to generate a Modbus protocol culture file, typically including register address, register data type, function code, function description, baud rate, check mode, stop bit, device address, data range, data ratio, parameter description, variable noun, variable description, etc. The target Excel file is an Excel file that stores Modbus protocol data. The Modbus protocol maintenance macro is a macro preset in the target Excel file, which is used to generate a Modbus maintenance file based on the Modbus protocol data. The Modbus protocol maintenance event refers to an event that triggers the call of the Modbus protocol maintenance macro to generate a Modbus protocol maintenance file. The target device refers to industrial equipment that requires Modbus protocol maintenance, such as PLC, sensor, actuator, etc.
[0062] In this embodiment, the Modbus protocol data of the target device is stored in a target Excel file, and a Modbus protocol maintenance macro for generating a Modbus maintenance file according to the Modbus protocol data is preset in the target Excel file. Therefore, when it is necessary to perform Modbus protocol maintenance on the target device, it is only necessary to modify the Modbus protocol data of the target device in the target Excel file, and then trigger a Modbus protocol maintenance event based on the Modbus protocol data of the target device in the target Excel file. The Modbus protocol maintenance macro preset in the target Excel file can be called to process the Modbus protocol data of the target device, and the Modbus protocol maintenance file required for performing Modbus protocol maintenance on the target device is automatically generated, and then Modbus protocol maintenance is performed on the target device through the Modbus protocol maintenance file.
[0063] This embodiment realizes the automatic generation of Modbus protocol maintenance files by presetting Modbus protocol maintenance macros in Excel files, eliminating the need for manual writing by maintenance personnel, effectively reducing the workload of maintenance personnel, greatly improving the efficiency of Modbus protocol maintenance, and avoiding maintenance errors that may be caused by manual writing, thereby ensuring the accuracy of Modbus protocol maintenance files and improving the success rate of Modbus protocol maintenance.
[0064] Through the Modbus protocol maintenance method provided in this embodiment, maintenance personnel do not need to have an in-depth understanding of the specific implementation details or programming knowledge of the Modbus protocol. They only need to have basic Excel operation skills to modify the Modbus protocol data in the Excel file and complete most of the Modbus protocol maintenance work, which greatly reduces the technical threshold for Modbus protocol maintenance and the requirements for maintenance personnel's professional knowledge, thereby reducing the company's investment cost in maintenance personnel training.
[0065] In addition, when performing Modbus protocol maintenance, the Modbus protocol maintenance method provided in this embodiment synchronizes the modification of Modbus protocol source code and configuration parameters with the update of description documents, ensuring the consistency between technical documents and actual configurations. Maintenance personnel can refer to the latest description documents at any time to understand the latest status of the equipment, which helps to quickly locate problems when Modbus protocol maintenance is required next time, reduces maintenance difficulties caused by document lags, and prompts the convenience of Modbus protocol maintenance.
[0066] In an embodiment, when facing Modbus protocol maintenance in a large-scale industrial control scenario, the user only needs to store the Modbus protocol data of all devices in a target Excel file in a unified format, and load a pre-written macro code file that can realize the function of generating a Modbus protocol maintenance file according to the Modbus protocol data into the target Excel file, or a professional developer creates a Modbus protocol maintenance macro in the target Excel file, and writes a macro code that realizes the function of generating a Modbus protocol maintenance file according to the Modbus protocol data through a VBA editor to complete the preset of the Modbus protocol maintenance macro, and then in each subsequent Modbus protocol maintenance, the Modbus protocol can be maintained in batches through the Modbus protocol maintenance macro, that is, after the Modbus protocol data of the target devices in this batch that need to be maintained by the Modbus protocol in the target Excel file are modified in sequence, the corresponding Modbus protocol maintenance events are triggered in sequence, and Modbus protocol maintenance files are generated in sequence for maintenance, or after all the Modbus protocol data of the target devices in this batch that need to be maintained by the Modbus protocol in the target Excel file are modified, the Modbus protocol maintenance events for this batch of target devices are uniformly triggered, and Modbus protocol maintenance files are generated in batches and maintenance is completed.
[0067] It should be noted that, in this embodiment, the triggering conditions of the Modbus protocol maintenance event can be set according to actual needs. For example, a control button associated with the Modbus protocol maintenance macro is set in the target Excel file, so that the touching of the control button is used as the triggering condition of the Modbus protocol maintenance event, that is, after detecting the touching of the control button, it is determined that the Modbus protocol maintenance event is triggered. For example, the modification of the Modbus protocol data in the target Excel is used as the triggering condition of the Modbus protocol maintenance event, that is, after detecting that the Modbus protocol data in the target Excel is modified and maintained, it is determined that the Modbus protocol maintenance event is triggered.
[0068] Exemplarily, in a feasible implementation manner, the method further includes step S300:
[0069] Step S300, after detecting that the Modbus protocol data of the target device in the target Excel file has changed, determining a Modbus protocol maintenance event trigger based on the Modbus protocol data of the target device in the target Excel file.
[0070] In this embodiment, the trigger condition of the Modbus protocol maintenance event is the change of Modbus protocol data. It can be triggered immediately after the change, or after the change and confirmation to save the modification. The user can set it according to actual needs.
[0071] Furthermore, in a feasible implementation manner, before step S200, the method further includes step S400:
[0072] Step S400, verifying the Modbus protocol maintenance file, wherein the verification includes integrity verification, consistency verification, security verification and compatibility verification.
[0073] In this embodiment, after the Modbus protocol maintenance file is generated, it is first verified to determine the integrity, consistency, security and compatibility of the Modbus protocol maintenance file, to ensure that the generated maintenance file contains all necessary parts, without missing key components or information, and is consistent with the Modbus protocol data of the corresponding device in the target Excel file, without any deviation or error, and without any security vulnerabilities or risks, to ensure that maintenance according to the Modbus protocol maintenance file will not cause security issues, and that it matches the corresponding device, can run correctly on the corresponding device, and will not conflict with other software or hardware.
[0074] It is not difficult to understand that when the Modbus protocol maintenance file passes the verification, the operation of performing Modbus protocol maintenance on the target device based on the Modbus protocol maintenance file is automatically executed to complete the Modbus protocol maintenance. When the Modbus protocol maintenance file fails to pass the verification, this embodiment will output the verification results and the information detected during the verification process to the maintenance personnel, so that the maintenance personnel can quickly identify the problem and solve the problem. In addition, when the Modbus protocol maintenance files of multiple target devices are verified, it can be set to perform Modbus protocol maintenance normally for those that pass the verification, and only intercept those that fail to pass the verification. After the maintenance personnel check and make corresponding adjustments, the Modbus protocol maintenance file is regenerated and verified again.
[0075] In this embodiment, the Modbus protocol maintenance macro includes a Modbus protocol source code macro, and the Modbus protocol source code file is generated as follows:
[0076] Calling a Modbus protocol source code macro preset in a target Excel file, performing code generation on the Modbus protocol data, obtaining a Modbus protocol source code, and generating a Modbus protocol source code file according to the Modbus protocol source code;
[0077] Wherein, the step of generating a Modbus protocol source code file according to the Modbus protocol source code comprises steps A10 to A20:
[0078] Step A10, writing the Modbus protocol source code into a first form preset in the target Excel file, and after detecting a source code export instruction based on the first form, exporting the Modbus protocol source code in the first form into a Modbus protocol source code file according to the source code export instruction;
[0079] Step A20, alternatively, importing the Modbus protocol source code into a preset source code file to obtain a Modbus protocol source code file.
[0080] It should be noted that the Modbus protocol source code macro is a macro specifically used to generate a Modbus protocol source code file. When the macro is called, code can be generated for the Modbus protocol data to obtain the Modbus protocol source code, thereby generating a Modbus protocol source code file based on the Modbus protocol source code.
[0081] After the Modbus protocol source code is generated, it can be written into the target Excel file first, and then exported as a Modbus protocol source code file after verification. Alternatively, the created source code file can be directly imported to obtain the Modbus protocol source code file.
[0082] If it is written into the target Excel file first, and then exported as a Modbus protocol source code file after detection and confirmation, it can be written into the first form in the target Excel file. The first form can be a pre-created form specifically used to store and display the Modbus protocol source code, or it can be a form temporarily created when generating the Modbus protocol source code, or a form specified by the user.
[0083] This embodiment writes the Modbus protocol source code into the first form, so that the maintenance personnel can check it at the first time. After checking and confirming that it is correct, the maintenance personnel inputs the source code export instruction, so as to export the Modbus protocol source code in the first form into a Modbus protocol source code file according to the source code export instruction.
[0084] It is not difficult to understand that when the first form stores multiple copies of Modbus protocol source codes of different devices, you can choose to export all of them, or you can choose to export only one or more of them.
[0085] In this embodiment, the Modbus protocol maintenance macro includes a Modbus protocol configuration macro, and the Modbus protocol configuration file is generated as follows:
[0086] Calling the Modbus protocol configuration macro preset in the target Excel file, performing configuration analysis on the Modbus protocol data, obtaining Modbus protocol configuration parameters, and generating a Modbus protocol configuration file according to the Modbus protocol configuration parameters;
[0087] Among them, the step of generating a Modbus protocol configuration file according to the Modbus protocol configuration parameters includes steps B10 to B20:
[0088] Step B10, writing the Modbus protocol configuration parameters into a second form preset in the target Excel file, and after detecting a configuration parameter export instruction based on the second form, exporting the Modbus protocol configuration parameters in the second form as a Modbus protocol configuration file according to the configuration parameter export instruction;
[0089] Step B20, alternatively, importing the Modbus protocol configuration parameters into a preset configuration file to obtain a Modbus protocol configuration file.
[0090] It should be noted that the Modbus protocol configuration macro is a macro specifically used to generate a Modbus protocol configuration file. When the macro is called, it can perform configuration parsing on the Modbus protocol data to obtain the Modbus protocol configuration parameters, thereby generating a Modbus protocol configuration file based on the Modbus protocol configuration parameters.
[0091] After the Modbus protocol configuration parameters are generated, they can be written into the target Excel file first, and then exported as a Modbus protocol configuration file after being tested and confirmed to be correct. Alternatively, the created configuration file can be directly imported to obtain the Modbus protocol configuration file.
[0092] If it is written into the target Excel file first, and then exported as a Modbus protocol configuration file after detection and confirmation, it can be written into the second form in the target Excel file. The second form can be a pre-created form specifically used to store and display Modbus protocol configuration parameters, or it can be a form temporarily created when generating Modbus protocol configuration parameters, or a form specified by the user.
[0093] This embodiment writes the Modbus protocol configuration parameters into the second form, so that the maintenance personnel can check them at the first time. After checking and confirming that they are correct, the maintenance personnel inputs the configuration parameter export instruction, so that the Modbus protocol configuration parameters in the second form are exported as a Modbus protocol configuration file according to the configuration parameter export instruction.
[0094] It is not difficult to understand that when the second form stores multiple copies of Modbus protocol configuration parameters of different devices, you can choose to export all of them, or you can choose to export only one or more of them.
[0095] In this embodiment, the Modbus protocol maintenance macro includes a Modbus protocol description macro, and the Modbus protocol description document is generated as follows:
[0096] Calling a Modbus protocol description macro preset in a target Excel file, performing description analysis on the Modbus protocol data, obtaining Modbus protocol description information, and generating a Modbus protocol description document according to the Modbus protocol description information;
[0097] The step of generating a Modbus protocol description document according to the Modbus protocol description information includes steps C10 to C20:
[0098] Step C10, writing the Modbus protocol description information into a third form preset in the target Excel file, and after detecting a description information export instruction based on the third form, exporting the Modbus protocol description information in the third form into a Modbus protocol description document according to the description information export instruction;
[0099] Step C10, alternatively, importing the Modbus protocol description information into a preset description document to obtain a Modbus protocol description document.
[0100] It should be noted that the Modbus protocol description macro is a macro specifically used to generate a Modbus protocol description document. When the macro is called, it can parse the Modbus protocol data to obtain the Modbus protocol description information, and then generate a Modbus protocol description document based on the Modbus protocol description information.
[0101] After the Modbus protocol description information is generated, it can be written into the target Excel file first, and then exported as a Modbus protocol description document after verification. Alternatively, the created description document can be directly imported to obtain the Modbus protocol description document.
[0102] If it is written into the target Excel file first, and then exported as a Modbus protocol description document after detection and confirmation, it can be written into a third form in the target Excel file. The third form can be a pre-created form specifically used to store and display Modbus protocol description information, or a form temporarily created when generating Modbus protocol description information, or a form specified by the user.
[0103] This embodiment writes the Modbus protocol description information into the third form, so that the maintenance personnel can check it at the first time. After checking and confirming that it is correct, the maintenance personnel inputs the description information export instruction, so that the Modbus protocol description information in the third form is exported as a Modbus protocol description document according to the description information export instruction.
[0104] It is not difficult to understand that when the third form stores multiple copies of Modbus protocol description information of different devices, you can choose to export all of them, or you can choose to export only one or more of them.
[0105] In addition, please refer to Figure 2 , Figure 2 This is a schematic diagram of the module structure of the Modbus protocol maintenance device of an embodiment of the present application.
[0106] The present application also provides a Modbus protocol maintenance device, the device comprising:
[0107] A first maintenance module 10 is used to call a Modbus protocol maintenance macro preset in a target Excel file after detecting a Modbus protocol maintenance event trigger based on Modbus protocol data of a target device in a target Excel file, so as to generate a Modbus protocol maintenance file of the target device according to the Modbus protocol data, wherein the Modbus protocol maintenance file includes a Modbus protocol source code file, a Modbus protocol configuration file, and a Modbus protocol description document;
[0108] A second maintenance module 20, configured to perform Modbus protocol maintenance on the target device based on the Modbus protocol maintenance file, wherein the Modbus protocol maintenance includes Modbus protocol source code maintenance, Modbus protocol configuration parameter maintenance, and Modbus protocol description document maintenance;
[0109] Among them, the Modbus protocol source code file is used to perform Modbus protocol source code maintenance on the target device, the Modbus protocol configuration file is used to perform Modbus protocol configuration parameter maintenance on the target device, and the Modbus protocol description document is used to perform Modbus protocol description document maintenance on the target device.
[0110] In one embodiment, the Modbus protocol maintenance macro includes a Modbus protocol source code macro, and the first maintenance module 10 is further used to:
[0111] Calling a Modbus protocol source code macro preset in a target Excel file, performing code generation on the Modbus protocol data, obtaining a Modbus protocol source code, and generating a Modbus protocol source code file according to the Modbus protocol source code;
[0112] The first maintenance module 10 is also used for:
[0113] writing the Modbus protocol source code into a first form preset in the target Excel file, and after detecting a source code export instruction based on the first form, exporting the Modbus protocol source code in the first form into a Modbus protocol source code file according to the source code export instruction; or,
[0114] The Modbus protocol source code is imported into a preset source code file to obtain a Modbus protocol source code file.
[0115] In one embodiment, the Modbus protocol maintenance macro includes a Modbus protocol configuration macro, and the first maintenance module 10 is further used to:
[0116] Calling the Modbus protocol configuration macro preset in the target Excel file, performing configuration analysis on the Modbus protocol data, obtaining Modbus protocol configuration parameters, and generating a Modbus protocol configuration file according to the Modbus protocol configuration parameters;
[0117] The first maintenance module 10 is also used for:
[0118] Writing the Modbus protocol configuration parameters into a second form preset in the target Excel file, and after detecting a configuration parameter export instruction based on the second form, exporting the Modbus protocol configuration parameters in the second form as a Modbus protocol configuration file according to the configuration parameter export instruction; or,
[0119] The Modbus protocol configuration parameters are imported into a preset configuration file to obtain a Modbus protocol configuration file.
[0120] In one embodiment, the Modbus protocol maintenance macro includes a Modbus protocol description macro, and the first maintenance module 10 is further used to:
[0121] Calling a Modbus protocol description macro preset in a target Excel file, performing description analysis on the Modbus protocol data, obtaining Modbus protocol description information, and generating a Modbus protocol description document according to the Modbus protocol description information;
[0122] The first maintenance module 10 is also used for:
[0123] Writing the Modbus protocol description information into a third form preset in the target Excel file, and after detecting a description information export instruction based on the third form, exporting the Modbus protocol description information in the third form as a Modbus protocol description document according to the description information export instruction; or,
[0124] The Modbus protocol description information is imported into a preset description document to obtain a Modbus protocol description document.
[0125] In one embodiment, the device further includes a third maintenance module (not shown), and the third maintenance module (not shown) is used to:
[0126] After detecting that the Modbus protocol data of the target device in the target Excel file is changed, determining that a Modbus protocol maintenance event is triggered based on the Modbus protocol data of the target device in the target Excel file.
[0127] In one embodiment, the second maintenance module 20 is further used for:
[0128] The Modbus protocol maintenance file is verified, wherein the verification includes integrity verification, consistency verification, security verification and compatibility verification.
[0129] The Modbus protocol maintenance device provided by the present application adopts the Modbus protocol maintenance method in the above embodiment, which can solve the technical problem of inconvenient Modbus protocol maintenance in large-scale industrial control scenarios. Compared with the prior art, the beneficial effects of the Modbus protocol maintenance device provided by the present application are the same as the beneficial effects of the Modbus protocol maintenance method provided by the above embodiment, and other technical features in the Modbus protocol maintenance device are the same as the features disclosed by the Modbus protocol maintenance method in the above embodiment, which will not be repeated here.
[0130] In addition, please refer to Figure 3 , Figure 3 The present invention is a schematic diagram of the device structure of the hardware operating environment involved in the Modbus protocol maintenance method in the embodiment of the present application.
[0131] The present application also provides an electronic device, comprising: at least one processor; and 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 execute the Modbus protocol maintenance method in the above-mentioned embodiment.
[0132] Reference below Figure 3 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic devices in the embodiments of the present application include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (Televisions), desktop computers, etc., or any electronic device capable of implementing the above functions. Figure 3 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0133] like Figure 3As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0134] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0135] The electronic device provided by the present application adopts the Modbus protocol maintenance method in the above embodiment, which can solve the technical problem of inconvenient Modbus protocol maintenance in large-scale industrial control scenarios. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the Modbus protocol maintenance method provided by the above embodiment, and other technical features in the electronic device are the same as the features disclosed by the Modbus protocol maintenance method in the above embodiment, which will not be repeated here.
[0136] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0137] In addition, the present application also provides a storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and when the computer-readable program instructions are executed, they are used to implement the steps of the Modbus protocol maintenance method in the above-mentioned embodiment.
[0138] The storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of storage media may include, but are not limited to: 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 above. In this embodiment, the storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0139] The above storage medium may be included in the electronic device; or may exist independently without being installed in the electronic device.
[0140] The storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: after detecting that a Modbus protocol maintenance event based on the Modbus protocol data of the target device in the target Excel file is triggered, the Modbus protocol maintenance macro preset in the target Excel file is called to generate a Modbus protocol maintenance file of the target device according to the Modbus protocol data, wherein the Modbus protocol maintenance file includes a Modbus protocol source code file, a Modbus protocol configuration file, and a Modbus protocol description document; based on the Modbus protocol maintenance file, the Modbus protocol maintenance is performed on the target device, wherein the Modbus protocol maintenance includes Modbus protocol source code maintenance, Modbus protocol configuration parameter maintenance, and Modbus protocol description document maintenance; wherein the Modbus protocol source code file is used to perform Modbus protocol source code maintenance on the target device, the Modbus protocol configuration file is used to perform Modbus protocol configuration parameter maintenance on the target device, and the Modbus protocol description document is used to perform Modbus protocol description document maintenance on the target device.
[0141] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0142] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0143] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0144] The storage medium provided by the present application is a computer-readable storage medium, on which computer-readable program instructions (i.e., computer programs) for executing the above-mentioned Modbus protocol maintenance method are stored, which can solve the technical problem of inconvenient Modbus protocol maintenance in large-scale industrial control scenarios. Compared with the prior art, the beneficial effects of the storage medium provided by the present application are the same as the beneficial effects of the Modbus protocol maintenance method provided by the above-mentioned embodiment, and will not be repeated here.
[0145] In addition, an embodiment of the present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the Modbus protocol maintenance method in the above embodiment are implemented.
[0146] The computer program product provided by the present application can solve the technical problem of inconvenient Modbus protocol maintenance in large-scale industrial control scenarios. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present application are the same as the beneficial effects of the Modbus protocol maintenance method provided by the above embodiment, which will not be repeated here.
[0147] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A Modbus protocol maintenance method, characterized in that: The method comprises: After detecting that a Modbus protocol maintenance event is triggered based on the Modbus protocol data of the target device in the target Excel file, calling a Modbus protocol maintenance macro preset in the target Excel file to generate a Modbus protocol maintenance file of the target device according to the Modbus protocol data, wherein the Modbus protocol maintenance file includes a Modbus protocol source code file, a Modbus protocol configuration file, and a Modbus protocol description document; Based on the Modbus protocol maintenance file, performing Modbus protocol maintenance on the target device, the Modbus protocol maintenance including Modbus protocol source code maintenance, Modbus protocol configuration parameter maintenance, and Modbus protocol description document maintenance; Among them, the Modbus protocol source code file is used to perform Modbus protocol source code maintenance on the target device, the Modbus protocol configuration file is used to perform Modbus protocol configuration parameter maintenance on the target device, and the Modbus protocol description document is used to perform Modbus protocol description document maintenance on the target device.
2. The Modbus protocol maintenance method according to claim 1, wherein: The Modbus protocol maintenance macro includes a Modbus protocol source code macro, and the Modbus protocol source code file is generated in the following manner: Calling a Modbus protocol source code macro preset in a target Excel file, performing code generation on the Modbus protocol data, obtaining a Modbus protocol source code, and generating a Modbus protocol source code file according to the Modbus protocol source code; Wherein, according to the Modbus protocol source code, the step of generating a Modbus protocol source code file comprises: writing the Modbus protocol source code into a first form preset in the target Excel file, and after detecting a source code export instruction based on the first form, exporting the Modbus protocol source code in the first form into a Modbus protocol source code file according to the source code export instruction; or, The Modbus protocol source code is imported into a preset source code file to obtain a Modbus protocol source code file.
3. The Modbus protocol maintenance method according to claim 1, characterized in that, The Modbus protocol maintenance macro includes a Modbus protocol configuration macro, and the Modbus protocol configuration file is generated as follows: Calling the Modbus protocol configuration macro preset in the target Excel file, performing configuration analysis on the Modbus protocol data, obtaining Modbus protocol configuration parameters, and generating a Modbus protocol configuration file according to the Modbus protocol configuration parameters; Wherein, according to the Modbus protocol configuration parameters, the step of generating a Modbus protocol configuration file comprises: Writing the Modbus protocol configuration parameters into a second form preset in the target Excel file, and after detecting a configuration parameter export instruction based on the second form, exporting the Modbus protocol configuration parameters in the second form as a Modbus protocol configuration file according to the configuration parameter export instruction; or, The Modbus protocol configuration parameters are imported into a preset configuration file to obtain a Modbus protocol configuration file.
4. The Modbus protocol maintenance method according to claim 1, wherein: The Modbus protocol maintenance macro includes a Modbus protocol description macro, and the Modbus protocol description document is generated as follows: Calling a Modbus protocol description macro preset in a target Excel file, performing description analysis on the Modbus protocol data, obtaining Modbus protocol description information, and generating a Modbus protocol description document according to the Modbus protocol description information; Wherein, the step of generating a Modbus protocol description document according to the Modbus protocol description information includes: Writing the Modbus protocol description information into a third form preset in the target Excel file, and after detecting a description information export instruction based on the third form, exporting the Modbus protocol description information in the third form as a Modbus protocol description document according to the description information export instruction; or, The Modbus protocol description information is imported into a preset description document to obtain a Modbus protocol description document.
5. The Modbus protocol maintenance method according to any one of claims 1 to 4, characterized in that: The method further comprises: After detecting that the Modbus protocol data of the target device in the target Excel file is changed, determining that a Modbus protocol maintenance event is triggered based on the Modbus protocol data of the target device in the target Excel file.
6. The Modbus protocol maintenance method according to any one of claims 1 to 4, characterized in that: Before the step of performing Modbus protocol maintenance on the target device based on the Modbus protocol maintenance file, the method further includes: The Modbus protocol maintenance file is verified, wherein the verification includes integrity verification, consistency verification, security verification and compatibility verification.
7. A Modbus protocol maintenance device, characterized in that: The device comprises: A first maintenance module is used to call a preset Modbus protocol maintenance macro in a target Excel file after detecting a Modbus protocol maintenance event trigger based on Modbus protocol data of a target device in a target Excel file, so as to generate a Modbus protocol maintenance file of the target device according to the Modbus protocol data, wherein the Modbus protocol maintenance file includes a Modbus protocol source code file, a Modbus protocol configuration file, and a Modbus protocol description document; A second maintenance module is used to perform Modbus protocol maintenance on the target device based on the Modbus protocol maintenance file, wherein the Modbus protocol maintenance includes Modbus protocol source code maintenance, Modbus protocol configuration parameter maintenance, and Modbus protocol description document maintenance; Among them, the Modbus protocol source code file is used to perform Modbus protocol source code maintenance on the target device, the Modbus protocol configuration file is used to perform Modbus protocol configuration parameter maintenance on the target device, and the Modbus protocol description document is used to perform Modbus protocol description document maintenance on the target device.
8. An electronic device, characterized in that: include: A memory, a processor, and a Modbus protocol maintenance program stored in the memory and executable on the processor, wherein the Modbus protocol maintenance program implements the steps of the Modbus protocol maintenance method according to any one of claims 1 to 6 when executed by the processor.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the Modbus protocol maintenance method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the Modbus protocol maintenance method according to any one of claims 1 to 6 are implemented.