Control method for communication between Loongson 1C102 and MCU

Through the Loongson 1C102 MCU chip and ZigBee wireless communication protocol, real-time monitoring and automated management of industrial control and environmental monitoring are realized, the problem of field deployment and maintenance is solved, the power consumption and data analysis complexity is reduced, and the system reliability is improved. Sex and management capabilities.

CN119211391APending Publication Date: 2024-12-27武汉探针科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411297558.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In field industrial control and environmental monitoring, existing wired connection methods are difficult to deploy and maintain. Inconsistent data frame transmission leads to data parsing errors, resulting in high power consumption of equipment and low automation.

Method used

The Loongson 1C102 MCU chip and ZigBee wireless communication protocol are adopted to realize half-duplex communication between the master and slave device through the preset protocol format. The master device sends configuration messages and updates the configuration files of the slave device. The slave device sends the status and sensor data at a fixed frequency. The main device parses and reports data to realize the data transmission and decoding.

Benefits of technology

It solves the problems of difficulty in wiring, high power consumption, and complex data analysis, and realizes real-time monitoring and automated management of industrial control and environmental monitoring. It has simple maintenance, long working time for a single full-charge device, and easier network deployment and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211391A_ABST
    Figure CN119211391A_ABST
Patent Text Reader

Abstract

The invention discloses a control method for communication between a Loongson 1C102 and an MCU, the Loongson 1C102 is used as a master device, the MCU is used as a slave device, the master device and the slave device communicate through a ZigBee network based on a preset protocol format, and the method comprises the following steps: the slave device updates a configuration file in the MCU according to the configuration file sent by the master device, the configuration file is solidified in Flash, and the Flash is used for storing the configuration file in the MCU; after the soft restart is executed, sending a self equipment state message and a sensor data message accessed to the MCU to the main equipment at a fixed frequency based on the configuration file; the main device replies a response signal after the device state message and the sensor data message of the main device; and analyzing the message, sending sensor data to an upper computer, and determining whether a warning signal needs to be sent or whether the slave equipment needs to be restarted or not. According to the invention, the Loongson 1C102 is used as a main device, and data unvarnished transmission and decoding are realized based on the ZigBee wireless communication technology, so that a field monitoring system is easier to deploy, simpler in network maintenance, low in power consumption and long in single-time full-power working time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a control method for communication between a Loongson 1C102 and an MCU. Background Art

[0002] In the field of industrial control and environmental monitoring, the sensor data of the production environment needs to be reported to the monitoring system several kilometers or even dozens of kilometers away. The current industrial control and environmental monitoring sensors usually use wired connections, and the load capacity is too dependent on the external pins of the MCU itself. Because the transportation in the field is often underdeveloped, it often faces the problems of complex solution deployment, great influence of terrain and difficult maintenance. Therefore, the wired connection method is not suitable for monitoring the field. In addition, due to the non-uniform transmission of data frames, the data receiving end may not be able to correctly identify and parse the data frames, resulting in data parsing errors, thus affecting the effect of industrial control or environmental monitoring.

[0003] ZigBee is a short-range wireless communication technology developed based on the IEEE802.15.4 protocol. It has low power consumption and is considered by the industry to be the most likely wireless method to be used in industrial control applications. Loongson 1C102 is a customized MCU chip for the embedded field. It is based on the LOONGARCH dragon architecture instruction set independently developed by Loongson Zhongke and uses the Loongson LA132 processor core independently developed by China. The chip integrates Flash, SPI, UART, I2C, RTC, TSENSOR, VPWM, ADC, GPIO and other functional modules. While meeting the low power consumption requirements, it greatly reduces the board-level cost and has the characteristics of high stability, high security and low cost.

[0004] Based on this, the present invention uses the industrial control chip Loongson 1C102 and the ZigBee wireless communication protocol to provide a control method for communication between Loongson 1C102 and MCU, which can realize real-time monitoring and automatic management of industrial control and environmental monitoring, and has simple maintenance, low power consumption, and long single full-charge operation time. Summary of the invention

[0005] The present invention provides a control method for communication between Loongson 1C102 and MCU, which is used to solve the technical problems of difficult wiring, high equipment power consumption, complex data analysis process and low automation level in existing industrial control and environmental monitoring.

[0006] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:

