Trailer module control method and device, vehicle and storage medium

By listening to vehicle network management messages to wake up the trailer module and initialize the register state, the problem of trailer module wake-up delay was solved, enabling timely lighting of trailer lights and optimization of vehicle energy consumption, thereby improving driving safety and the range of electric vehicles.

CN121284060APending Publication Date: 2026-01-06GREAT WALL MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511313630.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-15
Publication Date
2026-01-06

AI Technical Summary

Technical Problem

The trailer module has a significant delay when it is woken up, which causes the trailer lights to fail to turn on in time, affecting driving safety.

Method used

By listening to vehicle network management messages, the microcontroller unit of the trailer module is woken up, and the register state is initialized in the woken state. The watchdog timer is then fed to ensure that the central processing unit’s startup process proceeds smoothly and to prevent wake-up delays caused by register abnormalities.

Benefits of technology

It significantly improves the wake-up latency of the trailer module, ensuring that the trailer lights turn on in time, improving driving safety, and reduces the overall vehicle energy consumption through precise power management, extending the driving range of electric vehicles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121284060A_ABST
    Figure CN121284060A_ABST
Patent Text Reader

Abstract

The invention discloses a trailer module control method and device, a vehicle and a storage medium, and relates to the field of vehicle control. According to the scheme, when a microcontroller unit of a trailer module is in a non-awakening state, once a corresponding target network management message is detected, the microcontroller unit is awakened, and the state of a register is initialized. And then, executing a starting process of an internal central processing unit through the microcontroller unit. When the microcontroller unit is in the awakening state, the dog feeding operation of the watchdog timer is triggered according to the state of the register, and if dog feeding fails, the watchdog timer resets the microcontroller unit to the non-awakening state to wait for awakening again, so that the system is prevented from being stuck. Besides, the pre-initialization of the register ensures that the state on which the dog feeding operation depends is kept reliable, repeated circulation of'wakeup attempt-dog feeding failure-re-dormancy 'caused by the abnormality of the register is effectively reduced, and the overall wakeup time delay of the trailer module is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle control technology, and in particular to a trailer module control method, device, vehicle, and storage medium. Background Technology

[0002] As a key connecting component between the tractor and the trailer (also known as a trailer), the trailer module's core function is to provide power to the trailer's rear lighting system (including brake lights, turn signals, and side marker lights) and precisely control its operating status. The module's real-time responsiveness is directly related to driving safety: if the trailer lights cannot be activated in real time when the tractor's driving status changes, following vehicles will be unable to promptly determine the tractor driver's intentions, potentially leading to accidents.

[0003] In practical applications, the trailer module will enter a sleep state after being inactive for a long time. However, there is a significant delay when the trailer module is woken up, which causes the trailer lights to fail to turn on in time, seriously threatening driving safety. Summary of the Invention

[0004] To address the significant delay in trailer module wake-up in existing technologies, this application provides a trailer module control method, device, vehicle, and storage medium, with the technical solution as follows: A trailer module control method includes: Listen for network management messages in the vehicle, which is equipped with a trailer module; When both the microcontroller unit and the central processing unit in the trailer module are in a non-wake-up state, if a target network management message is detected, the microcontroller unit is woken up and the state of the registers in the microcontroller unit is initialized; wherein, the target network management message corresponds to the trailer module; The microcontroller unit has a built-in central processing unit and is configured to execute a wake-up process for the central processing unit in a wake-up state, and trigger a watchdog feed operation based on the state of the registers; the watchdog is configured to control the microcontroller unit to switch to an unwake-up state if the watchdog feed fails.

[0005] Optionally, the method further includes: when the microcontroller unit is in a wake-up state, if the target network management message is not detected for a continuous first preset duration, then the microcontroller unit is controlled to switch to a non-wake-up state. This technical means achieves precise power consumption management: when the trailer module function is no longer needed (i.e., the target network management message is not detected for a continuous period of time), the microcontroller unit is actively controlled to re-enter a low-power non-wake-up state, thereby significantly reducing the necessary static current consumption, which is crucial for optimizing vehicle energy consumption and extending the driving range of vehicles, especially electric vehicles; at the same time, by carefully setting the first preset duration as the timeout window for communication monitoring, the common short-term communication fluctuations or message transmission delays in the vehicle network environment can be effectively filtered out, avoiding the microcontroller unit from prematurely or erroneously entering the non-wake-up state, which may be caused by this, and ensuring that the trailer module can remain awake during the period when the function is actually needed (i.e., when the network management message exists intermittently but has not reached the timeout threshold), thereby maintaining the continuous availability of trailer-related functions and achieving a balance between energy saving and functional reliability.

