Communication debugging method, system and equipment based on multivariate parameter dynamic optimization and medium

The host device sends test instructions and dynamically optimizes communication parameters, which solves the problem of cumbersome and conflicts in traditional ModBus communication, realizes automated debugging and efficient communication, and is suitable for industrial Internet of Things devices.

CN120498981APending Publication Date: 2025-08-15SHENZHEN ZHONGWU INTERNET TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510640965.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In the traditional ModBus communication debugging method, slave addresses need to be manually configured, which can easily lead to repeated addresses and bus conflicts, affect networking efficiency, and the debugging process is cumbersome, making it difficult to meet the needs of plug-and-play and mobile debugging of industrial IoT devices.

Method used

The host device sends test instructions, judges the validity and conflicts of slave addresses based on response time and data, performs automatic address redistribution, and dynamic optimization and debugging of multiple parameters, obtains the optimal communication parameter group, and realizes efficient communication between master and slave devices.

Benefits of technology

It realizes automatic scanning and conflict evasion of slave addresses, improves communication efficiency between communication debugging and master-slave devices, simplifies the debugging process, and meets the needs of plug-and-play and mobile debugging of industrial IoT devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120498981A_ABST
    Figure CN120498981A_ABST
Patent Text Reader

Abstract

The invention relates to a communication protocol technology, and discloses a multivariate parameter-based dynamic optimization communication debugging method, which comprises the following steps of: sending a test instruction to a preset slave station address according to a preset instruction format by utilizing host equipment; calculating response time according to the Baud rate of the host equipment, and obtaining response data of the slave station address to the instruction within the time; according to the response data, judging whether the slave station address completes response within the response time, and if not, judging the slave station address as an invalid address; if the response is finished, further judging whether address conflicts exist or not, judging that the address is a conflicting address and performing redistribution if the conflicts exist, and judging that the address is an effective address if the conflicts do not exist; the instruction sending step is repeated after the slave station addresses are subjected to ascending order; after instructions are sent to all slave station addresses, invalid addresses are obtained to form a set, dynamic debugging is carried out based on the set and a preset communication parameter set feature segment, so that an optimal communication parameter set is obtained, and communication between the master device and the slave device is carried out based on the optimal communication parameter set. According to the invention, the communication debugging efficiency and the communication efficiency between devices can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of communication protocols, and in particular to a communication debugging method, system, device and medium based on dynamic optimization of multiple parameters, and in particular to an application in the ModBus communication protocol. Background Art

[0002] With the rapid development of industrial automation and the Internet of Things (IoT), the ModBus protocol, a widely used industrial communication protocol, has become increasingly important in terms of its debugging methods and systems. Within the realm of industrial communication technology, ModBus, as one of the core communication protocols for interconnecting IIoT devices, is widely used in communication debugging scenarios for network devices such as PLCs, inverters, and IoT sensors. Traditional ModBus debugging methods rely on manual configuration of communication parameters (such as slave address, baud rate, and parity bit) and operation through PC-based software (such as ModBus Poll and Modscan). This makes it difficult to meet the IIoT's "plug-and-play" and "mobile debugging" requirements.

[0003] In traditional ModBus communications, slave addresses must be manually configured (ranging from 1 to 247). When multiple devices are on the bus, duplicate addresses can easily lead to bus conflicts, causing communication failures. Existing methods lack automated address scanning and conflict arbitration mechanisms, requiring individual device configuration during commissioning. Single-device address configuration takes over 120 seconds, and repeated conflict troubleshooting is required, severely impacting networking efficiency.

[0004] To address the shortcomings of existing technologies, the present invention proposes a ModBus debugging method and system based on multi-protocol feature recognition and dynamic self-optimization of multiple parameters. This method utilizes multi-protocol feature recognition technology to automatically identify multiple protocol features, significantly expanding the debugging scope. Furthermore, through dynamic self-optimization of multiple parameters, parameters can be dynamically adjusted based on the real-time communication environment, further improving debugging accuracy and efficiency. Summary of the Invention

[0005] The present invention provides a communication debugging method, system, device and medium based on dynamic optimization of multiple parameters, the main purpose of which is to solve the problems of low debugging efficiency and low communication efficiency of existing communication debugging methods.

[0006] To achieve the above objectives, the present invention provides a communication debugging method based on dynamic optimization of multiple parameters, comprising:

[0007] The host device sends a test instruction to the corresponding slave device according to the preset instruction format and the preset slave address;

[0008] Calculating the response time according to the baud rate of the host device, and obtaining the response data of the slave device corresponding to the slave address to the test instruction within the response time;

[0009] Determining whether the slave device completes the response within the response time according to the response data;

[0010] If the slave device fails to complete the response within the response time, determining that the slave address of the slave device is an invalid address;

[0011] If the slave device completes the response within the response time, determining whether there is an address conflict based on the response data;

[0012] If there is an address conflict, determining that the slave address of the slave device is a conflicting address, and performing address reallocation processing on the conflicting address;

[0013] If there is no address conflict, determining that the slave address of the slave device is a valid address;

[0014] After sorting the slave station addresses in ascending order, returning to the step of using the host device to send a test instruction to the corresponding slave station device according to a preset instruction format and a preset slave station address;

[0015] After sending the test instruction to all slave station addresses, all invalid addresses are acquired to obtain an invalid address set;

[0016] Dynamic optimization of communication parameters is performed based on the invalid address set and a preset communication parameter group characteristic segment to obtain an optimal communication parameter group, and communication between the master and slave devices is performed based on the optimal communication parameter group.

[0017] Optionally, the sending of the test instruction by the host device to the corresponding slave device according to a preset instruction format and a preset slave address includes:

[0018] Obtaining response data of the host device to a preset data read instruction;

[0019] Performing protocol feature identification on the slave device according to the reply data to obtain a protocol identification result;