[0007] In a first aspect, the present invention provides a control method for communication between Loongson 1C102 and MCU, wherein Loongson 1C102 is used as a master device and MCU is used as a slave device, and the master device and the slave device communicate through a ZigBee network based on a preset protocol format, and the method comprises the following steps:

[0008] The master device sends a configuration message to the slave device;

[0009] The slave device receives the configuration message and replies with a response signal, updates the configuration file inside the MCU according to the configuration message of the master device, solidifies the updated configuration file in the Flash through the ISP system, and performs a soft restart to enable the updated configuration file;

[0010] After the slave device is soft-restarted, it sends its own device status message and sensor data message connected to the MCU to the master device at a fixed frequency based on the configuration file;

[0011] After receiving the device status message and sensor data message sent by the slave device, the master device replies with a response signal; parses the sensor data message to obtain sensor data, and sends the sensor data to the host computer; at the same time, parses the device status message, and decides whether to issue a warning signal or restart the slave device according to the parsing result.

[0012] Furthermore, the preset protocol format includes: the master and slave devices communicate based on a preset message format; the length of each frame message is fixed to 24 bytes, and the structure of the message includes at least:

[0013] 2-byte ZigBee configuration bit field, 1-byte master device control command field, 6-byte slave device sensor report field, 4-byte multiplexed data bit field, 1-byte ACK field and 1-byte check bit field.

[0014] Furthermore, the message is verified by CRC verification.

[0015] Furthermore, the slave device is a plurality of slave devices.

[0016] Furthermore, before the master device sends the configuration message to the slave device, the process further includes:

[0017] The master device and multiple slave devices set the same communication frequency between the master and the slave devices through the serial port, as well as the network identification of each slave device;

[0018] The master device creates a ZigBee network node according to the communication frequency point;

[0019] The slave device performs authentication and access to the communication link based on the preset network identifier and communication frequency, completing the ZigBee network access operation of the master and slave devices.

[0020] Furthermore, the configuration message includes at least the communication frequency, sensor information type and working mode of the master and slave devices.

[0021] Further the method also includes:

[0022] If the data sender does not receive a reply response signal from the other end, the sender will add 1 to the corresponding flag bit in the buffer area and continue to send the message according to the preset communication frequency;

[0023] If no reply is received, the value continues to increase by 1 until the preset threshold is reached. If no reply is received, the peer end is considered offline.

[0024] Furthermore, if the master device goes offline, the slave device enters a low-power mode to continue working and stores the sensor data in a buffer queue, waiting for the master device to come back online;

[0025] If the slave device goes offline, the master device will report a warning notification to the host computer and go back to the previous version of the configuration file to re-establish the link.

[0026] Further, the master device parses the sensor data message to obtain sensor data, and sends the sensor data to the host computer, including:

[0027] The sensor data obtained by parsing is cached in a preset circular list, and the interrupt is waited for according to the FIFO rule. The sensor data is packaged and sent to the host computer via Ethernet.

[0028] On the other hand, the present invention also provides a monitoring system based on Loongson 1C102, comprising: a remote monitoring unit, a master device based on the Loongson 1C102 chip connected to the remote monitoring unit for communication, and a plurality of slave devices connected to the master device for communication via a ZigBee network, each of the slave devices being connected to a plurality of sensors;

[0029] The master device is used to send a configuration message to the slave device, and after receiving its own device status message and sensor data message sent by the slave device, reply a response signal; parse the sensor data message to obtain sensor data, and send the sensor data to the remote monitoring unit; at the same time, parse its own device status message, and decide whether to issue a warning signal or restart the slave device according to the parsing result;

[0030] The slave device is used to obtain sensor data collected by multiple sensors, receive a configuration message sent by the master device and reply with a response signal, update the configuration file inside the MCU according to the configuration message of the master device, fix the updated configuration file in the Flash through the ISP system, and perform a soft restart to enable the updated configuration file; after the soft restart, the slave device sends its own device status message and the sensor data message connected to the MCU to the master device at a fixed frequency based on the configuration file;

[0031] The remote monitoring unit is used to receive the sensor data forwarded by the main device and provide the sensor data to the remote operator for monitoring and analysis.