[0006] Optionally, the method further includes: determining that the watchdog timer has failed if it does not receive the watchdog timer operation for a second preset duration; wherein the second preset duration is greater than or equal to the expected completion time of the startup process. This technique, by carefully setting the second preset duration (i.e., the watchdog timer's timeout window) to be no less than the expected completion time of the CPU startup process (covering key steps from initial power-on, core firmware loading, critical peripheral initialization to final stable operating state readiness), fundamentally ensures that the entire startup process has a sufficient and undisturbed execution time window, enabling it to execute all necessary startup tasks completely and orderly without being interrupted by premature or erroneous resets of the conventional watchdog timer. This ensures that the watchdog timer reset mechanism is precisely activated only when the microprocessor unit experiences a substantial failure (e.g., falling into an infinite loop, critical hardware initialization stalling, or encountering an unrecoverable software error), preventing it from completing the startup process and successfully triggering the watchdog timer operation within the preset safe time limit.

[0007] Optionally, initializing the state of the registers in the microcontroller unit includes configuring the registers in the microcontroller unit to a predetermined state flag bit that triggers the watchdog timer feeding operation. This technique, by proactively resetting the registers to a known, correct state flag bit—specifically designed to support the smooth execution of the subsequent watchdog timer feeding logic—during the early stages of microcontroller unit wake-up, fundamentally solves the problem of registers accidentally recording uncertain states during electricalally vulnerable phases (susceptible to electromagnetic interference, power ripple, clock signal instability, etc.; and during low voltage or power-on surges, unintended internal logic flipping may also occur), thus incorrectly misleading the watchdog timer logic (e.g., causing the watchdog timer to mistakenly believe a timeout has occurred before the predetermined time), leading to an unexpected reset of the microcontroller unit. This proactive, defensive register state protection mechanism ensures that the watchdog timer strictly and only triggers its reset function when the microcontroller unit experiences a substantial abnormal freeze during its main task execution (i.e., the software flow cannot proceed to the code point for executing the watchdog timer operation within a preset safe time).

[0008] Optionally, the method further includes recording the cumulative number of failed attempts to perform the dog-feeding operation when the microcontroller unit executes the activation process; and, when the cumulative number reaches a preset threshold, reporting the abnormal fault code of the trailer module and disabling the activation process. This technical approach, on the one hand, provides clear and timely status warnings and diagnostic clues to drivers or maintenance personnel by proactively reporting abnormal fault codes that characterize specific fault root causes, prompting them to take appropriate measures (such as seeking repairs), thereby effectively avoiding driving safety hazards caused by trailer module malfunctions; on the other hand, by forcibly disabling the central processing unit activation process, it completely prevents the microcontroller unit from continuously and futilely attempting to start the central processing unit when a serious fault already exists. This behavior not only consumes vehicle power but may also lead to localized overheating, accelerated aging, or even permanent physical damage to power devices (such as the power module and the central processing unit itself) due to frequent switching shocks and surge currents in a short period.

[0009] Optionally, monitoring network management messages in the vehicle includes: parsing network management messages output by the controller area network bus in the vehicle to extract corresponding message identifiers; if the extracted message identifier matches the message identifier set for the target network management message, it is determined that the target network management message has been monitored. This technique achieves accurate identification of the vehicle's need to wake up the trailer module by matching the message identifier of the detected network management message with the message identifier of a specific target network management message. Specifically, when a target network management message about the trailer module appears in the vehicle network, it is determined that the trailer module needs to be woken up to identify the message and trigger the corresponding wake-up process, thereby activating the trailer module, which was originally in a dormant state, and enabling it to perform related functions. This mechanism strictly shields irrelevant network management message interference in most driving scenarios where towing functionality is not required, ensuring that the towing module continuously and stably maintains its ultra-low static power consumption sleep state, significantly reducing vehicle static current consumption, and making a significant contribution to extending the battery life of fuel vehicles and improving the driving range of electric vehicles; and once a valid target network management message is detected, it can trigger the microcontroller unit to wake up in almost real time, ensuring that the towing module is quickly ready for use.

[0010] Optionally, the step of determining that the target network management message has been detected if the extracted message identifier matches the message identifier set for the target network management message includes: when the extracted message identifier matches the message identifier set for the target network management message, verifying whether the data of the target network management message contains a preset trailer function enable flag; wherein, the trailer function enable flag is written into the data of the target network management message by the vehicle's main control unit after detecting a physical connection to a trailer; if the data of the target network management message contains the trailer function enable flag, then it is determined that the target network management message has been detected. This technical means ensures that the microcontroller unit of the trailer module can only be woken up when the vehicle is physically connected to a trailer, while the microcontroller unit remains in an unwakeable state when the vehicle is not physically connected to a trailer to achieve energy saving.

[0011] A trailer module control method apparatus, comprising: A message monitoring module is used to monitor network management messages in the vehicle, which is equipped with a trailer module. The first execution module is configured to, when the microcontroller unit in the trailer module is in an unwake-up state, wake up the microcontroller unit if a target network management message is detected, and initialize the state of the registers in the microcontroller unit, wherein the target network management message corresponds to the trailer module; The microcontroller unit has a built-in central processing unit and is configured to execute an enable process for the central processing unit in the wake-up state, and trigger a watchdog timer feeding operation based on the state of the registers; the watchdog timer is configured to control the microcontroller unit to switch to an unwake-up state if the watchdog timer feeding operation fails.

[0012] A vehicle includes: a processor; and a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the aforementioned trailer module control method.

[0013] A computer-readable storage medium storing a computer program that, when executed, implements the above-described trailer module control method.

[0014] This application provides a trailer module control scheme that aims to eliminate abnormal wake-up delays by optimizing the trailer module's wake-up process, thereby enabling the trailer module to promptly illuminate its lights to ensure driving safety. Specifically, when the trailer module's microcontroller unit is in an inactive state, the system monitors network management messages in the vehicle network to determine whether the trailer module needs to be activated. Once a target network management message for the corresponding trailer module is detected, the microcontroller unit is immediately woken up, and the state of its registers is initialized. Subsequently, the microcontroller unit executes the activation process for its internal central processing unit. When the microcontroller unit is in an activated state, a watchdog timer feeding operation is triggered based on the register state. If the watchdog timer feeding operation fails, the watchdog timer resets the microcontroller unit to an inactive state to await another wake-up attempt, thus preventing the system from freezing. Furthermore, the pre-initialization of registers ensures the reliability of the hardware state upon which the watchdog timer feed operation depends, effectively reducing the probability of the watchdog timer being reset due to register anomalies. This avoids the repeated cycle of "wake-up attempt → watchdog timer feeding failure → re-sleep," thereby significantly improving the overall wake-up latency of the trailer module.

[0015] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a first flowchart illustrating the trailer module control method according to an embodiment of this application.

[0018] Figure 2 This is a schematic diagram of the trailer module in an embodiment of this application.

[0019] Figure 3 This is a second flowchart illustrating the trailer module control method according to an embodiment of this application.

[0020] Figure 4 This is a schematic diagram of the trailer module control device according to an embodiment of this application.

[0021] Figure 5 This is a schematic diagram of the vehicle structure according to an embodiment of this application. Detailed Implementation

[0022] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0023] As mentioned earlier, the trailer module currently enters a sleep state, or unawakened state, after being inactive for an extended period. During this time, its internal microcontroller unit (MCU) maintains basic functions, but the central processing unit (CPU) within the MCU is completely disabled to reduce power consumption. The trailer module's wake-up process can be roughly divided into the following two stages: Phase 1: The microcontroller unit is woken up by the network management message from the tractor vehicle; The second stage: the microcontroller unit, after being woken up, further activates its internal central processing unit to restore full functionality.

