Baud rate self-adaptive switching system of low-power-consumption slave equipment
By implementing an independent baud rate switching system and temperature drift compensation calibration, the problem of requiring master synchronization for baud rate switching in traditional slave devices has been solved. This achieves flexible, low-power, and fast-response communication adaptation, improving the communication stability and efficiency of the device in different environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-03-27
AI Technical Summary
Traditional slave devices require master synchronization for baud rate switching, which is inflexible, consumes a lot of system resources, and is prone to identification errors under temperature deviations, affecting communication stability.
A baud rate adaptive switching system for low-power slave devices is provided, including an initialization module, a communication monitoring module, a baud rate switching module, a low-power management module, and a wake-up module. It enables autonomous baud rate switching and automatic sleep/wake-up, optimizes the baud rate through temperature drift compensation calibration, and supports fast switching and low-power modes.
It significantly improves the flexibility of slave devices with different hosts, reduces energy consumption, extends battery life, reduces communication latency, improves baud rate switching efficiency, and ensures communication stability and environmental adaptability.
Smart Images

Figure CN121750155A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of embedded communication technology, and in particular to a baud rate adaptive switching system for a low-power slave device. Background Technology
[0002] In the field of electronic communications, baud rate, or modulation rate, refers to the rate at which an effective data signal modulates a carrier wave, that is, the number of times the carrier modulation state changes per unit time.
[0003] Baud rate represents the number of symbol transmissions per unit time. It is a measure of symbol transmission rate and is expressed by the number of times the carrier modulation state changes per unit time. Baud rate refers to the number of symbols transmitted per unit time.
[0004] In related technologies, traditional slave device baud rate switching schemes require the host to send a synchronization message to achieve baud rate matching. The slave device cannot switch autonomously and must maintain baud rate consistency with the host to communicate normally, resulting in extremely poor flexibility. Furthermore, schemes that require complex algorithms to achieve baud rate detection consume a lot of system resources, increase system complexity, and are prone to identification errors in temperature-dependent environments, affecting communication stability and thus reducing the baud rate switching efficiency of slave devices. There are areas for improvement. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this application provides a baud rate adaptive switching system for low-power slave devices.
[0006] In a first aspect, this application provides a baud rate adaptive switching system for a low-power slave device, including an initialization module, a communication monitoring module, a baud rate switching module, a low-power management module, and a wake-up module; The initialization module is used to sort multiple preset baud rates in sequence when the slave device is powered on and initialized, and store the sorted baud rate sequence in the storage unit of the slave device. At the same time, it initializes the communication parameters so that the slave device enters the initial communication state. The communication monitoring module is used to monitor in real time whether there is a valid communication signal on the communication interface of the slave device after the slave device enters the initial communication state. When a valid communication signal is detected, the transmission status of the communication signal is continuously tracked, and the baud rate information of successful communication is recorded and stored in the storage unit. At the same time, the communication timeout timer is reset. When no valid communication signal is detected, the communication timeout timer is started to count the duration of no communication state. The baud rate switching module is connected to the communication monitoring module. When the communication timeout timer reaches a first preset threshold, the baud rate sequence is retrieved from the storage unit, and the current baud rate of the slave device is switched sequentially according to the sequence. After each switch, a test signal is sent through the communication interface. If a response signal from the master is detected after the test signal is sent, it is determined that the current baud rate is successfully adapted, the baud rate switching is stopped, and the current baud rate is maintained for communication. If no response signal is detected after traversing all preset baud rates, the system returns to the beginning of the baud rate sequence and restarts the polling switch until a valid response signal is detected. The low-power management module is connected to the communication monitoring module. When the communication timeout timer reaches the second preset threshold, the slave device is triggered to enter a deep sleep mode. The second preset threshold is greater than the first preset threshold. The wake-up module is used to detect signal edge changes of the communication interface in real time when the slave device is in deep sleep mode. When a preset signal edge characteristic is detected, the slave device is triggered to wake up from deep sleep mode. During the wake-up process, the baud rate of the most recent successful communication is retrieved from the storage unit and the baud rate of the slave device is restored to the baud rate, so that the slave device can quickly enter the communication state.
[0007] Preferably, the initialization module includes a baud rate calibration unit; The baud rate calibration unit is used to perform temperature drift compensation calibration on multiple preset baud rates during the power-on initialization process of the slave device. The temperature drift compensation calibration process is as follows: The current ambient temperature is obtained by the temperature sensor inside the slave device. Based on the preset temperature-baud rate compensation curve, multiple preset baud rates are numerically corrected. The temperature-baud rate compensation curve is obtained by fitting the slave device after communication tests under different temperature environments.
[0008] Preferably, the communication monitoring module includes a signal parsing unit and a timeout determination unit; The signal parsing unit is used to parse the communication signals received by the communication interface, and then extract the corresponding data frame format and check bit information from the communication signals; When the parsed data frame format conforms to the preset communication protocol and the check bit information is verified, it is determined to be a valid communication signal, and the baud rate information used in the current communication is recorded; if the data frame format does not conform to the preset protocol or the check bit information verification fails, it is determined to be an invalid communication signal, and the communication timeout timer is not reset. The timeout determination unit is set with a first preset threshold and a second preset threshold, wherein the first preset threshold is set to 1 second and the second preset threshold is set to 20 seconds; when the communication monitoring module does not detect a valid communication signal, the timeout determination unit starts a communication timeout timer. When the timer reaches 1 second, it sends a switching trigger signal to the baud rate switching module; when the timer reaches 20 seconds, it sends a sleep trigger signal to the low power management module. The timeout determination unit immediately resets the communication timeout timer to zero and restarts the timing process each time a valid communication signal is detected.
[0009] Preferably, the baud rate switching module includes a sequence retrieval unit, a switching execution unit, and a response detection unit; The sequence retrieval unit is used to retrieve the baud rate sequence corresponding to the initialization module from the storage unit after receiving the switching trigger signal sent by the communication monitoring module; The switching execution unit is used to adjust the baud rate configuration parameters of the slave device sequentially according to the baud rate sequence. The response detection unit is used to send a test signal to the host through the communication interface after the switching execution unit completes the baud rate switching. The test signal contains the identification information of the slave device and the current baud rate information. If a response signal is received from the host within 1 second, and the baud rate information in the response signal is consistent with the current baud rate information, the response is determined to be successful, and a communication success signal is sent to the communication monitoring module, which then resets the timeout timer. If no response signal is received or the baud rate information in the response signal does not match, the response is determined to be unsuccessful, and the switching execution unit is triggered to switch to the next baud rate in the baud rate sequence.
[0010] Preferably, the low-power management module includes a sleep preparation unit and a power consumption control unit; The hibernation preparation unit is used to save the working status information of the slave device after receiving the hibernation trigger signal sent by the communication monitoring module, and to store the saved working status information in a preset non-volatile storage unit. The power consumption control unit is used to gradually shut down unnecessary function modules of the slave device based on the current status information of the sleep preparation unit, while keeping the signal detection circuit in working state.
[0011] Preferably, the wake-up module includes an edge detection unit and a state recovery unit; The edge detection unit is used to monitor the signal edge changes of the communication interface through the signal detection circuit when the slave device is in deep sleep mode. When the signal edge changes meet the preset signal edge characteristics, it is determined to be a valid wake-up signal and a wake-up trigger signal is sent to the state recovery unit. After receiving the wake-up trigger signal, the state recovery unit gradually restores the slave device according to the preset wake-up procedure, retrieves the working state information saved before hibernation from the non-volatile storage unit, restores the baud rate of the slave device to the baud rate of the most recent successful communication, and enables the slave device to quickly enter the communication state.
[0012] Preferably, it also includes a storage update module; The storage update module is connected to the communication monitoring module and is used to periodically update the communication success baud rate information recorded in the storage unit. When the slave device successfully communicates multiple times in a row with a certain baud rate, the sorting priority of the baud rate in the baud rate sequence is increased. When a certain baud rate fails to achieve effective communication in multiple polling switches, the sorting priority of the baud rate in the baud rate sequence is decreased or it is temporarily removed from the baud rate sequence.
[0013] Preferably, it also includes an exception handling module, which is used to monitor the abnormal state of the slave device during the baud rate switching process. When the baud rate switching module fails to achieve effective communication after traversing all baud rates within a preset number of times, it is determined to be a communication abnormality. The exception handling module will control the slave device to perform a hardware reset. After the reset, the initialization module will be restarted to reinitialize the baud rate sequence.
[0014] Secondly, this application provides a baud rate adaptive switching method for a low-power slave device, comprising the following steps: When the slave device is powered on and initialized, multiple preset baud rates are sorted in sequence and the sorted baud rate sequence is stored in the storage unit of the slave device. At the same time, the communication parameters are initialized, so that the slave device enters the initial communication state. After the slave device enters the initial communication state, the system monitors in real time whether there is a valid communication signal on the slave device's communication interface. When a valid communication signal is detected, the system continuously tracks the transmission status of the communication signal, records the baud rate information of successful communication and stores it in the storage unit, and resets the communication timeout timer. When no valid communication signal is detected, the system starts the communication timeout timer to count the duration of the no-communication state. When the communication timeout timer reaches the first preset threshold, the baud rate sequence is retrieved from the storage unit, and the current baud rate of the slave device is switched sequentially according to the sequence. After each switch, a test signal is sent through the communication interface. If a response signal from the master is detected after the test signal is sent, it is determined that the current baud rate is successfully adapted, the baud rate switching is stopped, and the current baud rate is maintained for communication. If no response signal is detected after traversing all preset baud rates, the polling and switching is restarted from the beginning of the baud rate sequence until a valid response signal is detected. When the communication timeout timer reaches the second preset threshold, the slave device is triggered to enter deep sleep mode, wherein the second preset threshold is greater than the first preset threshold; When the slave device is in deep sleep mode, the signal edge changes of the communication interface are detected in real time. When the signal edge characteristics that meet the preset criteria are detected, the slave device is triggered to wake up from deep sleep mode. During the wake-up process, the baud rate of the most recent successful communication is retrieved from the storage unit and the baud rate of the slave device is restored to the baud rate, so that the slave device can quickly enter the communication state.
[0015] Thirdly, this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform a baud rate adaptive switching system for a low-power slave device as described in any of the above-mentioned claims.
[0016] In summary, this application includes the following beneficial technical effects: This application provides a low-power slave device baud rate adaptive switching system. Through a dual-mode mechanism of timeout-triggered polling and automatic sleep / wake-up, it achieves fully autonomous baud rate switching without requiring the host to send synchronization messages. The slave device can automatically adapt according to the communication status, significantly improving the flexibility of the device in cooperation with different hosts. Furthermore, it automatically enters deep sleep mode after 20 seconds in the absence of communication, and with the signal edge wake-up function, it greatly reduces energy consumption and effectively extends the usage time of battery-powered devices. It also supports rapid hot-switching of baud rates within 1 second, without waiting for message synchronization, reducing communication latency. After low-power wake-up, the baud rate before entering sleep mode can be maintained without re-adaptation, simplifying manual operations in production and use, thereby effectively improving the baud rate switching efficiency of the slave device. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of a system for adaptive baud rate switching of a low-power slave device according to an embodiment of this application.
[0019] Figure 2 This is a flowchart of a method for adaptive baud rate switching of a low-power slave device according to an embodiment of this application. Detailed Implementation
[0020] The following is in conjunction with the appendix Figure 1-2 This application will be described in further detail.
[0021] Example 1 This application discloses a baud rate adaptive switching system for a low-power slave device.
[0022] Reference Figure 1 A low-power slave device baud rate adaptive switching system includes an initialization module, a communication monitoring module, a baud rate switching module, a low-power management module, and a wake-up module; The initialization module is used to sort multiple preset baud rates in sequence when the slave device is powered on and initialized, and store the sorted baud rate sequence in the storage unit of the slave device. At the same time, it initializes the communication parameters so that the slave device enters the initial communication state. The communication monitoring module is used to monitor in real time whether there is a valid communication signal on the communication interface of the slave device after the slave device enters the initial communication state. When a valid communication signal is detected, the transmission status of the communication signal is continuously tracked, and the baud rate information of successful communication is recorded and stored in the storage unit. At the same time, the communication timeout timer is reset. When no valid communication signal is detected, the communication timeout timer is started to count the duration of no communication state. The baud rate switching module is connected to the communication monitoring module. When the communication timeout timer reaches a first preset threshold, the baud rate sequence is retrieved from the storage unit, and the current baud rate of the slave device is switched sequentially according to the sequence. After each switch, a test signal is sent through the communication interface. If a response signal from the master is detected after the test signal is sent, it is determined that the current baud rate is successfully adapted, the baud rate switching is stopped, and the current baud rate is maintained for communication. If no response signal is detected after traversing all preset baud rates, the system returns to the beginning of the baud rate sequence and restarts the polling switch until a valid response signal is detected. The low-power management module is connected to the communication monitoring module. When the communication timeout timer reaches the second preset threshold, the slave device is triggered to enter a deep sleep mode. The second preset threshold is greater than the first preset threshold. The wake-up module is used to detect signal edge changes of the communication interface in real time when the slave device is in deep sleep mode. When a preset signal edge characteristic is detected, the slave device is triggered to wake up from deep sleep mode. During the wake-up process, the baud rate of the most recent successful communication is retrieved from the storage unit and the baud rate of the slave device is restored to the baud rate, so that the slave device can quickly enter the communication state.
[0023] The above technical solution effectively improves the efficiency of fully automatic baud rate adaptation, eliminating the need for manual preset and solving the compatibility problem when the slave device communicates with the master device with different baud rates. Through the hierarchical timeout mechanism, the baud rate is actively switched when there is no communication for a short period of time to avoid communication interruption, and a low-power mode is entered when there is no communication for a long period of time to significantly reduce standby power consumption. When waking up, the most recently successful baud rate is directly restored to reduce the re-adaptation time, while taking into account communication flexibility, low power consumption and fast response.
[0024] It should be noted that the initialization module includes a baud rate calibration unit; The baud rate calibration unit is used to perform temperature drift compensation calibration on multiple preset baud rates during the power-on initialization process of the slave device. The temperature drift compensation calibration process is as follows: The current ambient temperature is obtained by the temperature sensor inside the slave device. Based on the preset temperature-baud rate compensation curve, multiple preset baud rates are numerically corrected. The temperature-baud rate compensation curve is obtained by fitting the slave device after communication tests under different temperature environments.
[0025] Specifically, the baud rate calibration unit in the initialization module starts during the slave device's power-on initialization phase. First, it acquires the current ambient temperature using the temperature sensor integrated within the slave device, for example, measuring a temperature of -10℃, 25℃, or 60℃. The baud rate calibration unit then retrieves a pre-stored temperature-baud rate compensation curve, obtained through prior testing and fitting. Communication tests are conducted on the slave device at multiple temperature points within a high and low temperature chamber, ranging from -40℃ to 85℃. The deviation between the actual baud rate and the theoretical value at different temperatures is recorded, and a temperature-baud rate compensation curve is generated through linear or polynomial fitting. Based on the current temperature, the temperature-baud rate compensation curve is retrieved, and each preset baud rate is numerically corrected. The corrected baud rate sequence is stored in the storage unit for subsequent communication and switching.
[0026] Using the above technical solution, the baud rate of low-power slave devices is significantly affected by temperature, especially in industrial environments or outdoor scenarios with large temperature differences. Temperature drift can cause baud rate deviations exceeding 5%, leading to communication failures. Temperature drift compensation calibration can reduce baud rate deviations and significantly improve communication accuracy under different temperature environments. The compensation curve is based on actual test fitting, closely matching the device's hardware characteristics. The calibration process is automatically completed during the initialization phase without user intervention, improving the device's environmental adaptability and communication stability, ensuring reliable communication with the host even under extreme temperatures.
[0027] It should be noted that the communication monitoring module includes a signal parsing unit and a timeout determination unit; The signal parsing unit is used to parse the communication signals received by the communication interface, and then extract the corresponding data frame format and check bit information from the communication signals; When the parsed data frame format conforms to the preset communication protocol and the check bit information is verified, it is determined to be a valid communication signal, and the baud rate information used in the current communication is recorded; if the data frame format does not conform to the preset protocol or the check bit information verification fails, it is determined to be an invalid communication signal, and the communication timeout timer is not reset. The timeout determination unit is set with a first preset threshold and a second preset threshold, wherein the first preset threshold is set to 1 second and the second preset threshold is set to 20 seconds; when the communication monitoring module does not detect a valid communication signal, the timeout determination unit starts a communication timeout timer. When the timer reaches 1 second, it sends a switching trigger signal to the baud rate switching module; when the timer reaches 20 seconds, it sends a sleep trigger signal to the low power management module. The timeout determination unit immediately resets the communication timeout timer to zero and restarts the timing process each time a valid communication signal is detected.
[0028] It should be noted that the baud rate switching module includes a sequence retrieval unit, a switching execution unit, and a response detection unit; The sequence retrieval unit is used to retrieve the baud rate sequence corresponding to the initialization module from the storage unit after receiving the switching trigger signal sent by the communication monitoring module. If there is baud rate information of historical successful communication in the storage unit, the baud rate is placed at the beginning of the sequence and the switching attempt is performed first to improve the efficiency of baud rate adaptation. The switching execution unit is used to adjust the baud rate configuration parameters of the slave device sequentially according to the baud rate sequence. In this embodiment, the baud rate configuration parameters include clock division coefficient, data transmission rate, etc. After each switch, the current baud rate is maintained for 1 second to reserve time for stable transmission of communication signals. The response detection unit is used to send a test signal to the host through the communication interface after the switching execution unit completes the baud rate switching. The test signal contains the identification information of the slave device and the current baud rate information. If a response signal is received from the host within 1 second, and the baud rate information in the response signal is consistent with the current baud rate information, the response is determined to be successful, and a communication success signal is sent to the communication monitoring module, which then resets the timeout timer. If no response signal is received or the baud rate information in the response signal does not match, the response is determined to be unsuccessful, and the switching execution unit is triggered to switch to the next baud rate in the baud rate sequence.
[0029] It should be noted that the low-power management module includes a sleep preparation unit and a power consumption control unit; The hibernation preparation unit is used to save the working status information of the slave device after receiving the hibernation trigger signal sent by the communication monitoring module, and store the saved working status information in a preset non-volatile storage unit to ensure that the slave device can restore the working status before hibernation after waking up. The power consumption control unit is used to gradually shut down unnecessary functional modules of the slave device based on the current status information of the sleep preparation unit, while keeping the signal detection circuit in working state. First, it shuts down the high-speed clock of the core processor and switches to a low-speed clock mode. Then, it shuts down the signal amplification circuit and data processing circuit of the communication interface, and cuts off the power supply path of the peripheral devices, so that the overall power consumption of the slave device is reduced to the μA level. In addition, the power consumption control unit will also set a sleep state flag to be used by the wake-up module to identify the current state of the slave device.
[0030] It should be noted that the wake-up module includes an edge detection unit and a state recovery unit; The edge detection unit is used to monitor the signal edge changes of the communication interface through the signal detection circuit when the slave device is in deep sleep mode. When the signal edge change meets the preset signal edge characteristics, it is determined to be a valid wake-up signal and a wake-up trigger signal is sent to the state recovery unit. The preset signal edge characteristics include the time threshold of the edge transition, the level change amplitude, etc., to avoid false wake-up triggers. After receiving the wake-up trigger signal, the state recovery unit gradually restores the slave device according to the preset wake-up procedure, retrieves the working state information saved before hibernation from the non-volatile storage unit, restores the baud rate of the slave device to the baud rate of the most recent successful communication, and enables the slave device to quickly enter the communication state.
[0031] It should be noted that it also includes a storage update module; The storage update module is connected to the communication monitoring module and is used to periodically update the communication success baud rate information recorded in the storage unit. When the slave device successfully communicates multiple times in a row with a certain baud rate, the sorting priority of the baud rate in the baud rate sequence is increased. When a certain baud rate fails to achieve effective communication in multiple polling switches, the sorting priority of the baud rate in the baud rate sequence is decreased or it is temporarily removed from the baud rate sequence.
[0032] Meanwhile, the storage update module also records the communication logs of the slave device, including information such as the baud rate, communication time, and signal strength of each communication. When the slave device is connected to the debugging device, the communication logs can be exported through the communication interface for analysis and optimization of the baud rate adaptation effect, further improving the baud rate adaptation capability of the slave device in complex environments.
[0033] It should be noted that an exception handling module is also included. The exception handling module is used to monitor the abnormal state of the slave device during the baud rate switching process. When the baud rate switching module fails to achieve effective communication after traversing all baud rates within a preset number of times, it is determined to be a communication abnormality. The exception handling module will control the slave device to perform a hardware reset. After the reset, the initialization module will be restarted to reinitialize the baud rate sequence.
[0034] When a persistent invalid interference signal is detected at the communication interface, the anomaly handling module will activate the signal filtering unit to filter the input signal of the communication interface, filter out interference signals that do not conform to the preset characteristics, and at the same time reduce the signal detection sensitivity of the communication monitoring module to avoid frequent baud rate switching and power consumption increase caused by interference signals, ensuring that the slave device can still work stably in complex electromagnetic environments.
[0035] Example 2 This application also discloses a baud rate adaptive switching method for low-power slave devices.
[0036] Reference Figure 2 A method for adaptive baud rate switching of a low-power slave device includes the following steps: When the slave device is powered on and initialized, multiple preset baud rates are sorted in sequence and the sorted baud rate sequence is stored in the storage unit of the slave device. At the same time, the communication parameters are initialized, so that the slave device enters the initial communication state. After the slave device enters the initial communication state, the system monitors in real time whether there is a valid communication signal on the slave device's communication interface. When a valid communication signal is detected, the system continuously tracks the transmission status of the communication signal, records the baud rate information of successful communication and stores it in the storage unit, and resets the communication timeout timer. When no valid communication signal is detected, the system starts the communication timeout timer to count the duration of the no-communication state. When the communication timeout timer reaches the first preset threshold, the baud rate sequence is retrieved from the storage unit, and the current baud rate of the slave device is switched sequentially according to the sequence. After each switch, a test signal is sent through the communication interface. If a response signal from the master is detected after the test signal is sent, it is determined that the current baud rate is successfully adapted, the baud rate switching is stopped, and the current baud rate is maintained for communication. If no response signal is detected after traversing all preset baud rates, the polling and switching is restarted from the beginning of the baud rate sequence until a valid response signal is detected. When the communication timeout timer reaches the second preset threshold, the slave device is triggered to enter deep sleep mode, wherein the second preset threshold is greater than the first preset threshold; When the slave device is in deep sleep mode, the signal edge changes of the communication interface are detected in real time. When the signal edge characteristics that meet the preset criteria are detected, the slave device is triggered to wake up from deep sleep mode. During the wake-up process, the baud rate of the most recent successful communication is retrieved from the storage unit and the baud rate of the slave device is restored to the baud rate, so that the slave device can quickly enter the communication state.
[0037] The above content is merely an example and illustration of the concept of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described or use similar methods to replace them, as long as they do not deviate from the concept of the invention, they should all fall within the protection scope of the present invention.
[0038] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0039] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to any specific implementation. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention.
Claims
1. A baud rate adaptive switching system for a low-power slave device, characterized in that, It includes an initialization module, a communication monitoring module, a baud rate switching module, a low power management module, and a wake-up module; The initialization module is used to sort multiple preset baud rates in sequence when the slave device is powered on and initialized, and store the sorted baud rate sequence in the storage unit of the slave device. At the same time, it initializes the communication parameters so that the slave device enters the initial communication state. The communication monitoring module is used to monitor in real time whether there is a valid communication signal on the communication interface of the slave device after the slave device enters the initial communication state. When a valid communication signal is detected, the transmission status of the communication signal is continuously tracked, and the baud rate information of successful communication is recorded and stored in the storage unit. At the same time, the communication timeout timer is reset. When no valid communication signal is detected, the communication timeout timer is started to count the duration of no communication state. The baud rate switching module is connected to the communication monitoring module. When the communication timeout timer reaches the first preset threshold, the baud rate sequence is retrieved from the storage unit, and the current baud rate of the slave device is switched sequentially according to the sequence order. After each switch, a test signal is sent through the communication interface. If the host's response signal is detected after the test signal is sent, it is determined that the current baud rate is successfully adapted, the baud rate switching is stopped, and the current baud rate is maintained for communication. If no response signal is detected after iterating through all preset baud rates, return to the beginning of the baud rate sequence and restart the polling switch until a valid response signal is detected. The low-power management module is connected to the communication monitoring module. When the communication timeout timer reaches the second preset threshold, the slave device is triggered to enter a deep sleep mode. The second preset threshold is greater than the first preset threshold. The wake-up module is used to detect signal edge changes of the communication interface in real time when the slave device is in deep sleep mode. When a preset signal edge characteristic is detected, the slave device is triggered to wake up from deep sleep mode. During the wake-up process, the baud rate of the most recent successful communication is retrieved from the storage unit and the baud rate of the slave device is restored to the baud rate, so that the slave device can quickly enter the communication state.
2. The baud rate adaptive switching system for a low-power slave device according to claim 1, characterized in that, The initialization module includes a baud rate calibration unit; The baud rate calibration unit is used to perform temperature drift compensation calibration on multiple preset baud rates during the power-on initialization process of the slave device. The temperature drift compensation calibration process is as follows: The current ambient temperature is obtained by the temperature sensor inside the slave device. Based on the preset temperature-baud rate compensation curve, multiple preset baud rates are numerically corrected. The temperature-baud rate compensation curve is obtained by fitting the slave device after communication tests under different temperature environments.
3. The baud rate adaptive switching system for a low-power slave device according to claim 1, characterized in that, The communication monitoring module includes a signal parsing unit and a timeout determination unit; The signal parsing unit is used to parse the communication signals received by the communication interface, and then extract the corresponding data frame format and check bit information from the communication signals; When the parsed data frame format conforms to the preset communication protocol and the check bit information is verified, it is determined to be a valid communication signal, and the baud rate information used in the current communication is recorded. If the data frame format does not conform to the preset protocol or the check bit information verification fails, it is determined to be an invalid communication signal and the communication timeout timer is not reset. The timeout determination unit is set with a first preset threshold and a second preset threshold, wherein the first preset threshold is set to 1 second and the second preset threshold is set to 20 seconds; when the communication monitoring module does not detect a valid communication signal, the timeout determination unit starts a communication timeout timer. When the timer reaches 1 second, it sends a switching trigger signal to the baud rate switching module; when the timer reaches 20 seconds, it sends a sleep trigger signal to the low power management module. The timeout determination unit immediately resets the communication timeout timer to zero and restarts the timing process each time a valid communication signal is detected.
4. The baud rate adaptive switching system for a low-power slave device according to claim 3, characterized in that, The baud rate switching module includes a sequence retrieval unit, a switching execution unit, and a response detection unit; The sequence retrieval unit is used to retrieve the baud rate sequence corresponding to the initialization module from the storage unit after receiving the switching trigger signal sent by the communication monitoring module; The switching execution unit is used to adjust the baud rate configuration parameters of the slave device sequentially according to the baud rate sequence. The response detection unit is used to send a test signal to the host through the communication interface after the switching execution unit completes the baud rate switching. The test signal contains the identification information of the slave device and the current baud rate information. If a response signal is received from the host within 1 second, and the baud rate information in the response signal is consistent with the current baud rate information, the response is determined to be successful, and a communication success signal is sent to the communication monitoring module, which then resets the timeout timer. If no response signal is received or the baud rate information in the response signal does not match, the response is determined to be unsuccessful, and the switching execution unit is triggered to switch to the next baud rate in the baud rate sequence.
5. The baud rate adaptive switching system for a low-power slave device according to claim 3, characterized in that, The low-power management module includes a sleep preparation unit and a power control unit; The hibernation preparation unit is used to save the working status information of the slave device after receiving the hibernation trigger signal sent by the communication monitoring module, and to store the saved working status information in a preset non-volatile storage unit. The power consumption control unit is used to gradually shut down unnecessary function modules of the slave device based on the current status information of the sleep preparation unit, while keeping the signal detection circuit in working state.
6. The baud rate adaptive switching system for a low-power slave device according to claim 5, characterized in that, The wake-up module includes an edge detection unit and a state recovery unit; The edge detection unit is used to monitor the signal edge changes of the communication interface through the signal detection circuit when the slave device is in deep sleep mode. When the signal edge changes meet the preset signal edge characteristics, it is determined to be a valid wake-up signal and a wake-up trigger signal is sent to the state recovery unit. After receiving the wake-up trigger signal, the state recovery unit gradually restores the slave device according to the preset wake-up procedure, retrieves the working state information saved before hibernation from the non-volatile storage unit, restores the baud rate of the slave device to the baud rate of the most recent successful communication, and enables the slave device to quickly enter the communication state.
7. The baud rate adaptive switching system for a low-power slave device according to claim 1, characterized in that, It also includes a storage update module; The storage update module is connected to the communication monitoring module and is used to periodically update the communication success baud rate information recorded in the storage unit. When the slave device successfully communicates multiple times in a row with a certain baud rate, the sorting priority of the baud rate in the baud rate sequence is increased. When a certain baud rate fails to achieve effective communication in multiple polling switches, the sorting priority of the baud rate in the baud rate sequence is decreased or it is temporarily removed from the baud rate sequence.
8. The baud rate adaptive switching system for a low-power slave device according to claim 6, characterized in that, It also includes an exception handling module, which is used to monitor the abnormal state of the slave device during baud rate switching. When the baud rate switching module fails to achieve effective communication after traversing all baud rates within a preset number of times, it is determined to be a communication abnormality. The exception handling module will control the slave device to perform a hardware reset. After the reset, the initialization module will be restarted to reinitialize the baud rate sequence.
9. A baud rate adaptive switching method for a low-power slave device, applied to the baud rate adaptive switching system for a low-power slave device as described in any one of claims 1-8, characterized in that, Includes the following steps: When the slave device is powered on and initialized, multiple preset baud rates are sorted in sequence and the sorted baud rate sequence is stored in the storage unit of the slave device. At the same time, the communication parameters are initialized, so that the slave device enters the initial communication state. After the slave device enters the initial communication state, the system monitors in real time whether there is a valid communication signal on the slave device's communication interface. When a valid communication signal is detected, the system continuously tracks the transmission status of the communication signal, records the baud rate information of successful communication and stores it in the storage unit, and resets the communication timeout timer. When no valid communication signal is detected, the system starts the communication timeout timer to count the duration of the no-communication state. When the communication timeout timer reaches the first preset threshold, the baud rate sequence is retrieved from the storage unit, and the current baud rate of the slave device is switched sequentially according to the sequence order. After each switch, a test signal is sent through the communication interface. If the host's response signal is detected after the test signal is sent, it is determined that the current baud rate is successfully adapted, the baud rate switching is stopped, and the current baud rate is maintained for communication. If no response signal is detected after iterating through all preset baud rates, return to the beginning of the baud rate sequence and restart the polling switch until a valid response signal is detected. When the communication timeout timer reaches the second preset threshold, the slave device is triggered to enter deep sleep mode, wherein the second preset threshold is greater than the first preset threshold; When the slave device is in deep sleep mode, the signal edge changes of the communication interface are detected in real time. When the signal edge characteristics that meet the preset criteria are detected, the slave device is triggered to wake up from deep sleep mode. During the wake-up process, the baud rate of the most recent successful communication is retrieved from the storage unit and the baud rate of the slave device is restored to the baud rate, so that the slave device can quickly enter the communication state.
10. A computer-readable storage medium, characterized in that: The device stores instructions that, when executed on a computer, cause the computer to perform a baud rate adaptive switching system for a low-power slave device as described in any one of claims 1 to 8.