[0032] The present invention provides a control method for communication between Loongson 1C102 and MCU. Compared with the prior art, the present invention uses Loongson 1C102 as a main device, and realizes data transparent transmission and decoding based on ZigBee wireless communication technology; defines a preset protocol format, realizes half-duplex communication between Loongson 1C102 side and MCU side, and the MCU side reports the collected real-time sensor data to the main device at a certain frequency by receiving the query request message sent by 1C102 side, updates the local configuration file and solidifies it in Flash, and the main device feeds back the relevant data requested for collection, analysis and update by monitoring the query information responded by the MCU side, and continues to report the data to the superior monitoring system through Ethernet. The method of this embodiment solves the problems of short wired transmission distance, high power consumption and small load, and provides solutions for the problems of difficult sensor wiring and difficult maintenance in complex and rugged terrain monitoring, which can make the entire monitoring system easier to deploy, network maintenance simpler, fewer personnel requirements, and longer single full-power working time of the equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A flow chart of a control method for communication between Loongson 1C102 and MCU provided by the present invention;

[0034] Figure 2 A schematic structural diagram of an embodiment of a monitoring system based on Loongson 1C102 provided by the present invention. DETAILED DESCRIPTION

[0035] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0036] Before introducing the embodiments of the present invention, relevant terms of the present invention are first explained.

[0037] MCU: (Micro Controller Unit) is the core of the embedded control system, performing functions such as measurement, control calculation and process processing. It is a computer-level chip product that is packaged on a single core and is made by cutting the CPU's main frequency and specifications to a certain extent, and then integrating peripheral interfaces such as memory, timer, USB, A / D conversion, UART, PLC, DMA, etc. At present, mainstream MCUs include C51 series controllers, X86 series controllers, ARM series controllers and other types. The MCU mentioned in this invention includes all products at the MCU level.

[0038] Loongson 1C102: Loongson 1C102 is a customized MCU chip for the embedded field. It is based on the LOONGARCH dragon architecture instruction set independently developed by Loongson Zhongke and adopts the Loongson LA132 processor core independently developed by China. It is mainly aimed at smart homes and other IoT devices. The chip integrates Flash, SPI, UART, I2C, RTC, TSENSOR, VPWM, ADC, GPIO and other functional modules. While meeting the low power consumption requirements, it greatly reduces the board-level cost and has the characteristics of high stability, high security and low cost. The product is mainly used in smart door lock products, electric bicycles, treadmills, etc.

[0039] ZigBee technology: ZigBee technology is a short-range, low-complexity, low-power, low-data-rate, low-cost two-way wireless communication technology, mainly suitable for the fields of automatic control and remote control. ZigBee is a short-range wireless communication technology developed based on the IEEE802.15.4 protocol. It has low power consumption and is considered by the industry to be the most likely wireless method to be used in industrial control situations. It is a wireless data transmission network platform composed of up to 65,000 wireless data transmission modules. Within the entire network, each ZigBee network data transmission module can communicate with each other.

[0040] Combination Figure 1 As shown, a specific embodiment of the present invention discloses a control method for communication between Loongson 1C102 and MCU, with Loongson 1C102 as the master device and MCU as the slave device, the master device and the slave device communicate through a ZigBee network based on a preset protocol format, and the method includes the following steps:

[0041] Step S101, the master device sends a configuration message to the slave device;

[0042] Step S102: The slave device receives the configuration message and replies with a response signal, updates the configuration file inside the MCU according to the configuration message of the master device, solidifies the updated configuration file in the Flash through the ISP system, and performs a soft restart to enable the updated configuration file;

[0043] Step S103: After the slave device is soft-restarted, the slave device sends its own device status message and sensor data message connected to the MCU to the master device at a fixed frequency based on the configuration file;

[0044] Step S104, after receiving the device status message and sensor data message sent by the slave device, the master device replies with a response signal; parses the sensor data message to obtain sensor data, and sends the sensor data to the host computer; at the same time, parses the device status message, and decides whether to issue a warning signal or restart the slave device according to the parsing result.

[0045] The method of this embodiment uses Loongson 1C102 as the main device, and realizes high-speed real-time communication of 100 meters on the wireless link based on the ZigBee wireless communication protocol and software and hardware interrupts, and realizes data transparent transmission and decoding; by defining a preset protocol format, half-duplex communication between Loongson 1C102 and MCU is realized, and the MCU reports the collected real-time sensor data to the main device at a certain frequency by receiving the query request message sent by the 1C102 side, updates the local configuration file and solidifies it in Flash, and the main device feeds back the relevant data requested for collection, analysis and update by monitoring the query information responded by the MCU side, and continues to report the data to the superior monitoring system through Ethernet. The method of this embodiment solves the problems of short wired transmission distance, high power consumption and small load, and provides solutions for the problems of difficult sensor wiring and difficult maintenance in complex and rugged terrain monitoring, which can make the entire monitoring system easier to deploy, network maintenance simpler, fewer personnel requirements, and longer single full-power working time of the equipment.