[0024] Existing technology prevents the trailer module from abnormally freezing by configuring a watchdog timer (WTT) mechanism: When the microcontroller unit is in a wake-up state, it periodically reads the state of its internal registers and triggers a watchdog timer feed operation (sending a feed signal) to prove that it is operating normally. If the microcontroller unit malfunctions and causes the watchdog timer to fail to feed (i.e., it fails to send a feed signal within the specified time), the watchdog timer will reset the microcontroller unit to an unwake-up state and wait for a network management message to trigger wake-up.

[0025] However, in practical applications, when the microcontroller unit is in an unwakeable state, its internal registers are susceptible to voltage fluctuations, electromagnetic interference, or clock signals, leading to abnormal states. This abnormality directly affects the stability of the watchdog timer operation after wake-up. This abnormality prevents the microcontroller unit from stably triggering the watchdog timer operation, causing a reset and resulting in a recurring cycle of "wake-up attempt → watchdog timer failure → re-sleep," ultimately leading to an actual wake-up latency far exceeding the safety design threshold.

[0026] In view of this, this application proposes a trailer module control method, device, vehicle, and storage medium, aiming to solve the problem of high wake-up latency of the trailer module. The technical solutions provided by various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0027] refer to Figure 1 As shown, one embodiment of this application provides a trailer module control method, including the following steps: S101 monitors network management messages in the vehicle, which is equipped with a trailer module.

[0028] The various Electronic Control Units (ECUs) within a vehicle primarily communicate with each other via the Controller Area Network (CAN) bus. This CAN bus acts like the vehicle's nervous system, responsible for efficiently and reliably transmitting various control commands and status information.

[0029] In this embodiment, the trailer module, as a specific ECU of the vehicle, has its wake-up and non-wake-up states controlled by Network Management (NM) messages transmitted on the CAN bus. Specifically, when the microcontroller unit is in the wake-up state, if no target network management message is detected for a first preset duration (slightly longer than the typical transmission period of the target network management message), the microcontroller unit is controlled to enter the non-wake-up state. When the controller unit is in the non-wake-up state, if a target network management message is detected, the microcontroller unit needs to be woken up immediately to ensure that the trailer lights can be turned on in time.

[0030] In existing technologies, various network management messages run on the vehicle's CAN bus, each corresponding to a different ECU or functional domain. To accurately determine when the trailer module needs to be woken up, this embodiment requires continuous monitoring of these network management messages transmitted via the CAN bus and identifying the target network management message specifically designed for the trailer module. Specifically, whenever a network management message is output on the CAN bus, it is immediately parsed to extract its key message identifier (usually an ID used to uniquely identify the message source or type). Then, the extracted message identifier is matched against a pre-defined identifier for the target network management message specifically used to wake up the trailer module. If the two match successfully, it can be determined that the currently received message is the target network management message that needs to trigger the trailer module's action.

[0031] Building upon the above, this embodiment can further configure the vehicle's main control unit to write a trailer function enable flag into the data of the target network management message after detecting a physical connection with the trailer, thus representing the physical connection between the vehicle and the trailer. Correspondingly, when the extracted message identifier matches the message identifier of the target network management message, it can be further verified whether the data of the target network management message contains the preset trailer function enable flag. If the data of the target network management message contains the trailer function enable flag, it is determined that the target network management message has been detected. If the data of the target network management message does not contain the trailer function enable flag, it indicates that the vehicle is not physically connected to the trailer. In this case, waking up the microcontroller unit is meaningless, and it can be determined that the target network management message has not been detected, thereby keeping the microcontroller unit in an unwakeable state to achieve energy saving.

[0032] It should be noted that the target network management message in this embodiment is sent periodically. When a target network management message is detected, it indicates that the vehicle (as a towing vehicle) currently needs to activate the trailer module (for example, the driver may have hooked up a trailer or required trailer lights). At this time, the trailer module needs to enter the wake-up state as soon as possible so that it can control the illumination of trailer lights (such as brake lights, turn signals, etc.) in a timely and accurate manner, thereby ensuring driving safety. Conversely, if no target network management message is detected for a period of time, it indicates that the vehicle does not currently need to activate the trailer module's function. In this case, the trailer module is kept in an unwakeable state (i.e., a low-power sleep state), thereby reducing energy consumption and optimizing the overall vehicle power management efficiency.

[0033] S102, when the microcontroller unit in the trailer module is in an unwakeable state, if a target network management message is detected, the microcontroller unit is woken up and the state of the registers in the microcontroller unit is initialized. The target network management message corresponds to the trailer module. The microcontroller unit is equipped with a central processing unit and is configured to execute an enable process for the central processing unit in the wake-up state, and trigger a watchdog timer feeding operation based on the state of the registers. The watchdog timer is configured to control the microcontroller unit to switch to an unwakeable state if the watchdog feeding operation fails.

[0034] The core component of the trailer module is the microcontroller unit, see [link / reference] Figure 2 As shown, it is a microcomputer system that integrates registers, a central processing unit (CPU), and various external functional circuits (such as timers and communication interfaces). When the microcontroller unit is in an inactive state, its internal CPU is completely shut down, and the entire microcontroller unit maintains low power consumption to achieve energy saving.