[0020] Determine whether the slave device satisfies the MODBUS TCP or MODBUS RTU protocol characteristics at the same time according to the protocol identification result;

[0021] If the slave device does not meet the MODBUS TCP or MODBUS RTU protocol characteristics, the test instruction is sent to a new slave device using the host device and the slave address of the next queue;

[0022] If the slave device satisfies the MODBUS TCP or MODBUS RTU protocol features at the same time, the test instruction is subjected to protocol conversion based on a preset protocol priority to obtain a converted test instruction;

[0023] Sending the converted test instruction to the new slave device using the host device and the slave address of the next queue;

[0024] The protocol features of MODBUS_TCP and MODBUS_RTU are utilized to complete protocol identification of communication data and conversion between the two protocols.

[0025] Optionally, the performing address reallocation processing on the conflicting address includes:

[0026] Obtain an ID list of all slave addresses in the conflicting address;

[0027] Arrange all slave station addresses in the conflicting addresses in ascending order of ID according to the ID list to obtain an ascending address list;

[0028] Obtain the address with the smallest ID in the ascending address list according to the ID list to obtain the smallest ID address;

[0029] Confirm that the minimum ID address is a valid address;

[0030] The remaining addresses in the ascending address list are sequentially allocated to free addresses.

[0031] Optionally, the dynamically optimizing the communication parameters based on the invalid address set and the preset communication parameter group characteristic segment to obtain the optimal communication parameter group includes:

[0032] Obtaining a preset communication parameter group characteristic segment, and performing permutations and combinations on the communication parameters in the communication parameter group characteristic segment to obtain a communication parameter group set;

[0033] Arranging the communication parameter group set based on priority to obtain a communication parameter group sequence;

[0034] Selecting the first communication parameter group in the communication parameter group sequence as the test parameter group;

[0035] Sending a debugging instruction to an address in the invalid address set based on the test parameter group;

[0036] Acquire response quality data of the addresses in the invalid address set to the debug instruction;

[0037] Calculating a communication quality evaluation parameter based on the response quality data;

[0038] Determining whether the communication quality assessment parameter is greater than or equal to a preset quality threshold;

[0039] If the quality assessment parameter is less than the quality threshold, selecting the next communication parameter group in the communication parameter group sequence as a new test parameter group, and returning to the step of sending a debugging instruction to the address in the invalid address set based on the test parameter group;

[0040] If the quality assessment parameter is greater than or equal to the quality threshold, confirming that the test parameter group is the optimal communication parameter group;

[0041] When the debugging instruction is sent to the addresses in the invalid address set according to all communication parameter groups in the communication parameter group sequence, and no communication quality assessment parameter greater than or equal to the quality threshold is obtained, all communication quality assessment parameters are acquired to obtain a communication quality assessment parameter set;

[0042] The communication parameter group corresponding to the communication quality evaluation parameter with the largest communication quality evaluation parameter set is selected as the optimal communication parameter group.

[0043] Optionally, calculating a communication quality assessment parameter according to the response quality data includes:

[0044] Obtaining the bit error rate, effective throughput, round-trip delay, and address conflict frequency included in the response quality data;

[0045] Determining that the bit error rate, the effective throughput, the round-trip delay, and the address conflict frequency are all within a valid range;

[0046] If the bit error rate, the effective throughput, the round-trip delay, and the address conflict frequency are not all within a valid range, outputting an error signal;

[0047] If the bit error rate, the effective throughput, the round-trip delay, and the address conflict frequency are all within a valid range, performing an exponential operation on the bit error sensitivity index as an exponent of the bit error rate to obtain a bit error term;

[0048] Multiplying the round-trip delay by a preset delay adjustment coefficient to obtain a multiplication factor, and calculating a ratio of the effective throughput to the multiplication factor to obtain a ratio term;

[0049] Multiplying the address conflict frequency by a preset conflict penalty factor, taking the negation of the product to obtain a negation factor, and performing an exponential operation using the negation factor as the exponent of the base of a natural logarithm to obtain a conflict term;

[0050] The communication quality evaluation parameter is obtained by subtracting the bit error term from a preset integer and multiplying the resultant value by the ratio term and the conflict term.

[0051] Optionally, the calculation formula of the communication quality evaluation parameter is as follows:

[0052]

[0053] Among them, CQAM is the communication quality evaluation parameter, BER is the bit error rate contained in the response quality data, α is the preset error sensitivity index, T is the effective throughput contained in the response quality data, β is the preset delay adjustment coefficient, RTT is the round-trip delay contained in the response quality data, γ is the preset conflict penalty factor, and C is the address conflict frequency contained in the response quality data.

[0054] Optionally, after obtaining a preset communication parameter group characteristic segment and permuting and combining the communication parameters in the communication parameter group characteristic segment to obtain a communication parameter group set, the method further includes:

[0055] Obtaining a communication quality evaluation coefficient corresponding to each communication parameter group in the communication parameter group sequence to obtain a coefficient set;

[0056] Calculating in real time a communication quality evaluation coefficient when performing communication based on the optimal communication parameter group to obtain a detection evaluation coefficient;

[0057] Determining in real time whether the detection evaluation coefficient is less than the quality threshold;

[0058] When the detection evaluation coefficient is less than the quality threshold, determining whether the detection evaluation coefficient is greater than or equal to a preset second quality threshold;

[0059] If the detection evaluation coefficient is greater than or equal to the second quality threshold, adjusting the communication parameter group according to a preset balancing mode;

[0060] If the detection evaluation coefficient is less than the second quality threshold, performing communication parameter self-repair to obtain a repair result;

[0061] When it is determined according to the repair result that the repair has failed, the host device is restarted.

[0062] In order to solve the above problems, the present invention also provides a communication debugging system based on dynamic optimization of multiple parameters, the system comprising:

[0063] The data sending module is used to use the host device to send a test instruction to the corresponding slave device according to a preset instruction format and a preset slave address;