[0046] As a specific embodiment, since the MCU usually has only one CPU core and cannot be used as a multi-process task processing system, it is often chosen to use interrupts to handle multi-task concurrency under different concurrencies. The present invention uses interrupts to handle the storage and routing functions after real-time data collection to ensure data reliability and real-time performance, and at the same time will not interrupt the functional logic being processed.

[0047] As a specific embodiment, the device status message sent by the MCU includes its own battery data and its own device status data (operating status, usage statistics, firmware version, environmental data, etc.). The master device determines whether it is necessary to give a warning signal and whether it is necessary to control the slave device to restart and perform other operations based on the battery information and status information of the MCU.

[0048] Specifically, the master device determines whether the remaining capacity of the battery is lower than the set threshold by monitoring the battery voltage or power information provided by the MCU. If the battery power is too low, the master device can send a warning signal to remind the user to replace or recharge the battery in time; based on the status information provided by the MCU, it can determine whether the slave device is in an abnormal state, such as sensor failure, communication interruption, etc. If the status of the slave device is abnormal, the master device can send a control command to require the slave device to restart in an attempt to solve the problem or restore normal working status.

[0049] As a preferred embodiment, the preset protocol format includes: the master and slave devices communicate based on a preset message format; the length of each frame message is fixed to 24 bytes, which is a fixed-length message, and the structure of the message includes at least:

[0050] 2-byte ZigBee configuration bit field, 1-byte master device control command field, 6-byte slave device sensor report field, 4-byte multiplexed data bit field, 1-byte ACK field and 1-byte check bit field.

[0051] The protocol standard for communication between Loongson 1C102 as a master device and MCU slave device is defined for the first time by the present invention. Through information multiplexing and soft decoding, the message length is effectively shortened from 128Bytes of a general message to 24Bytes, ensuring the real-time and reliability of data transmission.

[0052] As a preferred embodiment, the message verification method is CRC verification.

[0053] The message structure is described in detail below in conjunction with Tables 1 to 3.

[0054] The message structure includes six fields in total: ZigBee module fixed bit, frame header, send frame, receive frame, check frame and frame tail.

[0055] As shown in Table 1 below, the ZigBee module fixed bits include two bytes for describing the sensor memory and the sensor address.

[0056] Table 1 Structure of fixed bits of ZigBee module

[0057]

[0058] The data frame header has a total of 4 bytes so that the receiving end can correctly interpret and process the data frame.

[0059] The sending frame has a total of 2 bytes, as shown in Table 2, which mainly describes the command type and command parameters.

[0060] Table 2 Structure of the transmitted frame

[0061]

[0062] The receiving frame is shown in Table 3, where the data is retained to meet the custom requirements of certain protocols or hardware. During the communication process, any party that receives the data should feedback an ACK status field after receiving the data to indicate that the entire communication link is normal, thereby ensuring the communication status.

[0063] Table 3 Structure of received frame

[0064]

[0065]

[0066] The CRC check bit has 1 byte, but the ACK signal does not need to be checked.

[0067] The data frame ends with 4 bytes, usually 4 0xFF bytes are used to indicate the end of the data.

[0068] As a preferred embodiment, the slave device is a plurality of slave devices.

[0069] By using a 1C102 master device to carry more slave devices, the solution deployment cost can be lowered and information exchange can be faster.

[0070] As a preferred embodiment, before the master device sends a configuration message to the slave device, the method further includes:

[0071] The master device and multiple slave devices set the same communication frequency between the master and the slave devices through the serial port, as well as the network identification of each slave device;

[0072] The master device creates a ZigBee network node according to the communication frequency point;

[0073] The slave device performs authentication and access to the communication link based on the preset network identifier and communication frequency, completing the ZigBee network access operation of the master and slave devices.