[0035] Based on the preceding description, existing microcontroller units are equipped with a watchdog timer (implemented by external functional circuitry). Its main function is to ensure that the microcontroller unit's operation is not abnormally stalled. Specifically, when the microcontroller is in a wake-up state, it needs to execute by reading back the state of its registers, thus preventing it from being reset to an unwakeable state and restarted by the watchdog timer. The watchdog timer is configured to determine a feeding failure if it does not receive a feeding operation within a second preset duration. This second preset duration is slightly greater than or equal to the expected completion time of the CPU's startup process. This ensures that while accurately distinguishing between normal microcontroller unit operation (completing the feeding operation before timeout) and process stall (failure to complete the feeding operation within timeout), sufficient time margin is also provided for the normal startup of the CPU.

[0036] However, in practical applications, when a microcontroller unit is in an unwakeable state, its internal registers are in a vulnerable electrical environment. At this time, the registers are susceptible to electromagnetic interference, power supply ripple, clock signal instability, and other factors. Furthermore, during low voltage or power-on surges, unexpected flips in internal logic may occur. These factors combined can lead to abnormal storage of the register status bits. If the state of these registers used to trigger the watchdog timer operation becomes abnormal, it will directly cause the microcontroller unit to fail to execute the watchdog timer operation after being woken up, thus triggering a watchdog timer reset and returning it to an unwakeable state. This ultimately results in a recurring cycle of "wake-up attempt → watchdog timer failure → re-sleep".

[0037] To ensure stable triggering of the watchdog timer operation, this embodiment performs a crucial operation immediately after successfully waking up the microcontroller unit: initializing the state of the registers in the microcontroller unit. Specifically, this involves resetting the relevant registers (especially those involved in the watchdog control logic or critical process nodes) to predefined status flags that meet the subsequent "predetermined triggering of the watchdog timer operation requirements." This effectively eliminates potential hardware anomalies within the microcontroller unit, building a more reliable hardware foundation for the entire trailer module's wake-up process (including the final activation of the central processing unit).

[0038] Once the microcontroller unit is successfully woken up and its registers are initialized, the next step is to enable its internal central processing unit (CPU). This enable process is led by the woken-up microcontroller unit itself and ends after the CPU is successfully enabled. Specifically, the microcontroller unit guides the CPU from a completely stopped state to a full-speed operating state by applying specific control signals (such as power-on reset and clock enable signals) to the CPU. This process covers key steps from initial power-on, core firmware loading, and critical peripheral initialization, allowing the microcontroller unit to take over the control of various functions of the trailer module, such as controlling the trailer lights.

[0039] It should be noted that the watchdog timer always operates normally during the CPU startup process. That is, if a valid watchdog signal is not received within the second preset time period (i.e., the watchdog operation fails), it immediately determines that the microcontroller unit is malfunctioning and forcibly performs a reset operation, pulling the entire microcontroller unit back to an unwakeable state. In this embodiment, the cumulative number of failed watchdog operations can be recorded during the CPU startup process. When this cumulative number reaches a preset threshold, it is determined that the trailer module has a hardware fault or software defect that cannot be recovered from by a simple reset. At this time, two key measures are proactively taken: First, a specific trailer module fault code is reported. This fault code can be read through the vehicle diagnostic interface, promptly alerting the driver to potential problems with the trailer module so that appropriate measures can be taken in advance (such as avoiding towing or repairing as soon as possible) to ensure driving safety; second, subsequent CPU startup processes are disabled. Disabling the activation process has a dual purpose: on the one hand, it prevents repeated attempts to activate the central processing unit (CPU) in the event of a serious malfunction, avoiding unnecessary reset cycles that continuously drain the vehicle's battery; on the other hand, it also avoids more serious problems that may be caused by repeatedly activating the CPU, such as hardware overheating or damage.

[0040] In summary, this embodiment's method, when the trailer module's microcontroller unit is in an unwakeable state, determines whether the trailer module needs to be activated by monitoring network management messages in the vehicle network. Once a target network management message for the corresponding trailer module is detected, the microcontroller unit is immediately woken up, and the state of its registers is initialized. Subsequently, the microcontroller unit executes the activation process for its internal central processing unit. When the microcontroller unit is in a wakeable state, a watchdog timer feeding operation is triggered based on the register state. If the feeding operation fails, the watchdog timer resets the microcontroller unit to an unwakeable state to await another wake-up attempt, thus preventing the system from freezing. Furthermore, the pre-initialization of registers ensures the reliability of the hardware state upon which the feeding operation depends, effectively reducing the probability of the watchdog timer resetting due to register anomalies. This avoids the repeated cycle of "wake-up attempt → feeding failure → re-sleep," significantly improving the overall wake-up latency of the trailer module.

