A method for automatically generating instructions that comply with the Modbus protocol
By automatically generating Modbus protocol commands, analyzing sensor data to generate message commands, and optimizing the transmission cycle, the communication congestion and packet loss problems of sensor data transmission in embedded devices are solved, achieving efficient and reliable communication.
Patent Information
- Application Number
- CN202510863837.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-06-26
AI Technical Summary
In embedded devices, when transmitting multi-sensor data via the Modbus protocol, there are issues of communication congestion and packet loss, especially when there are many sensors and the data is irregular.
The method for automatically generating Modbus protocol commands analyzes sensor data to generate message commands, obtains the content coverage and data stability of the command set, and adjusts the transmission cycle to optimize communication.
It effectively avoids network congestion and packet loss, improves the packet loss resistance and real-time performance of industrial automation systems, and achieves efficient and reliable communication.
Smart Images

Figure CN120499164B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial communication technology, and more specifically to a method for automatically generating commands that conform to the Modbus protocol. Background Technology
[0002] Modbus is a widely used communication protocol in industrial automation, particularly suitable for data exchange between embedded systems and control devices. This protocol is simple and efficient, typically used for communication between different types of industrial equipment, such as programmable logic controllers, sensors, actuators, and frequency converters. As a serial communication protocol, Modbus supports data transmission via physical media such as RS-232 and RS-485. Its operation is based on a master-slave architecture, where the master device initiates a data request, and the slave device provides the corresponding data or executes commands based on the request. This communication mode ensures efficient collaboration and data exchange between different devices.
[0003] When configuring multiple sensors in an embedded device and transmitting and storing sensor parameters to the system via the Modbus protocol, the process involves several aspects, including data acquisition, communication configuration, message generation, and error checking. Generally, embedded devices need to acquire data from different sensors in real time during data communication to achieve corresponding control. Therefore, during the process of generating messages according to actual needs and transmitting data from multiple sensor devices via the Modbus protocol, the large short-term transmission volume of messages and the irregular nature of the data can lead to communication congestion or packet loss. Summary of the Invention
[0004] In view of the above, it is necessary to provide a method for automatically generating Modbus protocol-compliant instructions to solve the above problems.
[0005] This invention provides a method for automatically generating Modbus protocol-compliant commands, the method comprising:
[0006] The embedded device is configured with sensors, and the sensor data is used to generate corresponding message commands through the Modbus protocol; the message commands mainly include several request units and data change units;
[0007] Based on the data content of each demand unit in the message instruction, obtain the corresponding vector for each demand unit; denote the set of message instructions within a preset time period as the instruction set; based on the similarity of demand units in adjacent message instructions of the instruction set, obtain the content overlayability of the instruction set, and obtain the instruction set marked as the overlay layer.
[0008] For the time period corresponding to the marked instruction set, the message instruction transmission rules of the overlay layer are set; based on the numerical difference distribution of the data value of the data change unit in all adjacent message instructions of the instruction set, combined with the content coverability, the data stability of the instruction set is obtained.
[0009] Based on the data stability of the instruction set, the transmission period of Modbus protocol message instructions for the corresponding time period of the instruction set is adjusted, and the Modbus protocol message instructions that have been transmitted are obtained after the adjustment.
[0010] The vector corresponding to each demand unit consists of all the numeric characters in each demand unit of the message instruction.
[0011] Specifically, the overwriteability of the acquired instruction set content refers to:
[0012] In a message instruction within an instruction set, the similarity between vectors corresponding to the same demand unit in adjacent message instructions is calculated, and the absolute value of the difference between a preset value and the similarity is calculated. The negative correlation mapping results of the absolute values of the difference between the demand units in all adjacent message instructions within an instruction set are positively fused to obtain the content coverage of the instruction set.
[0013] Specifically, the instruction set marked as the overlay layer is obtained as follows:
[0014] When the normalized result of the content coverability of an instruction set is within a preset range, the corresponding instruction set is marked as an overlay layer.
[0015] The specific rules for transmitting messages and instructions in the overlay layer are as follows:
[0016] In the first transmission, the transmission includes both the demand unit and the data change unit; in other transmission batches, the specific value of the demand unit adopts the result of the first transmission, and the data value of the data change unit is transmitted separately.
[0017] The specific formula for the data stability of the obtained instruction set is as follows: ;in, Indicates the first Data stability of each instruction set; Indicates the first The difference in data representation values between the k-th message instruction and the (k+1)-th message instruction in the instruction set; K represents the number of message instructions in the instruction set; This indicates the overwriteability of the content of the i-th instruction set.
[0018] Specifically, the data representative value is the average of all numerical data in each message instruction.
[0019] The difference in the data representative values is determined by the absolute value of the difference between the numerical representative values.
[0020] The condition for adjusting the transmission cycle of Modbus protocol message instructions for the corresponding time period of the instruction set is that the normalized value of the data stability of the instruction set is less than a set value.
[0021] The formula for adjusting the transmission period of Modbus protocol message commands corresponding to the time period of the instruction set is as follows: ;in, This represents the Modbus protocol instruction message transmission period corresponding to the updated u-th instruction set; This represents the initial Modbus protocol command message transmission period corresponding to the time period of the u-th command set. This indicates the data stability of the u-th instruction set, and Norm() represents the normalization function.
[0022] The present invention has at least the following beneficial effects:
[0023] 1) Based on communication control requirements, generate corresponding Modbus protocol message instructions. In order to address the packet loss problem that is prone to occur during real-time transmission due to the large number of sensors, the content coverage of the instruction set is first obtained based on the similarity of adjacent message instructions of the demand unit in the instruction set. The instruction set marked as the coverage layer is obtained. Different messages have different control instruction information or data information. For messages that occupy more communication channels, their control information is often more consistent, which facilitates subsequent hierarchical management and transmission.
[0024] 2) Setting message instruction transmission rules for the time period corresponding to the marked instruction set helps optimize the application of the Modbus protocol and effectively improves the anti-packet loss capability and real-time performance of the entire industrial automation system when facing a large number of sensors. Furthermore, based on the numerical difference distribution of the data value of the data change unit in all adjacent message instructions of the instruction set, combined with the content coverage, the data stability of the instruction set is obtained. Its beneficial effect is to analyze the changes in the values of the data units in the message instructions, so as to more accurately judge the changes in the message instructions and facilitate the subsequent adjustment of the message instruction transmission cycle.
[0025] 3) Based on the data stability of the instruction set, the transmission period of Modbus protocol message instructions for the corresponding time period of the instruction set is adjusted. After adjustment, the Modbus protocol message instructions that have been transmitted are obtained. By reasonably adjusting the transmission period of Modbus protocol message instructions, packet loss and delay caused by network congestion, excessive device load and other problems can be effectively avoided, thereby achieving more efficient and reliable communication. Attached Figure Description
[0026] Figure 1 A flowchart of a method for automatically generating Modbus protocol-compliant instructions provided by the present invention;
[0027] Figure 2 A flowchart for adjusting the transmission period provided by the present invention. Detailed Implementation
[0028] In the description of the embodiments of the present invention, the words "exemplary," "or," and "for example" are used to indicate that they are examples, illustrations, or descriptions. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or design options. Specifically, the use of the words "exemplary," "or," and "for example" is intended to present the relevant concepts in a specific manner.
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0030] It should also be noted that the terms "first" and "second" in this invention and its accompanying drawings are used to distinguish similar objects, rather than to describe a specific order or sequence. The methods disclosed in the embodiments of this invention or the methods shown in the flowcharts include one or more steps for implementing the method. Without departing from the scope of protection of this invention, the execution order of multiple steps can be interchanged, and some steps can also be deleted.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0032] This invention proposes a method for automatically generating Modbus protocol-compliant instructions, applicable to the field of industrial communication technology. (See attached document.) Figure 1 The method includes the following steps:
[0033] S1: Configure the embedded device for sensors and generate corresponding message instructions from the sensor data using the Modbus protocol; the message instructions mainly include several request units and data change units.
[0034] Sensor configuration: The embedded device connects to the sensor through a hardware interface. The sensor's data acquisition frequency is 1Hz. In this embodiment, the connected sensors are a temperature and humidity sensor and a pressure sensor. The implementer can connect the required sensors according to the actual situation and set the data acquisition frequency himself. This invention does not limit this.
[0035] Data Acquisition: The embedded device reads data from the sensor via the I2C interface. The implementer can select the appropriate interface based on the characteristics of the sensor data required. It should be noted that in this invention, the sensor connected to the hardware interface can periodically acquire parameters and convert them into corresponding digital signals.
[0036] Data processing and message generation: After performing median filtering on the raw data collected by the sensor, the embedded device packages the processed data into a message using communication methods such as the Modbus protocol. Median filtering is a well-known existing technology and will not be elaborated upon in this invention.
[0037] In embedded systems, instruction sending and execution are typically performed via a specified protocol. In this embodiment, the executed instruction sequence can be described as follows: first, obtain the sensor's unique address; then, read the sensor register value; next, perform data verification; then, reread the data through multiple ports; and finally, transmit the data. In this embodiment, the instructions are written in message format using the Modbus protocol, and real-time data acquisition and control of the embedded device are achieved by transmitting these messages.
[0038] The message instruction generation process specifically involves: reading the Modbus protocol configuration file and parsing parameters such as register address, function code, data type, precision, and algorithm model; matching a predefined code template based on the parsed parameters, the template containing the general logic for Modbus protocol parsing; and parameterizing the matched template to generate specific message instructions. Since generating message instructions via the Modbus protocol is existing technology, this invention will not elaborate on it further.
[0039] In this embodiment, the basic units constituting the message instruction include two types: demand units and data change units. Specifically, the basic demand unit includes the addressing location, starting location, and number of registers within the sensor; while the data change unit mainly includes the read values of the sensor registers, and this number is not unique; a message can contain read values from multiple sensor registers.
[0040] To make it easier to understand, the following example illustrates that at a certain moment, an embedded device needs to simultaneously obtain the temperature and humidity values in the environment. In this case, the basic requirements such as the address location and the number of registers to be read are not unique, and the corresponding register values are also not unique, mainly the temperature and humidity values.
[0041] Data transmission: The embedded device transmits messages to the system terminal via the RS-485 communication interface. The system terminal receives and decodes the messages to obtain the sensor data.
[0042] Terminal processing and equipment control: The system terminal performs real-time analysis and processing of the received sensor data, and sends instructions to the corresponding execution devices according to the set control strategy to achieve environmental control.
[0043] S2: Based on the data content of each demand unit in the message instruction, obtain the corresponding vector for each demand unit; denote the set of message instructions within a preset time period as the instruction set; based on the similarity of the demand units in adjacent message instructions of the instruction set, obtain the content overlayability of the instruction set, and obtain the instruction set marked as the overlay layer.
[0044] In many embedded devices, multiple sensors are typically connected, resulting in large data volumes for each message. When transmitting data at high frequencies, bandwidth limitations can lead to communication congestion, causing data loss or packet drop. When packet drop occurs, the slave or master device cannot receive complete Modbus protocol command results in a timely manner, thus preventing the completion of data acquisition and transmission. Therefore, to ensure the effectiveness of Modbus protocol command generation results in actual embedded end-to-end communication, the command generation and transmission process needs to be optimized.
[0045] If instructions exhibit a high degree of repetition over a period of time, it can lead to excessive bandwidth consumption during communication transmission. Optimizing these highly repetitive instructions—for example, by merging them into single instructions and implementing hierarchical management during transmission—can effectively reduce the amount of data transmitted, thereby mitigating the impact of communication congestion. This reduction in short-term data throughput helps alleviate network bandwidth pressure and improve communication efficiency.
[0046] Based on this, the present invention analyzes message instructions over a period of time, evaluates their content, and then obtains the corresponding instruction content coverability, thereby serving the purpose of transmission layering. Specifically: it acquires message instructions and extracts their required unit character values to form a character unit sequence. ,in, Indicates the first A vector sequence consisting of numeric characters from all demand units in a Modbus protocol command at a given time. , , These represent the vectors corresponding to the 1st, 2nd, and kth demand units, respectively. Each demand unit corresponds to one vector; for example, if the address location is 0x03, then its corresponding vector is: .
[0047] Furthermore, Each protocol sending instruction is considered as an instruction set. Its transmission metrics and corresponding instruction content coverability are analyzed. In this embodiment, N is set to 100, but implementers can adjust it according to actual conditions. The more similar the instructions are at different times—that is, the more similar the addressing locations and other demand units are—the higher the pre-similarity of the same demand unit at different times. Based on this, the content coverability of the instruction set is obtained according to the similarity of demand units in adjacent message instructions within the instruction set. The instruction set is then marked. Specifically: within a message instruction in an instruction set, the similarity between vectors corresponding to the same demand unit in adjacent message instructions is calculated, and the absolute value of the difference between the preset value and the similarity is calculated. The negative correlation mapping results of the absolute values of the differences of all demand units in all adjacent message instructions within an instruction set are positively fused to obtain the content coverability of the instruction set. In this embodiment, the preset value is a number greater than or equal to 1, and the value is 1 in this embodiment; the similarity between vectors is obtained through cosine similarity; the negative correlation mapping of variables is calculated in the form of reciprocal. It should be noted that, in order to prevent the denominator from being 0, a preset value is added to the denominator of the negative correlation mapping result, which is 0.01; the positive fusion between multiple variables is obtained by summing.
[0048] It should be understood that the greater the similarity between the vectors corresponding to the same demand unit in adjacent message instructions, the higher the coverage of the corresponding instruction set content during instruction communication transmission. This is because the demand unit has a high degree of similarity at different instruction sending times, and the coverage of the instruction set content is higher. Correspondingly, the sensor function requirements of embedded devices are more uniform within the time range corresponding to the instruction set.
[0049] Message instructions may contain duplicate or similar content. If these duplicate parts are not processed, the entire message must be transmitted on every transmission, which consumes more bandwidth. By layering similar message instructions, these redundant parts can be merged or overwritten, avoiding the transmission of the same data every time.
[0050] Furthermore, the instruction set is judged based on its content overwhelmability. The specific process is as follows:
[0051] When the normalization result of the coverability of an instruction set is within a preset range [0.9,1] When the corresponding instruction set is defined as an overlay layer, the normalization method used is the maximum-minimum normalization method. The implementer can determine the normalization method according to the actual situation; this invention does not impose any restrictions on this. For instruction sets whose content coverage is not within the preset range, it is determined that their demand units have time-varying characteristics, and they are not marked to facilitate subsequent normal communication transmission control.
[0052] S3: For the time period corresponding to the marked instruction set, set the message instruction transmission rules of the overlay layer; based on the numerical difference distribution of the data value of the data change unit in all adjacent message instructions of the instruction set, and combined with the content coverability, obtain the data stability of the instruction set.
[0053] For the overlay layer, the required units exhibit high consistency, meaning that within the time range corresponding to the instruction set, the embedded device has a relatively regular purpose of data acquisition and transmission. For example, within the time range of 3:00 to 4:00, the embedded device only acquires and transmits temperature and humidity values. In this case, the required units only have two addressing locations and other fixed units; however, the specific sensor data unit values may have different results at different times.
[0054] Within the time frame corresponding to the overlay layer, during the transmission of message commands, the first transmission sends a request unit, such as an address location, to the host or slave. In subsequent transmission batches, the specific values of the request units are reused from the first transmission. In each subsequent transmission, because the temperature and humidity values collected by the device change, only the data values of the changed units are transmitted to the host or slave each time. This transmission method significantly reduces the bandwidth required for transmission, lowers the possibility of communication congestion, and eliminates problems such as command and control interruptions caused by packet loss.
[0055] Furthermore, the data values to be transmitted for each instruction set are analyzed. The variation characteristics of these data values reflect the validity of the transmitted data or the size of the data information within the time range corresponding to an instruction set. When the data information is too large, i.e., the data exhibits significant fluctuations within the transmission interval of adjacent protocol instructions, then to ensure data integrity and prevent the risk of increased channel occupancy due to frequent data changes, the transmission frequency is optimized based on the data stability. Based on this, the data stability of the instruction set is obtained by combining the numerical difference distribution of the data values of the data change units in all adjacent message instructions of the instruction set with the aforementioned content coverability. Specifically: ;in, Indicates the first Data stability of each instruction set; Indicates the first The difference between the data representative values in the k-th message instruction and the (k+1)-th message instruction in the instruction set should be noted. It should be noted that since a message instruction may contain multiple numerical data of different types, this embodiment mainly considers the numerical fluctuation of each message instruction in the instruction set. Therefore, the average of all numerical data in each message instruction is calculated as the data representative value of each message instruction. The difference between the data representative values is obtained by calculating the absolute value of the difference; K represents the number of message instructions in the instruction set. This indicates the overwriteability of the content of the i-th instruction set.
[0056] It should be understood that by analyzing the data differences under different message commands and combining them with the corresponding content coverage values, the smaller the difference, the higher the stability of the two adjacent message commands.
[0057] S4: Based on the data stability of the instruction set, adjust the transmission period of the Modbus protocol message instruction corresponding to the time period of the instruction set, and obtain the Modbus protocol message instruction after the transmission is completed.
[0058] By default, the Modbus protocol message transmission and reception frequency is the same as the sensor data acquisition frequency. Within the instruction set, if the data stability, after normalization, is less than a set value, the transmission frequency needs to be reduced to ensure data integrity, prevent packet loss, and compensate for data accumulation over time using the aforementioned high-efficiency overlay transmission method. When data stability is low, problems such as signal interference, packet loss, or insufficient network bandwidth may occur. Frequent data transmission will place a greater load on the network, leading to more data loss, increased latency, and even network collapse. In this embodiment, the normalization uses a maximum-minimum normalization method, with a set value of 0.3. Implementers can adjust this value according to their actual needs.
[0059] At this point, the updated Modbus protocol command message transmission cycle is: ;in, This represents the Modbus protocol instruction message transmission period corresponding to the updated u-th instruction set; This represents the initial Modbus protocol instruction message transmission period corresponding to the u-th instruction set, which is 1 second in this embodiment; This indicates the data stability of the u-th instruction set; Norm() represents the normalization function.
[0060] The flowchart for adjusting the transmission period is as follows: Figure 2 As shown.
[0061] It should be understood that the worse the data stability, the longer the corresponding transmission cycle and the lower the transmission frequency.
[0062] The above methods ensure low bandwidth usage and avoid packet loss during the transmission of Modbus protocol command messages, achieving the goal of high-efficiency transmission control after automatically generating Modbus protocol command messages.
[0063] This invention provides a method for automatically generating Modbus protocol instructions. The method includes: 1) generating corresponding Modbus protocol message instructions according to communication control requirements. In order to address the problem of packet loss that is prone to occur during real-time transmission due to the large number of sensors, the method first obtains the content coverage of the instruction set based on the similarity of the demand units in adjacent message instructions in the instruction set, and obtains the instruction set marked as the coverage layer. Different messages have different control instruction information or data information. For messages that occupy more communication channels, their control information is often more consistent, which facilitates subsequent hierarchical management and transmission.
[0064] 2) Setting message instruction transmission rules for the time period corresponding to the marked instruction set helps optimize the application of the Modbus protocol and effectively improves the anti-packet loss capability and real-time performance of the entire industrial automation system when facing a large number of sensors. Furthermore, based on the numerical difference distribution of the data value of the data change unit in all adjacent message instructions of the instruction set, combined with the content coverage, the data stability of the instruction set is obtained. Its beneficial effect is to analyze the changes in the values of the data units in the message instructions, so as to more accurately judge the changes in the message instructions and facilitate the subsequent adjustment of the message instruction transmission cycle.
[0065] 3) Based on the data stability of the instruction set, the transmission period of Modbus protocol message instructions for the corresponding time period of the instruction set is adjusted. After adjustment, the Modbus protocol message instructions that have been transmitted are obtained. By reasonably adjusting the transmission period of Modbus protocol message instructions, packet loss and delay caused by network congestion, excessive device load and other problems can be effectively avoided, thereby achieving more efficient and reliable communication.
[0066] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0067] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for automatically generating commands conforming to the Modbus protocol, characterized in that, The method includes the following steps: The embedded device is configured with sensors, and the sensor data is used to generate corresponding message instructions via the Modbus protocol; the message instructions mainly include several request units and data change units; Based on the data content of each demand unit in the message instruction, obtain the corresponding vector of each demand unit; denote the set of message instructions in a preset time period as the instruction set; obtain the content coverability of the instruction set based on the similarity of the demand units in adjacent message instructions in the instruction set; when the normalized result of the content coverability of an instruction set is within a preset range, mark the corresponding instruction set as the cover layer, and obtain the instruction set marked as the cover layer. For the time period corresponding to the marked instruction set, the message instruction transmission rules of the overlay layer are set as follows: In the first transmission, the transmission includes both the demand unit and the data change unit; in other transmission batches, the specific value of the demand unit adopts the result of the first transmission, and the data value of the data change unit is transmitted separately. Based on the numerical difference distribution of the data value of the data change unit in all adjacent message instructions of the instruction set, and combined with the content coverability, the data stability of the instruction set is obtained. Based on the data stability of the instruction set, the transmission period of Modbus protocol message instructions for the corresponding time period of the instruction set is adjusted to obtain the Modbus protocol message instructions after transmission is completed; the lower the data stability, the longer the transmission period.
2. The method for automatically generating Modbus protocol-compliant commands as described in claim 1, characterized in that, The vector corresponding to each demand unit consists of all the numeric characters in each demand unit of the message instruction.
3. The method for automatically generating Modbus protocol-compliant commands as described in claim 1, characterized in that, The content overwriteability of the acquired instruction set is specifically as follows: In a message instruction within an instruction set, the similarity between vectors corresponding to the same demand unit in adjacent message instructions is calculated, and the absolute value of the difference between a preset value and the similarity is calculated. The negative correlation mapping results of the absolute values of the difference between the demand units in all adjacent message instructions within an instruction set are positively fused to obtain the content coverage of the instruction set.
4. The method for automatically generating Modbus protocol-compliant commands as described in claim 1, characterized in that, The specific formula for the data stability of the obtained instruction set is as follows: Among them, Sta i Indicates the data stability of the i-th instruction set; ΔDa k This represents the difference in the data representation value between the k-th message instruction and the (k+1)-th message instruction in the i-th instruction set; K represents the number of message instructions in the instruction set; r i This indicates the overwriteability of the content of the i-th instruction set.
5. The method for automatically generating Modbus protocol-compliant commands as described in claim 4, characterized in that, The data representative value is specifically the average of all numerical data in each message instruction.
6. The method for automatically generating Modbus protocol-compliant commands as described in claim 4, characterized in that, The difference in the data representative values is determined by the absolute value of the difference between the numerical representative values.
7. The method for automatically generating Modbus protocol-compliant instructions as described in claim 1, characterized in that, The condition for adjusting the transmission cycle of Modbus protocol message commands for the corresponding time period of the command set is: the normalized value of the data stability of the command set is less than the set value.
8. The method for automatically generating Modbus protocol-compliant commands as described in claim 1, characterized in that, The formula for adjusting the transmission period of Modbus protocol message commands corresponding to the instruction set for a given time period is as follows: Among them, T u T0 represents the Modbus protocol command message transmission period corresponding to the updated u-th command set; Sta represents the initial Modbus protocol command message transmission period corresponding to the u-th command set. u This indicates the data stability of the u-th instruction set, and Norm() represents the normalization function.
Citation Information
Patent Citations
Data acquisition method and device based on Internet of Things gateway, and computer equipment
CN120201058A