[0074] By setting a consistent communication frequency between the master device and multiple slave devices, it is ensured that they can communicate wirelessly at the same frequency. This can avoid frequency conflicts and interference, and improve the stability and reliability of communication. Each slave device has its own network identifier, which is used to distinguish and identify different slave devices. The master device can verify the identity of the slave device according to the preset network identifier and ensure that only authenticated devices can access the ZigBee network, which enhances the security of the system and prevents unauthorized devices from accessing the network. The master device creates a ZigBee network node based on the communication frequency, so that multiple slave devices can join the network in the form of nodes. This makes it easy to manage and control multiple slave devices, improve the load capacity, realize centralized data collection and processing, and improve the overall efficiency and management capabilities of the system.

[0075] As a specific embodiment, the slave device solidifies the updated configuration program code in the Flash through the ISP system, and the soft restart enables the configuration. This is because the code segment in the Flash will not be lost when the power is off, thus solving the problem of requiring on-site maintenance by technicians, and the slave device can be updated directly through the remote host control.

[0076] As a preferred embodiment, the configuration message at least includes the communication frequency, sensor information type and working mode of the master and slave devices.

[0077] As a preferred embodiment, the method further includes:

[0078] If the data sender does not receive a reply response signal from the other end, the sender will add 1 to the corresponding flag bit in the buffer area and continue to send the message according to the preset communication frequency;

[0079] If no reply is received, the value continues to increase by 1 until the preset threshold is reached. If no reply is received, the peer end is considered offline.

[0080] It should be noted that the preset threshold is generally 10, that is, if the message is resent 10 times and still no response signal is received, it is considered that the other end has been offline. This retransmission mechanism can ensure that data is sent as many times as possible, reducing the data loss rate caused by occasional communication errors. At the same time, setting the retransmission threshold helps the system to identify communication failures in a timely manner and take corresponding measures, rather than retransmitting indefinitely, thereby saving resources.

[0081] As a preferred embodiment, if the master device goes offline, the slave device enters a low power consumption mode to continue working, and stores the sensor data in a buffer queue, waiting for the master device to come back online;

[0082] If the slave device goes offline, the master device will report a warning notification to the host computer and go back to the previous version of the configuration file to re-establish the link.

[0083] The above method can effectively handle data transmission and device status changes under abnormal circumstances, improve the system's reliability, robustness, energy saving and management capabilities, and ensure that the system can run smoothly under various circumstances.

[0084] As a preferred embodiment, the master device parses the sensor data message to obtain sensor data, and sends the sensor data to the host computer, including:

[0085] The sensor data obtained by parsing is cached in a preset circular list, and the interrupt is waited for according to the FIFO rule. The sensor data is packaged and sent to the host computer via Ethernet.

[0086] FIFO is a queue data structure that follows the first-in-first-out principle, that is, the earliest data packet to enter the queue is processed and sent first. In this case, the information packets are arranged in the queue in the order in which they are generated or received. The system uses interrupts to handle the transmission of data packets. When an event triggers an interrupt (for example, the network interface is ready to send data), the system suspends the current task and executes the handler associated with the interrupt. The interrupt service routine is responsible for taking the next data packet to be sent from the FIFO queue, which is then sent out through the Ethernet interface, ensuring that the data is transmitted in order and that the transmission is not delayed due to the execution of other system tasks.

[0087] The embodiment of the present invention also provides a monitoring system based on Loongson 1C102, such as Figure 2 As shown, the system includes: a remote monitoring unit, a master device based on the Loongson 1C102 chip connected to the remote monitoring unit for communication, and a plurality of slave devices connected to the master device for communication via a ZigBee network, each of which is connected to a plurality of sensors;

[0088] The master device is used to send a configuration message to the slave device, and after receiving its own device status message and sensor data message sent by the slave device, reply a response signal; parse the sensor data message to obtain sensor data, and send the sensor data to the remote monitoring unit; at the same time, parse its own device status message, and decide whether to issue a warning signal or restart the slave device according to the parsing result;

[0089] The slave device is used to obtain sensor data collected by multiple sensors, receive a configuration message sent by the master device and reply with a response signal, update the configuration file inside the MCU according to the configuration message of the master device, fix the updated configuration file in the Flash through the ISP system, and perform a soft restart to enable the updated configuration file; after the soft restart, the slave device sends its own device status message and the sensor data message connected to the MCU to the master device at a fixed frequency based on the configuration file;

[0090] The remote monitoring unit is used to receive the sensor data forwarded by the main device and provide the sensor data to the remote operator for monitoring and analysis.