[0064] a response judgment module, configured to calculate a response time according to the baud rate of the host device, obtain response data of the slave device corresponding to the slave address to the test instruction within the response time, and judge whether the slave device completes the response within the response time according to the response data;

[0065] an address determination module, configured to determine, based on the response data, whether the slave device completes the response within the response time; if the slave device does not complete the response within the response time, determine that the slave address of the slave device is an invalid address; if the slave device completes the response within the response time, determine, based on the response data, whether there is an address conflict; if there is an address conflict, determine that the slave address of the slave device is a conflicting address, and perform address reallocation processing on the conflicting address; if there is no address conflict, determine that the slave address of the slave device is a valid address;

[0066] an address ascending module, configured to, after ascending the slave station addresses, return the ascending address to the data sending module, and execute the step of using the host device to send a test instruction to the corresponding slave station device according to a preset instruction format and a preset slave station address;

[0067] The parameter debugging module is used to obtain all invalid addresses after sending the test instruction to all slave station addresses, obtain an invalid address set, dynamically optimize the communication parameters based on the invalid address set and the preset communication parameter group characteristic segment, obtain the optimal communication parameter group, and communicate between the master and slave devices based on the optimal communication parameter group.

[0068] In order to solve the above problem, the present invention further provides an electronic device, comprising:

[0069] at least one processor;

[0070] and, a memory communicatively coupled to the at least one processor;

[0071] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned communication debugging method based on dynamic optimization of multiple parameters.

[0072] In order to solve the above problems, the present invention also provides a computer-readable storage medium, which stores at least one computer program. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned communication debugging method based on dynamic optimization of multiple parameters.

[0073] The embodiment of the present invention utilizes a host device to send a test instruction to a corresponding slave device according to a preset instruction format and a preset slave address;

[0074] Calculating the response time according to the baud rate of the host device, and obtaining the response data of the slave device corresponding to the slave address to the test instruction within the response time;

[0075] The method further comprises determining whether the slave device completes the response within the response time based on the response data. If the slave device does not complete the response within the response time, determining that the slave address of the slave device is an invalid address. If the slave device completes the response within the response time, determining whether there is an address conflict based on the response data. If there is an address conflict, determining that the slave address of the slave device is a conflicting address and performing address reallocation processing on the conflicting address. If there is no address conflict, determining that the slave address of the slave device is a valid address. After sorting the slave addresses in ascending order, the method further comprises returning to the step of using the host device to send a test instruction to the corresponding slave device according to a preset instruction format and a preset slave address. After sending the test instruction to all slave addresses, all invalid addresses are obtained to obtain an invalid address set. Based on the invalid address set and a preset communication parameter group feature segment, communication parameters are dynamically optimized to obtain an optimal communication parameter group. Communication between the master and slave devices is performed based on the optimal communication parameter group. This improves the efficiency of communication debugging and the communication efficiency between the master and slave devices. Therefore, the communication debugging method, system, electronic device and computer-readable storage medium based on dynamic optimization of multiple parameters proposed in the present invention can solve the problems of low debugging efficiency of existing communication debugging methods and low communication efficiency between master and slave devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 A flow chart of a communication debugging method based on dynamic optimization of multiple parameters provided by an embodiment of the present invention;

[0077] Figure 2 A functional module diagram of a communication debugging system based on dynamic optimization of multiple parameters provided by an embodiment of the present invention;

[0078] Figure 3 A schematic structural diagram of an electronic device for implementing the communication debugging method based on dynamic optimization of multiple parameters provided by an embodiment of the present invention.

[0079] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0080] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0081] The embodiment of the present application provides a communication debugging method based on dynamic optimization of multiple parameters. The execution subject of the communication debugging method based on dynamic optimization of multiple parameters includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the communication debugging method based on dynamic optimization of multiple parameters can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0082] Reference Figure 1 FIG. 1 is a flow chart of a method for dynamically optimizing communication based on multiple parameters according to an embodiment of the present invention. In this embodiment, the method for dynamically optimizing communication based on multiple parameters includes:

[0083] S1. Use the host device to send a test instruction to the corresponding slave device according to a preset instruction format and a preset slave address.

[0084] In an embodiment of the present invention, the format of the instruction sent may be slave address+function code+data field+CRC16 checksum.

[0085] In the embodiment of the present invention, the host device may be a PC host, which is used to send instructions to the slave device and perform communication debugging.

[0086] In the embodiment of the present invention, the slave station address is a communication address based on the ModBus communication protocol.

[0087] In detail, the slave address belongs to one of a preset address set, and each address in the address set is set with a serial number.

[0088] Furthermore, under the ModBus communication protocol, the address set includes a maximum of 247 slave station addresses, with an address range of 1-247.

[0089] In the embodiment of the present invention, the ModBus communication protocol is an industrial communication protocol widely used in the fields of industrial automation and the Internet of Things. It is mainly used to transmit data between various devices, such as programmable logic controllers (PLCs), sensors, and meters.

[0090] In an embodiment of the present invention, the method of using the host device to send a test instruction to the corresponding slave device according to a preset instruction format and a preset slave address includes:

[0091] Obtaining response data of the host device to a preset data read instruction;

[0092] Performing protocol feature identification on the slave device according to the reply data to obtain a protocol identification result;

[0093] Determine whether the slave device satisfies the MODBUS TCP or MODBUS RTU protocol characteristics at the same time according to the protocol identification result;

[0094] If the slave device does not meet the MODBUS TCP or MODBUS RTU protocol characteristics, the test instruction is sent to a new slave device using the host device and the slave address of the next queue;

[0095] If the slave device satisfies the MODBUS TCP or MODBUS RTU protocol features at the same time, the test instruction is subjected to protocol conversion based on a preset protocol priority to obtain a converted test instruction;

[0096] Sending the converted test instruction to the new slave device using the host device and the slave address of the next queue;