[0041] In practical applications, the trailer module control method of this embodiment is executed by the microcontroller unit in the trailer module. (Refer to...) Figure 2As shown, when the microcontroller unit is in an unwakeable state (i.e., ultra-low power sleep mode), most of its functional circuits (including the central processing unit core and non-essential peripherals) are forcibly powered down or placed in a clock-gated state, retaining only the minimum functions required to maintain basic power management and critical wake-up source monitoring, thereby strictly controlling the overall static power consumption to an extremely low level. At this time, the microcontroller unit continuously uses its specially reserved low-power message monitoring and identification function to capture and parse the network management message stream transmitted on the vehicle controller area network bus in real time, accurately extracting the message identifier of each network management message. Once it is identified that the extracted message identifier strictly matches the message identifier of the target network management specifically configured for the trailer module, it is immediately determined that a valid wake-up command, i.e., the target network management message, has been successfully detected. Once this determination is confirmed, the microcontroller unit will immediately initiate its own wake-up sequence and perform a crucial hardware state initialization operation—forcibly resetting its internal register set to a predefined initial state flag that can trigger the watchdog timer operation. This step aims to completely eliminate potential random hardware anomalies caused by electromagnetic interference, power glitches, or power-on surges during sleep. After reliably initializing the registers, the microcontroller unit then initiates and executes the startup process for its internal CPU (including releasing the reset signal, enabling the clock, and loading the startup code). If the CPU successfully starts up and enters a stable operating state, it signifies that the microcontroller unit is fully awake (full-function mode). Furthermore, after waking up, the microcontroller unit will continuously generate and issue watchdog timer feed signals periodically based on the register state (i.e., watchdog feed operation) to demonstrate that the main process is running normally. Meanwhile, the microcontroller unit continues to listen for target network management messages on the controller area network bus while in the wake-up state. If no valid target network management message is detected again within a window period of a first preset duration (e.g., typically 50 to 150 milliseconds), it determines that the trailer function is no longer needed and proactively (along with its internal central processing unit) safely and orderly switches to the aforementioned wake-up low-power state. On the other hand, during the execution of the central processing unit startup process and subsequent main tasks, if the watchdog timer detects that no valid watchdog operation signal has been received within a second preset duration, the watchdog timer will immediately trigger the reset logic, forcibly resetting the entire microcontroller unit (including its central processing unit) back to the wake-up state, causing it to re-enter the sleep standby state waiting for the target network management message to be triggered. This mechanism constitutes a protective barrier to prevent system software deadlock or hardware freeze.

[0042] Alternatively, the execution entity of the trailer module control method in this embodiment can also be an upper-level controller in the trailer module specifically used to control the microcontroller unit to switch between wake-up and non-wake-up states. This upper-level controller maintains power supply even after the trailer module is in sleep mode, enabling real-time capture and parsing of network management message streams transmitted on the vehicle controller's local area network bus, accurately extracting the message identifier of each network management message. Once it is identified that the extracted message identifier strictly matches the message identifier specifically configured for the target network management of the trailer module, a valid wake-up command, i.e., the target network management message, is successfully detected. Upon confirmation of this determination, the upper-level controller controls the microcontroller unit to switch from the non-wake-up state to the wake-up state, and the subsequent process follows the steps outlined above. Figure 2 The process shown is the same, so it will not be repeated here.

[0043] In addition, corresponding to Figure 1 In addition to the method shown, another embodiment of this application also provides a trailer module control device. Figure 4 This is a structural diagram of the trailer module control device 400, including: The message monitoring module 410 is used to monitor network management messages in the vehicle, which is equipped with a trailer module.

[0044] The execution module 420 is configured to, when the microcontroller unit in the trailer module is in an unwakeable state, wake up the microcontroller unit if a target network management message is detected, and initialize the state of the registers in the microcontroller unit, wherein the target network management message corresponds to the trailer module; wherein the microcontroller unit has a built-in central processing unit, and the microcontroller unit is configured to execute an enable process for the central processing unit in the wakeable state, and trigger a watchdog timer operation based on the state of the registers; the watchdog timer is configured to control the microcontroller unit to switch to an unwakeable state if the watchdog timer fails, and the microcontroller unit disables the central processing unit in the unwakeable state.

[0045] This embodiment aims to eliminate abnormal wake-up delays by optimizing the wake-up process of the trailer module, thereby enabling the trailer module to promptly illuminate its lights to ensure driving safety. When the microcontroller unit of the trailer module is in an inactive state, the solution monitors network management messages in the vehicle network to determine whether the trailer module needs to be activated. Once a target network management message for the corresponding trailer module is detected, the microcontroller unit is immediately woken up, and the state of its registers is initialized. Subsequently, the microcontroller unit executes the activation process for its internal central processing unit. When the microcontroller unit is in an activated state, a watchdog timer feeding operation is triggered based on the register state. If the watchdog timer feeding operation fails, the watchdog timer resets the microcontroller unit to an inactive state to await another wake-up attempt, thus preventing the system from freezing. Furthermore, the pre-initialization of registers ensures the reliability of the hardware state upon which the watchdog timer feed operation depends, effectively reducing the probability of watchdog timer reset due to register anomalies. This avoids the repeated cycle of "wake-up attempt → watchdog timer feeding failure → re-sleep," significantly improving the overall wake-up latency of the trailer module.

[0046] Optionally, the apparatus of this embodiment further includes: The third execution module is used to control the microcontroller unit to switch to an unwake-up state if the target network management message is not detected for a continuous first preset time period when the microcontroller unit is in a wake-up state. This technical means achieves precise power consumption management: when the trailer module function is no longer needed (i.e., the target network management message is not detected continuously), the microcontroller unit is actively controlled to enter a low-power unwake-up state, thereby significantly reducing the necessary static current consumption, which is crucial for optimizing vehicle energy consumption and extending the driving range of vehicles, especially electric vehicles; at the same time, by carefully setting the first preset time period as the timeout window for communication monitoring, the common short-term communication fluctuations or message transmission delays in the vehicle network environment can be effectively filtered out, avoiding the microcontroller unit from prematurely or erroneously entering the unwake-up state, which may be caused by this. This ensures that the trailer module can remain awake during the period when the function is actually needed (i.e., when the network management message exists intermittently but has not reached the timeout threshold), thereby maintaining the continuous availability of trailer-related functions and achieving a balance between energy saving and functional reliability.

