The invention discloses an intelligent self-adaptive
Modbus host communication method and device based on a Rensa
chip. The method comprises the following steps: receiving an upper-layer application communication request containing a priority and a
callback function pointer; asynchronously sending the request to a background
processing task through a mailbox mechanism of the real-time
operating system; before a background
processing task executes communication, according to a health degree
data model formed by historical communication data of a target slave, communication parameters such as
timeout are dynamically adjusted through an
adaptive algorithm; performing multi-dimensional classification diagnosis on the result, and updating the health degree
data model by using the diagnosis result; and notifying the application or triggering an automatic
recovery strategy through a
callback function according to a communication result. According to the method disclosed by the invention, an intelligent communication management mechanism which is deeply compatible with an official
library and has self-learning and self-adaptive capabilities is constructed, so that the problem of lack of a
host interface is solved, the development difficulty is reduced, and the stability, reliability and operation efficiency of
Modbus communication in a complex industrial environment are improved.