[0091] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A control method for communication between Loongson 1C102 and MCU, characterized in that: With Loongson 1C102 as the master device and MCU as the slave device, the master device and the slave device communicate through a ZigBee network based on a preset protocol format. The method includes the following steps: The master device sends a configuration message to the slave device; The slave device receives the configuration message and replies with a response signal, updates the configuration file inside the MCU according to the configuration message of the master device, solidifies the updated configuration file in the Flash through the ISP system, and performs a soft restart to enable the updated configuration file; After the slave device is soft-restarted, it sends its own device status message and sensor data message connected to the MCU to the master device at a fixed frequency based on the configuration file; After receiving the device status message and sensor data message sent by the slave device, the master device replies with a response signal; parses the sensor data message to obtain sensor data, and sends the sensor data to the host computer; at the same time, parses the device status message, and decides whether to issue a warning signal or restart the slave device according to the parsing result.

2. The control method for communication between Loongson 1C102 and MCU according to claim 1, characterized in that: The preset protocol format includes: the master and slave devices communicate based on a preset message format; the length of each frame message is fixed to 24 bytes, and the structure of the message includes at least: 2-byte ZigBee configuration bit field, 1-byte master device control command field, 6-byte slave device sensor report field, 4-byte multiplexed data bit field, 1-byte ACK field and 1-byte check bit field.

3. The control method for communication between Loongson 1C102 and MCU according to claim 2, characterized in that: The message verification method is CRC verification.

4. The control method for communication between Loongson 1C102 and MCU according to claim 1, characterized in that: The slave device includes multiple slave devices.

5. The control method for communication between Loongson 1C102 and MCU according to claim 4, characterized in that: Before the master device sends a configuration message to the slave device, it also includes: The master device and multiple slave devices set the same communication frequency between the master and the slave devices through the serial port, as well as the network identification of each slave device; The master device creates a ZigBee network node according to the communication frequency point; The slave device performs authentication and access to the communication link based on the preset network identifier and communication frequency, completing the ZigBee network access operation of the master and slave devices.

6. The control method for communication between Loongson 1C102 and MCU according to claim 1, characterized in that: The configuration message includes at least the communication frequency, sensing information type and working mode of the master and slave devices.

7. The control method for communication between Loongson 1C102 and MCU according to claim 1, characterized in that: The method further comprises: If the data sender does not receive a reply response signal from the other end, the sender will add 1 to the corresponding flag bit in the buffer area and continue to send the message according to the preset communication frequency; If no reply is received, the value continues to increase by 1 until the preset threshold is reached. If no reply is received, the peer end is considered offline.

8. The control method for communication between Loongson 1C102 and MCU according to claim 7, characterized in that: If the master device goes offline, the slave device enters low-power mode to continue working and stores the sensor data in the buffer queue, waiting for the master device to come back online; If the slave device goes offline, the master device will report a warning notification to the host computer and go back to the previous version of the configuration file to re-establish the link.

9. The control method for communication between Loongson 1C102 and MCU according to claim 1, characterized in that: The master device parses the sensor data message to obtain sensor data, and sends the sensor data to the host computer, including: The sensor data obtained by parsing is cached in a preset circular list, and the interrupt is waited for according to the FIFO rule. The sensor data is packaged and sent to the host computer via Ethernet.

10. A monitoring system based on Loongson 1C102, characterized in that: include: A remote monitoring unit, a master device based on the Loongson 1C102 chip communicatively connected to the remote monitoring unit, and a plurality of slave devices communicatively connected to the master device via a ZigBee network, each of the slave devices being connected to a plurality of sensors; The master device is used to send a configuration message to the slave device, and reply with a response signal after receiving its own device status message and sensor data message sent by the slave device; Parsing the sensor data message to obtain sensor data, and sending the sensor data to a remote monitoring unit; at the same time, parsing the own device status message, and determining whether to issue a warning signal or restart the slave device according to the parsing result; The slave device is used to obtain sensor data collected by multiple sensors, receive a configuration message sent by the master device and reply with a response signal, update the configuration file inside the MCU according to the configuration message of the master device, fix the updated configuration file in the Flash through the ISP system, and perform a soft restart to enable the updated configuration file; After the soft restart, the device sends its own device status message and the sensor data message connected to the MCU to the main device at a fixed frequency based on the configuration file; The remote monitoring unit is used to receive the sensor data forwarded by the main device and provide the sensor data to the remote operator for monitoring and analysis.