[0047] Optionally, the apparatus of this embodiment further includes: The fourth execution module is used to determine that the watchdog timer has failed if it does not receive the watchdog timer operation for a second preset duration; wherein the second preset duration is greater than or equal to the expected completion time of the startup process. This technical approach, by carefully setting the second preset duration (i.e., the watchdog timer's timeout window) to be no less than the expected completion time of the central processing unit startup process (covering key steps from initial power-on, core firmware loading, critical peripheral initialization to final stable operating state readiness), fundamentally ensures that the entire startup process has a sufficient and undisturbed execution time window, enabling it to execute all necessary startup tasks completely and orderly without being interrupted by premature or erroneous resets of the conventional watchdog timer. This ensures that the watchdog timer reset mechanism is precisely activated only when the microprocessor unit experiences a substantial fault (e.g., trapped in an infinite loop, critical hardware initialization stalled, or encountering an unrecoverable software error), preventing it from completing the startup process and successfully triggering the watchdog timer operation within the preset safe time limit.

[0048] Optionally, the first execution module 420 initializes the state of the registers in the microcontroller unit, including configuring the registers in the microcontroller unit to a predetermined state flag bit that triggers the watchdog timer feeding operation. This technique, by proactively resetting the registers to a known, correct state flag bit—specifically designed to support the smooth execution of the subsequent watchdog timer feeding logic—during the early stages of microcontroller unit wake-up, fundamentally solves the problem of registers accidentally recording uncertain states during electricalally vulnerable phases (susceptible to electromagnetic interference, power ripple, unstable clock signals, or unexpected flipping of internal logic during low voltage / power-on surges), thus incorrectly misleading the watchdog timer logic (e.g., causing the watchdog timer to mistakenly believe a timeout has occurred before the predetermined time), leading to an unexpected reset of the microcontroller unit. Through this proactive, defensive register state protection mechanism, it is ensured that the watchdog timer strictly and only triggers its reset function when the microcontroller unit experiences a substantial abnormal freeze during its main task execution (i.e., the software flow cannot proceed to the code point for executing the watchdog timer operation within a preset safe time).

[0049] Optionally, the apparatus of this embodiment further includes: The fifth execution module is used to record the cumulative number of failed attempts to perform the dog-feeding operation when the microcontroller unit executes the activation process; and, when the cumulative number reaches a preset threshold, to report the abnormal fault code of the trailer module and disable the activation process. This technical approach, on the one hand, provides clear and timely status warnings and diagnostic clues to drivers or maintenance personnel by proactively reporting abnormal fault codes that characterize specific fault root causes, prompting them to take appropriate measures (such as seeking repair), thereby effectively avoiding driving safety hazards caused by trailer module malfunction; on the other hand, by forcibly disabling the central processing unit activation process, it completely prevents the microcontroller unit from continuously and futilely attempting to start the central processing unit when a serious fault already exists. This behavior not only consumes vehicle power but may also lead to localized overheating, accelerated aging, or even permanent physical damage to power devices (such as the power module and the central processing unit itself) due to frequent switching shocks and surge currents in a short period of time.

[0050] Optionally, the message monitoring module 410 monitors network management messages in the vehicle, including: parsing the network management messages output by the controller area network bus in the vehicle to extract the corresponding message identifier; if the extracted message identifier matches the message identifier set for the target network management message, it is determined that the target network management message has been detected. This technique achieves accurate identification of the vehicle's need to wake up the trailer module by matching the message identifier of the detected network management message with the message identifier of a specific target network management message. Specifically, when a target network management message about the trailer module appears in the vehicle network, it is determined that the trailer module needs to be woken up to identify the message and trigger the corresponding wake-up process, thereby activating the trailer module, which was originally in a dormant state, and enabling it to perform related functions. This mechanism strictly shields irrelevant network management message interference in most driving scenarios where towing functionality is not required, ensuring that the towing module continuously and stably maintains its ultra-low static power consumption sleep state, significantly reducing vehicle static current consumption, and making a significant contribution to extending the battery life of fuel vehicles and improving the driving range of electric vehicles; and once a valid target network management message is detected, it can trigger the microcontroller unit to wake up in almost real time, ensuring that the towing module is quickly ready for use.

[0051] Optionally, after the extracted message identifier matches the message identifier set in the target network management message, the message monitoring module 410 verifies whether the data of the target network management message contains a preset trailer function enable flag. The trailer function enable flag is written into the data of the target network management message by the vehicle's main control unit after detecting a physical trailer connection. If the data of the target network management message contains the trailer function enable flag, it is determined that the target network management message has been monitored. This technique ensures that the microcontroller unit of the trailer module can only be woken up when the vehicle is physically connected to a trailer, while the microcontroller unit remains in an unwakeable state when the vehicle is not physically connected to a trailer, thus achieving energy saving.

[0052] It should be noted that the specific methods by which each module performs its operation in the trailer module control device described in the above embodiments have been described in detail in the embodiments of the method, and will not be elaborated here.

[0053] Furthermore, another embodiment of this application provides a trailer module. (See reference) Figure 2 As shown, this trailer module integrates registers, a central processing unit, and various external functional circuits.

[0054] The microcontroller unit (MCU) retains its message listening function when in an unwakeable state to monitor network management messages within the vehicle. If the MCU detects a target network management message, it triggers a wake-up call and initializes the state of its internal registers. In the wake-up state, the MCU executes the activation procedure for the central processing unit (CPU). Simultaneously, in the wake-up state, the MCU also needs to trigger a watchdog timer feed operation based on the register state. This watchdog timer is implemented by external functional circuitry of the MCU and can control the MCU to switch to an unwakeable state if the watchdog timer feed operation fails.

[0055] Optionally, when the microcontroller unit is in the wake-up state, if the target network management message is not detected for a continuous first preset duration, it switches back to the wake-up state. This technique achieves precise power consumption management: when the trailer module function is no longer needed (i.e., the target network management message is not detected for a continuous period), the microcontroller unit is actively controlled to enter a low-power wake-up state, thereby significantly reducing the necessary static current consumption, which is crucial for optimizing vehicle energy consumption and extending the driving range of vehicles, especially electric vehicles. At the same time, by carefully setting the first preset duration as the timeout window for communication monitoring, the transient communication fluctuations or message transmission delays common in the vehicle network environment can be effectively filtered out, avoiding the microcontroller unit from prematurely or erroneously entering the wake-up state, ensuring that the trailer module can remain awake during the actual functional needs (i.e., when the network management message exists intermittently but has not reached the timeout threshold), thereby maintaining the continuous availability of trailer-related functions and achieving a balance between energy saving and functional reliability.

[0056] Optionally, if the watchdog timer does not receive the watchdog feed operation for a second preset duration, the watchdog feed operation is determined to have failed; wherein the second preset duration is greater than or equal to the expected completion time of the startup process. This technical means, by carefully setting the second preset duration (i.e., the timeout window of the watchdog timer) to be no less than the expected completion time of the central processing unit startup process (covering key steps from initial power-on, core firmware loading, critical peripheral initialization to final stable operating state readiness), fundamentally ensures that the entire startup process has a sufficient and undisturbed execution time window, enabling it to execute all necessary startup tasks completely and orderly without being interrupted by premature or erroneous reset of the conventional watchdog timer; this ensures that the watchdog timer reset mechanism is precisely activated only when the microprocessor unit actually suffers a substantial failure (such as getting stuck in an infinite loop, critical hardware initialization stalling, or encountering an unrecoverable software error), causing it to be unable to complete the startup process and successfully trigger the watchdog feed operation within the preset safe time limit.

[0057] Optionally, the microcontroller unit initializes the state of the registers, including configuring the registers to a state flag bit that is intended to trigger the watchdog timer feeding operation. This technique, by proactively resetting the registers to a known, correct state flag bit—specifically designed to support the smooth execution of the subsequent watchdog timer feeding logic—during the early stages of microcontroller unit wake-up, fundamentally solves the problem of registers accidentally recording uncertain states during electrically vulnerable phases (susceptible to electromagnetic interference, power ripple, unstable clock signals, or unintended internal logic flipping during low voltage / power-on surges), thus incorrectly misleading the watchdog timer logic (e.g., causing the watchdog timer to mistakenly believe a timeout has occurred before the predetermined time), leading to an unexpected reset of the microcontroller unit. This proactive, defensive register state protection mechanism ensures that the watchdog timer strictly and only triggers its reset function when the microcontroller unit experiences a substantial abnormal freeze during its main task execution (i.e., the software flow cannot proceed to the code point for executing the watchdog timer operation within a preset safe time).

[0058] Optionally, when executing the central processing unit's activation process, the microcontroller unit also records the cumulative number of failed attempts to execute the "feeding the dog" operation; and when the cumulative number reaches a preset threshold, it reports the abnormal fault code of the trailer module and disables the activation process. This technical approach, on the one hand, by proactively reporting abnormal fault codes that characterize specific fault root causes, provides drivers or maintenance personnel with clear and timely status warnings and diagnostic clues, prompting them to take appropriate measures (such as seeking repair), thereby effectively avoiding driving safety hazards caused by trailer module malfunction; on the other hand, by forcibly disabling the central processing unit's activation process, it completely prevents the microcontroller unit from continuously and futilely attempting to start the central processing unit when a serious fault already exists. This behavior not only consumes vehicle power but may also lead to localized overheating, accelerated aging, or even permanent physical damage to power devices (such as the power module and the central processing unit itself) due to frequent switching shocks and surge currents in a short period.

[0059] Optionally, the microcontroller unit monitors network management messages in the vehicle, including: parsing the network management messages output by the controller area network bus in the vehicle to extract the corresponding message identifier; if the extracted message identifier matches the message identifier set for the target network management message, it is determined that the target network management message has been detected. This technique achieves accurate identification of the vehicle's need to wake up the trailer module by matching the message identifier of the detected network management message with the message identifier of a specific target network management message. Specifically, when a target network management message about the trailer module appears in the vehicle network, it is determined that the trailer module needs to be woken up to identify the message and trigger the corresponding wake-up process, thereby activating the trailer module, which was originally in a dormant state, and enabling it to perform related functions. This mechanism strictly shields irrelevant network management message interference in most driving scenarios where towing functionality is not required, ensuring that the towing module continuously and stably maintains its ultra-low static power consumption sleep state, significantly reducing vehicle static current consumption, and making a significant contribution to extending the battery life of fuel vehicles and improving the driving range of electric vehicles; and once a valid target network management message is detected, it can trigger the microcontroller unit to wake up in almost real time, ensuring that the towing module is quickly ready for use.

[0060] Optionally, after the microcontroller unit matches the extracted message identifier with the message identifier set in the target network management message, it verifies whether the data of the target network management message contains a preset trailer function enable flag. The trailer function enable flag is written into the data of the target network management message by the vehicle's main control unit after detecting a physical trailer connection. If the data of the target network management message contains the trailer function enable flag, it is determined that the target network management message has been detected. This technique ensures that the microcontroller unit of the trailer module can only be woken up when the vehicle is physically connected to a trailer, while the microcontroller unit remains in an unwakeable state when the vehicle is not physically connected to a trailer, thus achieving energy saving.

[0061] In addition, another embodiment of this application provides a vehicle. Figure 5 This is a schematic diagram of the vehicle's structure, including a memory 501 and a processor 502. The memory 501 stores executable program code 5011, and the processor 502 is used to call and execute the executable program code 5011 to perform the large-scale question-and-answer method provided in the above embodiment. The corresponding steps include: Listen for network management messages in the vehicle, which is equipped with a trailer module.

[0062] When the microcontroller unit in the trailer module is in an unwake-up state, if a target network management message is detected, the microcontroller unit is woken up and the state of the registers in the microcontroller unit is initialized. The target network management message corresponds to the trailer module.

[0063] The microcontroller unit has a built-in central processing unit. The microcontroller unit is configured to execute an enable process for the central processing unit in the wake-up state and trigger a watchdog timer feeding operation based on the state of the register. The watchdog timer is configured to control the microcontroller unit to switch to an unwake-up state if the watchdog timer feeding operation fails.

[0064] This embodiment can divide the vehicle into functional modules according to the above method example. For example, each function can be assigned to a separate module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0065] When each functional module is divided according to its corresponding function, the vehicle may include: a message monitoring module, an information determination module, a first execution module, and a second execution module. It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional descriptions of the corresponding functional modules, and will not be repeated here.