[0097] The protocol features of MODBUS_TCP and MODBUS_RTU are utilized to complete protocol identification of communication data and conversion between the two protocols.

[0098] In detail, the ModBus TCP and the ModBus RTU are two different versions of the ModBus communication protocol. ModBus TCP uses Ethernet transmission and is based on the TCP / IP protocol. It is suitable for high-speed communication and is widely used in industrial automation and the Internet of Things. ModBus RTU uses serial communication (such as RS-232 or RS-485), and data is transmitted in binary format. It is suitable for low-speed communication and is commonly used in industrial field buses.

[0099] In detail, the protocol feature identification is carried out to the slave device according to the reply data, by checking whether the first 7 bytes of the reply data meet the MBAP header specification of ModBus TCP, the MBAP header specification is: transaction marker 2 bytes, protocol marker 2 bytes (fixed to 0x0000), length 2 bytes, identifier 1 byte, the entire data packet has no CRC check, meets the MBAP logo, then the protocol of the device belongs to the ModBus_TCP protocol; and checking the last 2 bytes of the reply data as CRC value, calculating the CRC16 check code of the first N-2 bytes for comparison, if consistent, it means that the protocol of the device belongs to the ModBus_RTU protocol.

[0100] In detail, the preset protocol priority may be ModBus TCP priority or ModBus RTU priority, and may be set in advance according to the usage scenario.

[0101] S2. Calculate the response time according to the baud rate of the host device, and obtain response data of the slave device corresponding to the slave address to the test instruction within the response time.

[0102] In the embodiment of the present invention, the baud rate refers to the rate used for communication, the unit is bps, and the initial default is 9600bps.

[0103] In the embodiment of the present invention, the calculation formula of the response time is as follows:

[0104]

[0105] Wherein, t is the response time, L is the preset data frame length, B is the baud rate, and m is the preset response delay.

[0106] Specifically, the data frame refers to the standard frame length of the ModBus RTU broadcast instruction (the address scan instruction is 8 bytes, including a function code, an address field, etc.).

[0107] In detail, the preset response delay may be 50 ms.

[0108] S3. Determine, based on the response data, whether the slave device completes the response within the response time.

[0109] In an embodiment of the present invention, judging whether the slave device has completed the response within the response time based on the response data is performed by judging whether the response data is empty. If the response data is not empty, it is judged that the slave address has completed the response within the response time; if the response data is empty, it is judged that the slave address has not completed the response within the response time.

[0110] If the slave device does not complete the response within the response time, S4 is executed to determine that the slave address of the slave device is an invalid address.

[0111] In the embodiment of the present invention, when it is determined that the slave address of the slave device is an invalid address, S8 is executed to sort the slave addresses in ascending order.

[0112] If the slave device completes the response within the response time, step S5 is executed to determine whether there is an address conflict based on the response data.

[0113] In an embodiment of the present invention, determining whether an address conflict exists based on the response data refers to performing a CRC check on the response data to determine whether data redundancy exists. If data redundancy exists in the response data, it is determined that an address conflict exists; if data redundancy does not exist in the response data, it is determined that no data conflict exists.

[0114] If there is an address conflict, S6 is executed to determine that the slave address of the slave device is a conflicting address, and address reallocation processing is performed on the conflicting address.

[0115] In an embodiment of the present invention, the address reallocation processing of the conflicting addresses means that the slave station address with the smallest ID is retained first, and then the other slave station addresses are allocated to the next free address in sequence (such as address 1 conflicts → ID2 is allocated to address 2, and ID3 is allocated to address 3).

[0116] In the embodiment of the present invention, the address reallocation processing of the conflicting address includes:

[0117] Obtain an ID list of all slave addresses in the conflicting address;

[0118] Arrange all slave station addresses in the conflicting addresses in ascending order of ID according to the ID list to obtain an ascending address list;

[0119] Obtain the address with the smallest ID in the ascending address list according to the ID list to obtain the smallest ID address;

[0120] Confirm that the minimum ID address is a valid address;

[0121] The remaining addresses in the ascending address list are sequentially allocated to free addresses.

[0122] In the embodiment of the present invention, when it is determined that the slave address of the slave device is a conflicting address, address reallocation processing is performed on the conflicting address, thereby ensuring that each slave address has only one response data.

[0123] In the embodiment of the present invention, when it is determined that the slave address of the slave device is a conflicting address, after address reallocation processing is performed on the conflicting address, S8 is executed to sort the slave addresses in ascending order.

[0124] If there is no address conflict, step S7 is executed to determine whether the slave address of the slave device is a valid address.

[0125] S8, after sorting the slave station addresses in ascending order, return to S1, using the host device to send a test instruction to the corresponding slave station device according to a preset instruction format and a preset slave station address.

[0126] In an embodiment of the present invention, after the slave station address is in ascending order, it means selecting the next adjacent address of the current slave station address as the new slave station address. For example, if the slave station address is "1", then after the slave station address is in ascending order, the new slave station address is "2".

[0127] S9. After sending the test instruction to all slave station addresses, all invalid addresses are acquired to obtain an invalid address set.

[0128] In the embodiment of the present invention, there are 247 slave station addresses in total. After the test instruction is sent to the 247th slave station address, it is confirmed that all slave station addresses have been sent.

[0129] The obtaining of all invalid addresses and obtaining of an invalid address set means that each time the test instruction is sent to a slave address, if the slave address of the slave device is determined to be an invalid address, a record is made, and all slave addresses determined to be invalid addresses are obtained to obtain the invalid address set.

[0130] S10. Dynamically optimize communication parameters based on the invalid address set and a preset communication parameter group characteristic segment to obtain an optimal communication parameter group, and perform communication between the master and slave devices based on the optimal communication parameter group.

[0131] In an embodiment of the present invention, the dynamic optimization of communication parameters based on the invalid address set and the preset communication parameter group characteristic segment to obtain the optimal communication parameter group includes:

[0132] Obtaining a preset communication parameter group characteristic segment, and performing permutations and combinations on the communication parameters in the communication parameter group characteristic segment to obtain a communication parameter group set;

[0133] Arranging the communication parameter group set based on priority to obtain a communication parameter group sequence;

[0134] Selecting the first communication parameter group in the communication parameter group sequence as the test parameter group;

[0135] Sending a debugging instruction to an address in the invalid address set based on the test parameter group;

[0136] Acquire response quality data of the addresses in the invalid address set to the debug instruction;

[0137] Calculating a communication quality evaluation parameter based on the response quality data;

[0138] Determining whether the communication quality assessment parameter is greater than or equal to a preset quality threshold;

[0139] If the quality assessment parameter is less than the quality threshold, selecting the next communication parameter group in the communication parameter group sequence as a new test parameter group, and returning to the step of sending a debugging instruction to the address in the invalid address set based on the test parameter group;

[0140] If the quality assessment parameter is greater than or equal to the quality threshold, confirming that the test parameter group is the optimal communication parameter group;

[0141] When the debugging instruction is sent to the addresses in the invalid address set according to all communication parameter groups in the communication parameter group sequence, and no communication quality assessment parameter greater than or equal to the quality threshold is obtained, all communication quality assessment parameters are acquired to obtain a communication quality assessment parameter set;

[0142] The communication parameter group corresponding to the communication quality evaluation parameter with the largest communication quality evaluation parameter set is selected as the optimal communication parameter group.

[0143] In the embodiment of the present invention, the characteristic segment of the communication parameter group includes baud rate, check mode, stop bit, and timeout threshold.

[0144] In an embodiment of the present invention, the communication parameter group set obtained by permuting and combining the communication parameters in the communication parameter group characteristic segment refers to permuting and combining different baud rates, parity check modes, stop bits, and timeout thresholds. For example, the baud rates include 1200, 2400, 4800, 9600, 38400, 57200, and 115200, totaling seven different frequencies; the data bits include 8, 7, 6, and 5; the parity check modes include none, odd, and even, totaling three; the stop bits include 1, 1.5, and 2, totaling three; and the timeout thresholds include 100, 200, 500, 1000, 2000, and 5000, totaling six. Therefore, the total number of parameter groups is 7*4*3*3*6=1512.

[0145] In the embodiment of the present invention, the communication parameter group set is arranged based on priority by defining commonly used parameters as high priority. For example, if the commonly used baud rate is 96000bps, the baud rate 9600bps is defined as "priority 1".

[0146] In an embodiment of the present invention, calculating a communication quality evaluation parameter based on the response quality data includes:

[0147] Obtaining the bit error rate, effective throughput, round-trip delay, and address conflict frequency included in the response quality data;

[0148] Determining that the bit error rate, the effective throughput, the round-trip delay, and the address conflict frequency are all within a valid range;

[0149] If the bit error rate, the effective throughput, the round-trip delay, and the address conflict frequency are not all within a valid range, outputting an error signal;

[0150] If the bit error rate, the effective throughput, the round-trip delay, and the address conflict frequency are all within a valid range, performing an exponential operation on the bit error sensitivity index as an exponent of the bit error rate to obtain a bit error term;

[0151] Multiplying the round-trip delay by a preset delay adjustment coefficient to obtain a multiplication factor, and calculating a ratio of the effective throughput to the multiplication factor to obtain a ratio term;

[0152] Multiplying the address conflict frequency by a preset conflict penalty factor, taking the negation of the product to obtain a negation factor, and performing an exponential operation using the negation factor as the exponent of the base of a natural logarithm to obtain a conflict term;

[0153] The communication quality evaluation parameter is obtained by subtracting the bit error term from a preset integer and multiplying the resultant value by the ratio term and the conflict term.

[0154] In detail, the preset integer may be 1.

[0155] In the embodiment of the present invention, the calculation formula of the communication quality evaluation parameter is as follows:

[0156]

[0157] Among them, CQAM is the communication quality evaluation parameter, BER is the bit error rate contained in the response quality data, α is the preset error sensitivity index, T is the effective throughput contained in the response quality data, β is the preset delay adjustment coefficient, RTT is the round-trip delay contained in the response quality data, γ is the preset conflict penalty factor, and C is the address conflict frequency contained in the response quality data.

[0158] In detail, the error sensitivity index is a coefficient used to amplify the penalty for high error, and the error sensitivity index may be 1.2.

[0159] In detail, the delay adjustment coefficient is used to normalize the delay impact (for example, when the delay adjustment coefficient is 100, the round-trip delay is 200ms, and the corresponding denominator is 20000ms), and the delay adjustment coefficient can be 100.

[0160] In detail, the conflict penalty factor is used to control the attenuation strength of the conflict rate, and the conflict penalty factor may be 0.5.

[0161] In this embodiment of the present invention, the quality threshold may be 1.

[0162] In an embodiment of the present invention, after obtaining a preset communication parameter group characteristic segment and permuting and combining the communication parameters in the communication parameter group characteristic segment to obtain a communication parameter group set, the method further includes:

[0163] Obtaining a communication quality evaluation coefficient corresponding to each communication parameter group in the communication parameter group sequence to obtain a coefficient set;

[0164] Calculating in real time a communication quality evaluation coefficient when performing communication based on the optimal communication parameter group to obtain a detection evaluation coefficient;

[0165] Determining in real time whether the detection evaluation coefficient is less than the quality threshold;

[0166] When the detection evaluation coefficient is less than the quality threshold, determining whether the detection evaluation coefficient is greater than or equal to a preset second quality threshold;

[0167] If the detection evaluation coefficient is greater than or equal to the second quality threshold, adjusting the communication parameter group according to a preset balancing mode;