[0066] It should be understood that the vehicle provided in this embodiment is used to execute the above-described trailer module control method, and therefore can achieve the same effect as the above-described implementation method. That is, the vehicle in this embodiment can determine whether the trailer module needs to be enabled by listening to network management messages in the vehicle network when the microcontroller unit of the trailer module is in an unwakeable state. Once the target network management message of the corresponding trailer module is detected, the microcontroller unit is immediately woken up, and the state of the registers in the microcontroller unit is initialized. Subsequently, the microcontroller unit executes the enable process for its internal central processing unit. When the microcontroller unit is in a wakeable state, the watchdog timer is triggered to feed the watchdog according to the state of the registers. Once the watchdog feeding operation fails, the watchdog timer resets the microcontroller unit to an unwakeable state to wait for another wake-up, thereby preventing the system from being stuck. In addition, the pre-initialization of the registers ensures that the hardware state on which the watchdog feeding operation depends remains reliable, effectively reducing the probability of the watchdog timer being reset due to register abnormalities, thereby avoiding the repeated cycle of "wake-up attempt → watchdog feeding failure → re-sleep", and thus significantly improving the overall wake-up latency of the trailer module.

[0067] When using integrated units, the vehicle may include a processing module and a storage module. The processing module is used to control and manage the vehicle's actions. The storage module supports the vehicle in executing program code and data.

[0068] The processing module may be a processor or a controller, which can implement or execute various exemplary logic blocks, modules, and circuits as disclosed in this application. The processor may also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc., and the storage module may be a memory.

[0069] Furthermore, another embodiment of this application provides a computer-readable storage medium storing computer program code. When the computer program code is executed on a computer, the computer performs the aforementioned method steps to implement the large-model question-answering method provided in the above embodiments, which includes the following steps: Listen for network management messages in the vehicle, which is equipped with a trailer module.

[0070] When the microcontroller unit in the trailer module is in an unwake-up state, if a target network management message is detected, the microcontroller unit is woken up and the state of the registers in the microcontroller unit is initialized. The target network management message corresponds to the trailer module.

[0071] The microcontroller unit has a built-in central processing unit. The microcontroller unit is configured to execute an enable process for the central processing unit in the wake-up state and trigger a watchdog timer feeding operation based on the state of the register. The watchdog timer is configured to control the microcontroller unit to switch to an unwake-up state if the watchdog timer feeding operation fails.

[0072] The beneficial effects of the above embodiments can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0073] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0074] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0075] In the description of this application, it should be understood that if the terms "upper", "lower", "front", "rear", "left" and "right" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the position or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.

[0076] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0077] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method of controlling a trailer module, characterized by, The method comprises the following steps: monitoring a network management message in a vehicle, wherein the vehicle is configured with a trailer module; when a microcontroller unit in the trailer module is in an unawakened state, if a target network management message is detected, awakening the microcontroller unit and initializing a state of a register in the microcontroller unit; wherein the target network management message corresponds to the trailer module; wherein the microcontroller unit is built-in with a central processing unit, the microcontroller unit is configured to execute an enabling process for the central processing unit in an awakened state, and trigger a watchdog feeding operation based on the state of the register; the watchdog timer is configured to control the microcontroller unit to switch to the unawakened state in the case of failure of the watchdog feeding operation.

2. The method of claim 1, wherein, Further comprising: when the microcontroller unit is in the awakened state, if the target network management message is not monitored for a first preset time period, controlling the microcontroller unit to switch to the unawakened state.

3. The method of claim 1, wherein, Further comprising: when the watchdog timer does not receive the watchdog feeding operation for a second preset time period, determining that the watchdog feeding operation fails; wherein the second preset time period is greater than or equal to an expected completion time of the enabling process.

4. The method of claim 1, wherein the initializing the state of the register in the microcontroller unit comprises: configuring a state flag bit of the register in the microcontroller unit to trigger the watchdog feeding operation.

5. The method according to any one of claims 1 to 4, characterized in that, Further comprising when the microcontroller unit executes the enabling process, recording a cumulative number of failures of the watchdog feeding operation; and when the cumulative number reaches a preset threshold, reporting an abnormal fault code of the trailer module and disabling the enabling process.

6. The method of any one of claims 1 to 4, wherein the monitoring the network management message in the vehicle comprises: parsing a network management message output by a controller area network bus in the vehicle to extract a corresponding message identifier; if the extracted message identifier matches a message identifier set for the target network management message, it is determined that the target network management message is monitored.

7. The method of claim 6, wherein if the extracted message identifier matches the message identifier set for the target network management message, it is determined that the target network management message is monitored, comprising: when the extracted message identifier matches the message identifier set for the target network management message, verifying whether data of the target network management message contains a preset trailer function enabling flag; wherein the trailer function enabling flag is written into the data of the target network management message by a master control unit of the vehicle after detecting a physical connection of a trailer; if the data of the target network management message contains the trailer function enabling flag, it is determined that the target network management message is monitored.

8. A trailer module control device characterized by, The method comprises the following steps: a message monitoring module for monitoring a network management message in a vehicle, wherein the vehicle is configured with a trailer module; The execution module is configured to wake up the microcontroller unit in the trailer module if a target network management packet corresponding to the trailer module is detected when the microcontroller unit is in an unawakened state, and initialize a state of a register in the microcontroller unit. The microcontroller unit is internally provided with a central processing unit, and is configured to execute an enabling process for the central processing unit in an awakened state, and trigger a watchdog feeding operation for a watchdog timer based on the state of the register; the watchdog timer is configured to control the microcontroller unit to return to the unawakened state if the watchdog feeding operation fails.

9. A vehicle comprising: A processor; and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, cause the processor to perform the method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and when the computer program is executed, the method of any one of claims 1 to 7 is implemented.