[0168] If the detection evaluation coefficient is less than the second quality threshold, performing communication parameter self-repair to obtain a repair result;

[0169] When it is determined according to the repair result that the repair has failed, the host device is restarted.

[0170] In detail, the second quality threshold may be 0.6.

[0171] In detail, the adjusting of the communication parameter group according to the preset balancing mode refers to selecting a communication parameter group with a communication quality evaluation coefficient between 0.6 and 1 in the communication parameter group sequence for dynamic replacement.

[0172] In detail, the communication parameter self-repair refers to performing communication repair using a communication parameter group having a communication quality evaluation coefficient greater than 0.6 selected from the communication parameter group sequence.

[0173] In the embodiment of the present invention, by dynamically optimizing communication parameters based on the invalid address set and the preset communication parameter group characteristic segment, an optimal communication parameter group is obtained, thereby improving the efficiency of communication debugging.

[0174] In the embodiment of the present invention, by performing communication between the master and slave devices based on the optimal communication parameter group, the communication efficiency between the master and slave devices can be improved.

[0175] This solution, based on the ModBus communication protocol, aims to test the communication of slave devices and improve communication quality by adjusting communication parameters. The host device first sends a test command to the slave address in a preset format. The host device then determines whether to convert the command based on the protocol characteristics. The response time is then calculated based on the baud rate and the response data is retrieved. The response is then determined to determine whether the slave address completes the response within the time limit. If not, the address is considered invalid. If a response is completed, the address is further determined to determine if there is an address conflict, in which case the address is reallocated. The command process is repeated after the slave addresses are sorted in ascending order until all addresses have been sent, generating a set of invalid addresses. Dynamic debugging is then performed based on the invalid address set and the preset communication parameter group signatures. Parameter groups are generated through permutations and sorted, tested sequentially, and evaluation parameters are calculated based on the response quality data to select the optimal communication parameter set. Furthermore, communication quality is monitored in real time, and parameter adjustments, self-repair, or host device restarts are performed based on different thresholds. This approach enables fully automatic scanning and conflict avoidance of slave addresses, improving communication stability.

[0176] like Figure 2 FIG. 1 is a functional module diagram of a communication debugging system based on dynamic optimization of multiple parameters provided by an embodiment of the present invention.

[0177] The communication debugging system 100 based on dynamic optimization of multiple parameters described in the present invention can be installed in an electronic device. Depending on the functionality implemented, the communication debugging system 100 based on dynamic optimization of multiple parameters can include a data transmission module 101, a response determination module 102, an address determination module 103, an address ascending module 104, and a parameter debugging module 105. A module, also referred to as a unit, is a series of computer program segments that can be executed by an electronic device processor and perform a fixed function. These are stored in the electronic device's memory.

[0178] In this embodiment, the functions of each module / unit are as follows:

[0179] The data sending module 101 is used to use the host device to send a test instruction to the corresponding slave device according to a preset instruction format and a preset slave address;

[0180] The response determination module 102 is configured to calculate a response time according to the baud rate of the host device, obtain response data of the slave device corresponding to the slave address to the test instruction within the response time, and determine whether the slave device has completed the response within the response time according to the response data;

[0181] The address determination module 103 is configured to determine, based on the response data, whether the slave device completes the response within the response time; if the slave device does not complete the response within the response time, determine that the slave address of the slave device is an invalid address; if the slave device completes the response within the response time, determine, based on the response data, whether there is an address conflict; if there is an address conflict, determine that the slave address of the slave device is a conflicting address, and perform address reallocation processing on the conflicting address; if there is no address conflict, determine that the slave address of the slave device is a valid address;

[0182] The address ascending module 104 is configured to, after ascending the slave addresses, return to the data sending module 101 and perform the step of using the host device to send a test instruction to the corresponding slave device according to a preset instruction format and a preset slave address;

[0183] The parameter debugging module 105 is used to obtain all invalid addresses after sending the test instruction to all slave station addresses, obtain an invalid address set, dynamically optimize the communication parameters based on the invalid address set and the preset communication parameter group feature segment, obtain the optimal communication parameter group, and communicate between the master and slave devices based on the optimal communication parameter group.

[0184] In detail, each module in the communication debugging system 100 based on dynamic optimization of multiple parameters in the embodiment of the present invention adopts the same Figures 1 to 3 The same technical means as the method for dynamically optimizing communication debugging based on multiple parameters described in , and can produce the same technical effects, will not be repeated here.

[0185] like Figure 3 FIG. 1 is a structural diagram of an electronic device according to an embodiment of the present invention, which is based on a multi-parameter dynamic optimization communication debugging method.

[0186] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13. It may also include a computer program stored in the memory 11 and executable on the processor 10, such as a communication debugging program dynamically optimized based on multivariate parameters.

[0187] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including a combination of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control core (Control Unit) of the electronic device, connecting the various components of the entire electronic device using various interfaces and lines, and executing the programs or modules stored in the memory 11 (such as a communication debugging program based on multivariate parameters, etc.), as well as calling the data stored in the memory 11, to perform various functions of the electronic device and process data.

[0188] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 can also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Furthermore, the memory 11 can also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of a communication debugging program based on multivariate parameters for dynamic optimization, but can also be used to temporarily store data that has been output or is to be output.

[0189] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory 11 and at least one processor 10, etc.

[0190] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in this embodiment, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0191] The figure only shows an electronic device with components. Those skilled in the art will understand that the structure shown in the figure does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0192] For example, although not shown, the electronic device may further include a power source (such as a battery) for powering various components. Preferably, the power source may be logically connected to the at least one processor 10 via a power management device, thereby implementing functions such as charge management, discharge management, and power consumption management through the power management device. The power source may further include any components such as one or more DC or AC power sources, a recharging device, a power failure detection circuit, a power converter or inverter, a power status indicator, etc. The electronic device may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0193] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0194] The communication debugging program based on dynamic optimization of multiple parameters stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve the following:

[0195] The host device sends a test instruction to the corresponding slave device according to the preset instruction format and the preset slave address;

[0196] Calculating the response time according to the baud rate of the host device, and obtaining the response data of the slave device corresponding to the slave address to the test instruction within the response time;

[0197] Determining whether the slave device completes the response within the response time according to the response data;

[0198] If the slave device fails to complete the response within the response time, determining that the slave address of the slave device is an invalid address;

[0199] If the slave device completes the response within the response time, determining whether there is an address conflict based on the response data;

[0200] If there is an address conflict, determining that the slave address of the slave device is a conflicting address, and performing address reallocation processing on the conflicting address;

[0201] If there is no address conflict, determining that the slave address of the slave device is a valid address;

[0202] After sorting the slave station addresses in ascending order, returning to the step of using the host device to send a test instruction to the corresponding slave station device according to a preset instruction format and a preset slave station address;

[0203] After sending the test instruction to all slave station addresses, all invalid addresses are acquired to obtain an invalid address set;

[0204] Dynamic optimization of communication parameters is performed based on the invalid address set and the preset communication parameter group characteristic segment to obtain an optimal communication parameter group.

[0205] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.

[0206] Furthermore, if the modules / units integrated into the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or system capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0207] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor of an electronic device, the computer program can implement:

[0208] The host device sends a test instruction to the corresponding slave device according to the preset instruction format and the preset slave address;

[0209] Calculating the response time according to the baud rate of the host device, and obtaining the response data of the slave device corresponding to the slave address to the test instruction within the response time;

[0210] Determining whether the slave device completes the response within the response time according to the response data;

[0211] If the slave device fails to complete the response within the response time, determining that the slave address of the slave device is an invalid address;

[0212] If the slave device completes the response within the response time, determining whether there is an address conflict based on the response data;

[0213] If there is an address conflict, determining that the slave address of the slave device is a conflicting address, and performing address reallocation processing on the conflicting address;

[0214] If there is no address conflict, determining that the slave address of the slave device is a valid address;

[0215] After sorting the slave station addresses in ascending order, returning to the step of using the host device to send a test instruction to the corresponding slave station device according to a preset instruction format and a preset slave station address;

[0216] After sending the test instruction to all slave station addresses, all invalid addresses are acquired to obtain an invalid address set;

[0217] Dynamic optimization of communication parameters is performed based on the invalid address set and the preset communication parameter group characteristic segment to obtain an optimal communication parameter group.

[0218] In the embodiments provided herein, it should be understood that the disclosed devices, systems, and methods may be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the module division is merely a logical functional division, and actual implementation may employ other division methods.

[0219] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected to achieve the purpose of the solution of this embodiment according to actual needs.

[0220] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional modules.

[0221] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0222] Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the claims are intended to be embraced therein. Any reference to a figure in a claim should not be construed as limiting the claim to which it relates.

[0223] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.

[0224] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or systems recited in a system claim may also be implemented by a single unit or system through software or hardware. Terms such as "first" and "second" are used to indicate names and do not imply any particular order.

[0225] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A communication debugging method based on dynamic optimization of multiple parameters, characterized in that: The method comprises: The host device sends a test instruction to the corresponding slave device according to the preset instruction format and the preset slave address; Calculating the response time according to the baud rate of the host device, and obtaining the response data of the slave device corresponding to the slave address to the test instruction within the response time; Determining whether the slave device completes the response within the response time according to the response data; If the slave device fails to complete the response within the response time, determining that the slave address of the slave device is an invalid address; If the slave device completes the response within the response time, determining whether there is an address conflict based on the response data; If there is an address conflict, determining that the slave address of the slave device is a conflicting address, and performing address reallocation processing on the conflicting address; If there is no address conflict, determining that the slave address of the slave device is a valid address; After sorting the slave station addresses in ascending order, returning to the step of using the host device to send a test instruction to the corresponding slave station device according to a preset instruction format and a preset slave station address; After sending the test instruction to all slave station addresses, all invalid addresses are acquired to obtain an invalid address set; Dynamic optimization of communication parameters is performed based on the invalid address set and a preset communication parameter group characteristic segment to obtain an optimal communication parameter group, and communication between the master and slave devices is performed based on the optimal communication parameter group.

2. The communication debugging method based on multivariate parameter dynamic optimization according to claim 1, characterized in that: The method of using the host device to send a test instruction to the corresponding slave device according to a preset instruction format and a preset slave address includes: Obtaining response data of the host device to a preset data read instruction; Performing protocol feature identification on the slave device according to the reply data to obtain a protocol identification result; Determine whether the slave device satisfies the MODBUS TCP or MODBUS RTU protocol characteristics at the same time according to the protocol identification result; If the slave device does not meet the MODBUS TCP or MODBUS RTU protocol characteristics, the test instruction is sent to a new slave device using the host device and the slave address of the next queue; If the slave device satisfies the MODBUS TCP or MODBUS RTU protocol features at the same time, the test instruction is subjected to protocol conversion based on a preset protocol priority to obtain a converted test instruction; Sending the converted test instruction to the new slave device using the host device and the slave address of the next queue; The protocol features of MODBUS TCP and MODBUS_RTU are utilized to complete protocol identification of communication data and conversion between the two protocols.

3. The communication debugging method based on dynamic optimization of multiple parameters according to claim 2, characterized in that: The performing address reallocation processing on the conflicting address includes: Obtain an ID list of all slave addresses in the conflicting address; Arrange all slave station addresses in the conflicting addresses in ascending order of ID according to the ID list to obtain an ascending address list; Obtain the address with the smallest ID in the ascending address list according to the ID list to obtain the smallest ID address; Confirm that the minimum ID address is a valid address; The remaining addresses in the ascending address list are sequentially allocated to free addresses.

4. The communication debugging method based on dynamic optimization of multiple parameters according to claim 1, characterized in that: The dynamically optimizing the communication parameters based on the invalid address set and the preset communication parameter group characteristic segment to obtain the optimal communication parameter group includes: Obtaining a preset communication parameter group characteristic segment, and performing permutations and combinations on the communication parameters in the communication parameter group characteristic segment to obtain a communication parameter group set; Arranging the communication parameter group set based on priority to obtain a communication parameter group sequence; Selecting the first communication parameter group in the communication parameter group sequence as the test parameter group; Sending a debugging instruction to an address in the invalid address set based on the test parameter group; Acquire response quality data of the addresses in the invalid address set to the debug instruction; Calculating a communication quality evaluation parameter based on the response quality data; Determining whether the communication quality assessment parameter is greater than or equal to a preset quality threshold; If the quality assessment parameter is less than the quality threshold, selecting the next communication parameter group in the communication parameter group sequence as a new test parameter group, and returning to the step of sending a debugging instruction to the address in the invalid address set based on the test parameter group; If the quality assessment parameter is greater than or equal to the quality threshold, confirming that the test parameter group is the optimal communication parameter group; When the debugging instruction is sent to the addresses in the invalid address set according to all communication parameter groups in the communication parameter group sequence, and no communication quality assessment parameter greater than or equal to the quality threshold is obtained, all communication quality assessment parameters are acquired to obtain a communication quality assessment parameter set; The communication parameter group corresponding to the communication quality evaluation parameter with the largest communication quality evaluation parameter set is selected as the optimal communication parameter group.

5. The communication debugging method based on dynamic optimization of multiple parameters according to claim 4, characterized in that: Calculating the communication quality evaluation parameter according to the response quality data includes: Obtaining the bit error rate, effective throughput, round-trip delay, and address conflict frequency included in the response quality data; Determining that the bit error rate, the effective throughput, the round-trip delay, and the address conflict frequency are all within a valid range; If the bit error rate, the effective throughput, the round-trip delay, and the address conflict frequency are not all within a valid range, outputting an error signal; If the bit error rate, the effective throughput, the round-trip delay, and the address conflict frequency are all within a valid range, performing an exponential operation on the bit error sensitivity index as an exponent of the bit error rate to obtain a bit error term; Multiplying the round-trip delay by a preset delay adjustment coefficient to obtain a multiplication factor, and calculating a ratio of the effective throughput to the multiplication factor to obtain a ratio term; Multiplying the address conflict frequency by a preset conflict penalty factor, taking the negation of the product to obtain a negation factor, and performing an exponential operation using the negation factor as the exponent of the base of a natural logarithm to obtain a conflict term; The communication quality evaluation parameter is obtained by subtracting the bit error term from a preset integer and multiplying the resultant value by the ratio term and the conflict term.

6. The communication debugging method based on dynamic optimization of multiple parameters according to claim 5, characterized in that: The calculation formula of the communication quality evaluation parameter is as follows: Among them, CQAM is the communication quality evaluation parameter, BER is the bit error rate contained in the response quality data, α is the preset error sensitivity index, T is the effective throughput contained in the response quality data, β is the preset delay adjustment coefficient, RTT is the round-trip delay contained in the response quality data, γ is the preset conflict penalty factor, and C is the address conflict frequency contained in the response quality data.

7. The communication debugging method based on dynamic optimization of multiple parameters according to claim 5, characterized in that: After obtaining a preset communication parameter group characteristic segment and permuting and combining the communication parameters in the communication parameter group characteristic segment to obtain a communication parameter group set, the method further includes: Obtaining a communication quality evaluation coefficient corresponding to each communication parameter group in the communication parameter group sequence to obtain a coefficient set; Calculating in real time a communication quality evaluation coefficient when performing communication based on the optimal communication parameter group to obtain a detection evaluation coefficient; Determining in real time whether the detection evaluation coefficient is less than the quality threshold; When the detection evaluation coefficient is less than the quality threshold, determining whether the detection evaluation coefficient is greater than or equal to a preset second quality threshold; If the detection evaluation coefficient is greater than or equal to the second quality threshold, adjusting the communication parameter group according to a preset balancing mode; If the detection evaluation coefficient is less than the second quality threshold, performing communication parameter self-repair to obtain a repair result; When it is determined according to the repair result that the repair has failed, the host device is restarted.

8. A communication debugging system based on dynamic optimization of multiple parameters, characterized in that: The system comprises: The data sending module is used to use the host device to send a test instruction to the corresponding slave device according to a preset instruction format and a preset slave address; a response judgment module, configured to calculate a response time according to the baud rate of the host device, obtain response data of the slave device corresponding to the slave address to the test instruction within the response time, and judge whether the slave device completes the response within the response time according to the response data; an address determination module, configured to determine, based on the response data, whether the slave device completes the response within the response time; if the slave device does not complete the response within the response time, determine that the slave address of the slave device is an invalid address; if the slave device completes the response within the response time, determine, based on the response data, whether there is an address conflict; if there is an address conflict, determine that the slave address of the slave device is a conflicting address, and perform address reallocation processing on the conflicting address; if there is no address conflict, determine that the slave address of the slave device is a valid address; an address ascending module, configured to, after ascending the slave station addresses, return the ascending address to the data sending module, and execute the step of using the host device to send a test instruction to the corresponding slave station device according to a preset instruction format and a preset slave station address; The parameter debugging module is used to obtain all invalid addresses after sending the test instruction to all slave station addresses, obtain an invalid address set, dynamically optimize the communication parameters based on the invalid address set and the preset communication parameter group characteristic segment, obtain the optimal communication parameter group, and communicate between the master and slave devices based on the optimal communication parameter group.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the communication debugging method based on dynamic optimization of multiple parameters as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the communication debugging method based on dynamic optimization of multiple parameters as claimed in any one of claims 1 to 7 is implemented.