A vehicle-mounted fragrance control method, device, equipment, medium and vehicle
Patent Information
- Application Number
- CN202610961114.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-08-21
AI Technical Summary
[0003]现有技术中,因香氛瓶故障、接触不良、供电故障、香氛发生器故障等故障,从而导致车载香氛系统无法工作
[0015]本发明实施例提供的一种车载香氛控制方法、装置、设备、介质和车辆,通过在香氛发生器执行休眠操作的过程中,若接收到整车控制器发送的唤醒信号,则监测LIN通信芯片的工作模式; 若监测到LIN通信芯片处于异常待机模式,则控制LIN通信芯片退出异常待机模式并进入正常通信模式,以提高车载香氛系统运行的稳定性和可靠性。
Smart Images

Figure CN122607065A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive electronics technology, and more specifically, to a method, apparatus, device, medium, and vehicle for controlling in-vehicle fragrance. Background Technology
[0002] Car air fresheners not only effectively remove unpleasant odors such as smells and smoke from the car, continuously purifying the air inside, but also regulate the user's psychological state through different fragrances. The control circuit board of the car air freshener system integrates a LIN (Local Interconnect Network) communication chip, which enables data exchange between the car air freshener system and the vehicle's central control unit.
[0003] In the existing technology, the in-vehicle fragrance system may fail to work due to faults such as fragrance bottle malfunction, poor contact, power supply failure, or fragrance generator failure. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, apparatus, device, medium and vehicle for controlling in-vehicle fragrance, so as to improve the stability and reliability of the operation of the in-vehicle fragrance system.
[0005] In a first aspect, this application provides a method for controlling an in-vehicle fragrance, including: If a wake-up signal is received from the vehicle controller during the fragrance generator's sleep operation, the operating mode of the LIN communication chip will be monitored. If the LIN communication chip is detected to be in abnormal standby mode, the LIN communication chip will be controlled to exit the abnormal standby mode and enter the normal communication mode.
[0006] Optionally, if the LIN communication chip is detected to be in an abnormal standby mode, including: When the LIN communication chip is detected to be in abnormal standby mode, the mode control pin is at a low level, the data transmission pin is at a high level, and the reset pin is at a high level.
[0007] Optionally, controlling the LIN communication chip to exit abnormal standby mode and enter normal communication mode includes: By outputting a valid level to the enable pin of the LIN communication chip, the LIN communication chip is made to exit the abnormal standby mode and enter the normal communication mode.
[0008] Optionally, after controlling the LIN communication chip to exit abnormal standby mode and enter normal communication mode, the following steps are also included: Initialize the communication interface of the LIN communication chip.
[0009] Optionally, after initializing the communication interface of the LIN communication chip, the following steps are also included: When the fragrance generator receives a fragrance operation command from the vehicle controller via the communication interface of the LIN communication chip, it controls the fragrance generator to enter the fragrance function mode corresponding to the fragrance operation command.
[0010] Optionally, after initializing the communication interface of the LIN communication chip, the following steps are also included: If no working command is received from the vehicle controller within a preset time range, the LIN communication chip is controlled to enter sleep mode.
[0011] Secondly, this application provides a vehicle-mounted fragrance control device, comprising: The monitoring signal module is used to monitor the working mode of the LIN communication chip if a wake-up signal sent by the vehicle controller is received during the sleep operation of the fragrance generator. The mode switching module is used to control the LIN communication chip to exit the abnormal standby mode and enter the normal communication mode if it is detected that the LIN communication chip is in an abnormal standby mode.
[0012] Thirdly, this application provides a vehicle including the aforementioned in-vehicle fragrance control device.
[0013] Fourthly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described vehicle fragrance control method.
[0014] Fifthly, this application provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the above-described in-vehicle fragrance control method.
[0015] The present invention provides a vehicle fragrance control method, device, equipment, medium, and vehicle. During the dormant operation of the fragrance generator, if a wake-up signal is received from the vehicle controller, the operating mode of the LIN communication chip is monitored. If the LIN communication chip is detected to be in an abnormal standby mode, the LIN communication chip is controlled to exit the abnormal standby mode and enter the normal communication mode, thereby improving the stability and reliability of the vehicle fragrance system.
[0016] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating the state transition logic between the four operating states of the LIN bus communication chip provided in this embodiment of the invention is shown. Figure 2 A flowchart of a vehicle fragrance control method provided by an embodiment of the present invention is shown; Figure 3 A flowchart of another in-vehicle fragrance control method provided by an embodiment of the present invention is shown; Figure 4 This diagram illustrates the structure of a vehicle fragrance control device provided in an embodiment of the present invention. Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention is shown. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0020] To facilitate a better understanding of this application by those skilled in the art, the technical terms used in this application will be briefly introduced below.
[0021] The in-vehicle fragrance system includes a fragrance generator and a fragrance bottle. The fragrance generator comprises an air delivery mechanism, a drive motor, a control circuit board (PCBA), and a housing structure. The fragrance bottle stores the fragrance and records the fragrance type and remaining lifespan information via a built-in storage chip (such as an EEPROM or a DS18B20-type single-bus chip). When the system is operating, the fragrance generator reads the fragrance type and lifespan data stored in the fragrance bottle.
[0022] The PCBA inside the fragrance generator is the control core of the in-vehicle fragrance system, integrating key components such as a microcontroller unit (MCU), a motor drive chip, and a LIN bus communication chip. In this embodiment, the LIN bus communication chip is model NXPTJA1028. This chip is a LIN 2.0 / 2.1 / SAE J2602 and ISO17987-4:2016 (12V) compatible transceiver optimized for automotive electronic systems, and it integrates a low dropout regulator (LDO) to directly provide a stable power supply of 3.3V or 5.0V (maximum 70mA) to the MCU, thereby simplifying the external power supply circuit.
[0023] The LIN bus communication chip supports four operating states: normal mode, standby mode, sleep mode, and off mode. Specifically, for example... Figure 1 The state transition logic between the four operating states shown is as follows: When the LIN bus communication chip is in shutdown mode, if the battery voltage recovers and the temperature is normal, it automatically switches to standby mode. In standby or sleep mode, the MCU pulls the EN pin high, and the chip enters normal mode. In normal mode, when the MCU pulls EN low: if the data transmission pin TXD = H, it enters standby mode; if TXD = L, it enters sleep mode. In sleep mode, when a valid wake-up signal appears on the LIN bus, the LIN bus communication chip automatically switches to standby mode and notifies the MCU through the data output pin RXD. Subsequently, the MCU can pull EN high to resume communication. In any mode, if the battery voltage is low or the LIN bus communication chip is overheated, it is forced to switch to shutdown mode, shut down all functions, and pulls the reset pin RSTN low. Through the LIN bus network, the fragrance system can reliably exchange data with the vehicle's central control unit (such as the body domain controller or entertainment host), receive working instructions (such as start-up, fragrance switching, and concentration adjustment), and provide feedback on operating status and fault information. This allows it to be seamlessly integrated into the vehicle's intelligent control system, ensuring real-time response and low power consumption management of the fragrance system while significantly reducing wiring complexity and manufacturing costs.
[0024] After introducing the technical terms used in this application, the technical solution provided in this application will be described in detail below.
[0025] This application provides a method for controlling in-vehicle fragrance, see below. Figure 2 As shown, the in-vehicle fragrance control method provided in this application embodiment includes at least the following steps: Step 110: During the sleep operation of the fragrance generator, if a wake-up signal is received from the vehicle controller, the working mode of the LIN communication chip is monitored.
[0026] In the embodiments of this application, such as Figure 3 As shown, when the car is locked with the key, the entire vehicle enters sleep mode. After 10 seconds, the upstream controller of the fragrance generator (such as the vehicle controller BCM or central gateway) sends a 0x3C sleep command to the fragrance generator. At the 11th second, the fragrance generator begins to execute the hardware sleep process, which lasts for 70ms (i.e., the time required from the start of sleep execution to full hardware sleep state). If the user wakes up the vehicle by unlocking it with the key or other means within the time window from the 11th second to 11.070 seconds, the fragrance generator receives a wake-up signal from the vehicle controller during its sleep operation. In this case, the operating mode of the LIN communication chip is monitored, that is, the level states of the mode control pin (EN), data transmission pin (TXD), and reset pin (RSTN) of the LIN communication chip are periodically acquired according to a preset detection cycle.
[0027] To accurately identify the operating status of the LIN communication chip, in this embodiment, the preset detection period is 2 seconds. Since the LIN communication chip requires 70ms to fully enter hardware sleep mode after receiving a sleep command, a 2-second detection period is much longer than 70ms, ensuring sufficient time for the LIN communication chip to complete the sleep process and avoiding misjudgment of its status before the sleep process is complete. While shortening the detection period to 500ms is still greater than 70ms, considering real-time factors such as MCU scheduling and interrupt blocking, there is a risk of the LIN communication chip being sampled before it has completed sleep, potentially leading to misjudgment. Furthermore, according to the LIN bus protocol specification (ISO17987), if a slave node does not respond to a master node message within 4 seconds, the master node will report a Diagnostic Trouble Code (DTC) for slave node loss. Extending the detection period to 5 seconds means that a slave node in abnormal standby mode may remain unresponsive for 5 seconds, exceeding the 4-second DTC reporting threshold, causing the master node to misjudge the slave node as lost and report a fault code. Therefore, choosing 2 seconds as the detection cycle ensures that the LIN communication chip has sufficient sleep time to complete, and also reserves sufficient time margin for subsequent anomaly recovery and communication reconstruction, thus avoiding triggering DTC reporting.
[0028] Step 120: If the LIN communication chip is detected to be in abnormal standby mode, control the LIN communication chip to exit the abnormal standby mode and enter the normal communication mode.
[0029] In this embodiment, when the mode control pin of the LIN communication chip is detected to be low, the data transmission pin to be high, and the reset pin to be high, it is determined that the LIN communication chip is in abnormal standby mode. By outputting an effective level to the enable pin of the LIN communication chip, the LIN communication chip exits the abnormal standby mode and enters the normal communication mode.
[0030] Specifically, when the LIN communication chip's mode control pin is detected to be low, the data transmission pin to be high, and the reset pin to be high, a recovery mechanism is immediately triggered. This recovery mechanism involves the LIN communication chip's MCU controlling the mode control pin (EN pin) to switch from low to high, meaning the LIN communication chip switches from abnormal standby mode to normal mode. This operation does not require specific timing requirements, delays, or additional register configuration sequences; simply pulling the EN pin high is sufficient. In normal mode, the LIN communication chip's transceiver is enabled, allowing for normal data transmission and reception. At this time, the pin states of the LIN communication chip are: EN pin high, TXD pin high, and RSTN pin high.
[0031] In order to further restore the data transmission and reception function of the fragrance generator after restoring the hardware communication capability, in this embodiment of the application, after controlling the LIN communication chip to exit the abnormal standby mode and enter the normal communication mode, the communication interface of the LIN communication chip is initialized.
[0032] Specifically, the initialization operation includes, but is not limited to, the following steps: setting the baud rate of LIN communication (e.g., 19.2kbps); configuring the relevant register parameters of the LIN controller (including data length, parity bit, timeout, etc.); clearing the transmit and receive buffers of the communication interface; enabling receive interrupts and error interrupts; and switching the LIN communication chip from initialization mode to normal operation mode.
[0033] In order to properly control the working state of the fragrance generator after the communication interface is initialized, in this embodiment of the application, after initializing the communication interface of the LIN communication chip, when a fragrance working command sent by the vehicle controller is received through the communication interface of the LIN communication chip, the fragrance generator is controlled to enter the fragrance function mode corresponding to the fragrance working command; if no working command is received from the vehicle controller within a preset time range, the LIN communication chip is controlled to enter the sleep mode.
[0034] Specifically, the MCU detects whether it has received a working command from the vehicle controller. If it does, it controls the fragrance generator to enter the fragrance function mode corresponding to that command, thus entering normal operation. If it has not received a working command from the vehicle controller, it controls the LIN communication chip to enter sleep mode after a preset time. This sleep mode is a low-power operating mode that the LIN communication chip enters when there is no working command. In sleep mode, the pin states of the LIN communication chip are: EN pin is low, TXD pin is low, and RSTN pin is high.
[0035] Furthermore, a 5-second timeout is used to control the LIN communication chip to enter sleep mode after a preset time. According to the LIN bus protocol specification, if no valid message is transmitted on the LIN bus for 4 consecutive seconds, the master node will determine that the slave node is lost and report a DTC. Therefore, setting a 5-second timeout (greater than 4 seconds but with a safety margin) allows the fragrance generator to enter a low-power sleep mode promptly when there are no instructions, without triggering a master node DTC report. This 5-second timeout is consistent with the timeout configuration of other LIN slave nodes in the vehicle, ensuring the consistency and coordination of the entire vehicle network.
[0036] To further improve the recovery speed of the fragrance generator within the vulnerable time window and avoid service delays caused by waiting for the 2-second timer to expire, this application embodiment also provides a state snapshot rollback mechanism. The state snapshot rollback mechanism is as follows: before the system enters the hibernation process, the complete system running state is saved in advance; when a wake-up event is detected within the vulnerable time window, there is no need to wait for the timer to expire, and the system is directly rolled back atomically to the stable working state before hibernation based on the saved state snapshot, thereby completing the state recovery at the millisecond level.
[0037] Specifically, when the LIN communication chip enters standby mode, the MCU immediately records the state of all relevant registers, forming a state snapshot. These relevant registers include, but are not limited to: the MCU's internal control registers related to LIN communication, status registers, interrupt enable registers, the LIN communication chip's internal baud rate configuration register, data registers, error status registers, and variables related to the current operating parameters of the fragrance generator (such as the current operating mode, motor speed, and fragrance concentration setting). These registers and variables together constitute a complete picture of the system's operating state before sleep mode, providing sufficient data support for subsequent state rollback. The state snapshot is stored in a reserved area of the MCU's internal RAM, which is not powered off or cleared during sleep mode, thus ensuring the integrity and availability of the snapshot data. If the MCU determines that the current time falls within a vulnerable time window (i.e., the interval from 11s to 11.070s), and a wake-up interrupt (key unlock signal) is triggered within this vulnerable time window, the MCU will not wait for the 2s timer to expire, but will immediately perform the following operations: First, abandon the sleep process that has not yet been completed and terminate the current sleep operation sequence to avoid state conflicts caused by the simultaneous execution of the sleep process and the wake-up process; Second, atomically roll back the state machine of the LIN communication chip to the known stable working state before entering sleep (e.g., the normal distribution state at 10s), that is, based on the recorded state snapshot, restore each register and control parameter to the values saved in the state snapshot. This rollback operation is atomic, that is, either all are successfully restored or none are executed, ensuring the consistency of the system state; Third, immediately and proactively reinitialize the transceiver of the LIN communication chip to restore data communication capability.
[0038] It's important to note that the state rollback operation and transceiver reinitialization are two sequential steps: first, register-level state recovery is completed, returning the chip's internal state machine to a known stable state; then, the transceiver is reinitialized to establish the physical layer data transmission link. Through this mechanism, the system can restore the data link within 1 millisecond, which is approximately three orders of magnitude faster than the traditional approach of waiting for a 2-second timer to expire before restoration. This significantly reduces the service interruption time of the fragrance generator within its vulnerable time window, substantially improving the user experience. Furthermore, the state snapshot rollback mechanism maintains the continuity of the fragrance generator's operating parameters after restoration, avoiding parameter reconfiguration delays caused by state loss, further enhancing the system's response speed after restoration.
[0039] To achieve faster state recovery at the hardware level, this application embodiment also provides a hardware-accelerated wake-up pulse mechanism: utilizing the sensitivity of the LIN communication chip's internal state machine to the EN pin level transition, a hardware-level level pulse directly triggers the chip's internal state machine's reset logic, thereby bypassing the time overhead introduced by software polling and state judgment. When the MCU detects a wake-up signal (i.e., a wake-up interrupt triggered by key unlocking) within the vulnerable time window, the MCU does not wait for the chip's state machine to automatically complete the state transition. Instead, within 100 microseconds, the MCU outputs a very short negative pulse signal to the EN pin of the LIN communication chip. This negative pulse signal is a transition signal where the EN pin level changes from high to low and then back to high, and its pulse width is preferably 50 to 100 microseconds. It should be noted that the width of the negative pulse was carefully selected: if the pulse width is less than 50 microseconds, it may not be sufficient to trigger the effective reset logic of the chip's internal state machine, causing the pulse to be filtered out by the chip's internal debouncing circuit and thus ineffective; if the pulse width is greater than 100 microseconds, although it can still trigger a reset, the long low-level duration may cause the chip to misinterpret it as a normal mode switching instruction, leading to unexpected state transitions. Therefore, the pulse width is preferably between 50 and 100 microseconds, which ensures the reliability of triggering the reset while avoiding the risk of mode misinterpretation caused by an excessively wide pulse. According to the state transition characteristics of the LIN communication chip, when the EN pin receives a level transition, it triggers the reset logic of the chip's internal state machine. This negative pulse forces the LIN communication chip's transceiver to bypass the standby mode logic, directly reset its internal circuitry, and enter normal mode, restarting the LIN transceiver function. Compared to the aforementioned state snapshot rollback mechanism, the hardware-accelerated wake-up pulse mechanism is simpler to implement. It does not rely on register state recording and restoration, but instead achieves state reset through direct hardware intervention. The two mechanisms complement each other; when the state snapshot rollback mechanism fails due to abnormal snapshot data, the hardware-accelerated wake-up pulse mechanism can serve as a fallback solution to wake up the chip. This mechanism can complete chip state reset in the 100-microsecond range, which is more than an order of magnitude faster than recovery methods relying solely on software state machines, making it particularly suitable for applications with extremely high recovery speed requirements. Furthermore, this mechanism does not depend on communication signals on the LIN bus, thus it can still function normally even when the LIN bus physical layer fails, exhibiting high independence and reliability.
[0040] To address the issue of command loss during standby mode, this application embodiment also provides a command caching and replay mechanism that decouples the application layer from the physical layer. This mechanism is functionally independent of and complementary to the aforementioned state snapshot rollback mechanism and hardware accelerated wake-up pulse mechanism. The state snapshot rollback mechanism addresses how to quickly restore the system state, the hardware accelerated wake-up pulse mechanism addresses how to quickly reset the chip, and the command caching and replay mechanism addresses how to compensate for lost upstream commands during chip standby. When the LIN communication chip is in standby mode and cannot send or receive data, any LIN commands sent by the vehicle controller during this period (such as mode switching command 0x35, status query command 0xAA, etc.) will be lost due to transmission failure. If only communication capability is restored without restoring lost commands, the fragrance generator may still be in an incorrect working state after restoration (for example, the vehicle controller issues a "stop fragrance" command during standby, but the chip continues to emit fragrance after restoration because it did not receive the command, resulting in inconsistent states). Therefore, it is necessary to compensate for lost commands during standby while restoring communication. To address this issue, this embodiment decouples the application layer protocol processing from the physical layer LIN transceiver driver. Specifically, the application layer's instruction parsing and execution logic is separated from the physical layer's transceiver driver. The physical layer is only responsible for sending and receiving raw data, while the application layer handles instruction parsing, caching, and replay. The two interact through a standardized data interface. When the LIN communication chip enters standby mode and cannot send or receive data (especially within the vulnerable 70ms time window), the MCU's DMA controller or ring buffer takes over the data reception task of the LIN communication interface. During this period, the raw data of all command frames sent by the vehicle controller via the LIN bus are offline and cached in the MCU's internal buffer according to the received time order. The buffer capacity is at least sufficient to cache 10 LIN instruction frames. The requirement to cache at least 10 instruction frames stems from statistical analysis of potential bus communication volume within the fragile 70ms time window. Within this window, the vehicle controller may issue a maximum of 8 to 10 control instructions (including mode switching, status queries, and concentration adjustments). A cache capacity of 10 or more ensures that, even under the worst communication load conditions, all instructions from the standby period are fully cached without overflow or loss. When the LIN communication chip is forcibly woken up and successfully enters normal mode, the MCU immediately reads the cached instruction data sequentially from the buffer according to the timestamp and replays these cached instructions in the same timing sequence, effectively re-executing the corresponding operations according to the original receiving order. This mechanism effectively solves the problem of inconsistent states caused by instruction loss in standby mode, ensuring that the fragrance generator can accurately execute all control instructions issued by the vehicle controller during standby after communication is restored, avoiding system state deviations due to instruction loss.It is worth noting that the implementation of the instruction caching and replay mechanism depends on the normal operation of the DMA controller. If the DMA controller is prematurely shut down during the sleep process, the mechanism will not work. Therefore, in this embodiment, the power supply and clock of the DMA controller are specifically preserved in the micro-sleep phase 1 to ensure that it is always in a standby state during the vulnerable time window and can take over the data reception task at any time.
[0041] To overcome the shortcomings of the existing coarse-grained hibernation method (which uses either 0 or 1) in terms of insufficient flexibility within fragile time windows, this application also provides a segmented hibernation and step-by-step rollback mechanism: a further refined management based on the aforementioned state snapshot rollback mechanism.
[0042] In this embodiment, the sleep process of the fragrance generator is divided into multiple sequentially executed micro-sleep stages. Specifically, the stages are as follows: Micro-sleep stage 1 involves the MCU shutting down 90% of unnecessary peripherals (such as ADC, PWM output, unused GPIO, etc.) while retaining core communication functions; Micro-sleep stage 2 involves the MCU shutting down the power supply to unnecessary peripherals; Micro-sleep stage 3 involves the MCU shutting down some internal clock sources, reducing the operating frequency; Micro-sleep stage 4 involves the MCU saving the current operating parameters to non-volatile memory; Micro-sleep stage 5 involves the MCU sending a hardware sleep command to the LIN communication chip, preparing to enter sleep mode; Micro-sleep stage 6 involves the LIN communication chip starting the hardware sleep process (i.e., the 70ms sleep process); Micro-sleep stage 7 involves the system fully entering deep sleep mode. Each micro-sleep stage is executed sequentially, and the MCU records the current stage identifier at the beginning of each stage. The seven micro-stages mentioned above are divided based on the different degrees of impact each stage has on the system state: Stages 1 to 3 mainly involve shutting down peripherals and the clock, which have a relatively small impact on the core system state, and rollback only requires restarting the disabled hardware; Stages 4 to 5 involve parameter saving and sending hibernation commands, and their impact on the system state gradually deepens; Stages 6 to 7 have entered the hardware hibernation execution stage, and forcibly interrupting them may lead to uncertainty in the chip state. Therefore, different rollback strategies are required for different stages.
[0043] Based on the above segmented hibernation design, this application adopts the following step-by-step rollback strategy: If a wake-up event is detected during the execution of micro-sleep stages 1, 2, and 3, the MCU directly rolls back one or two stages, that is, cancels the hardware shutdown operations executed in the current stage and the previous stage, quickly restoring to the normal working state. The rollback operation time is on the microsecond level, and there is no need to reinitialize the communication interface. The advantage of this strategy is that stages 1 to 3 have not yet touched the core communication function modules. During the rollback, it is only necessary to re-enable the disabled peripherals and clock to complete the recovery, which is simple and fast. If a wake-up event is detected during the execution of micro-sleep stages 4 and 5, the state recovery is completed according to the aforementioned state snapshot rollback mechanism, based on the recorded state snapshot. Stages 4 to 5 involve parameter saving and the sending of hibernation commands. At this time, the changes in the system state are quite profound. Simply restarting the peripherals is not enough to restore the complete working state. Therefore, it is necessary to rely on the state snapshot for a comprehensive recovery. If a wake-up event is detected during micro-sleep stages 6 and 7 (i.e., the chip has entered the edge of deep sleep), the MCU will not interrupt the current sleep process. Instead, it will record a wake-up flag and immediately execute a short-cycle wake-up-free mode, allowing the LIN communication chip to complete the hardware sleep as planned. Then, immediately after sleep completion, a forced internal wake-up operation will be performed, directly switching the chip from sleep mode to normal mode. The wake-up flag will then be detected, and external commands will be responded to. During the execution of stages 6 and 7, forcibly interrupting the sleep process may cause the chip's internal state machine to be in an uncertain state, leading to unpredictable abnormal behavior. Therefore, allowing wake-up after sleep completion is the safest and most reliable strategy. This mechanism transforms the original coarse-grained sleep method into a rollback-capable, vectorized, fine-grained process, reducing the system risk caused by the fragile 70ms time window.
[0044] To ensure that the system can still be reliably woken up in the event of a complete interruption of LIN bus communication, this application embodiment also provides an independent physical wake-up source and a hard reset mechanism.
[0045] In this embodiment, instead of relying on the LIN bus as the sole wake-up source, the system utilizes the VBAT (battery voltage) monitoring function of the LIN communication chip to use battery voltage changes as an auxiliary wake-up reference. Furthermore, the key unlock signal is directly introduced to the MCU's external interrupt pin via a separate physical signal line, forming a physical wake-up source independent of the LIN bus. This physical signal line is completely isolated from the LIN bus physical layer and is unaffected by the LIN bus state. Even if the LIN bus is short-circuited or the LIN communication chip completely fails, this physical signal line can still normally transmit the wake-up signal to the MCU.
[0046] The MCU is configured with two independent wake-up interrupt sources: the first wake-up source is the wake-up signal on the LIN bus (transmitted through the RXD pin of the LIN communication chip); the second wake-up source is the key unlock signal on the physical GPIO. The two wake-up sources employ a cooperative working strategy: under normal operating conditions, triggering either wake-up source can wake the MCU from sleep mode. When the LIN communication chip locks up during the vulnerable 70ms time window, if the physical GPIO wake-up source triggers a wake-up interrupt, the MCU directly skips all LIN software state checks and forcibly executes a hard reset and forced wake-up operation. Specifically, the MCU immediately pulls the EN pin of the LIN communication chip low and then high, performing a hardware-level forced reset; according to the aforementioned hardware accelerated wake-up pulse mechanism, it outputs a negative pulse signal to the EN pin, forcing the LIN communication chip into normal mode; and it reinitializes the LIN communication interface to restore data transmission and reception capabilities. This mechanism provides a reliable hardware-level wake-up backup channel for the system. Even in extreme cases where the LIN bus is completely paralyzed or the LIN communication chip's state machine is completely locked, the system can still recover by triggering an independent physical wake-up source, greatly improving the system's reliability and robustness.
[0047] Furthermore, in this embodiment, there is no need to reread the fragrance bottle information after communication is restored. Since the MCU is not in sleep mode after power loss, information such as the fragrance type and lifespan of the fragrance bottle is still stored in the MCU's RAM, eliminating the need to reread it via the LIN bus and saving the time consumed by rereading. Compared to traditional recovery schemes that require re-initializing fragrance bottle communication and rereading fragrance information (typically taking tens to hundreds of milliseconds), the solution in this embodiment can immediately return to normal operation after communication is restored, further shortening system service interruption time and improving the user's continuous usage experience.
[0048] Through the combination of the above-mentioned multi-level recovery mechanisms, the embodiments of this application construct a five-level fault-tolerant recovery system, from software state snapshot rollback, hardware accelerated wake-up pulse, instruction caching and replay, segmented hibernation and step-by-step rollback to independent physical wake-up source and hard reset mechanism. Each mechanism is independent of each other and complementary to each other, and can also work together and progress step by step. It can select the optimal recovery path under different fault scenarios, which significantly improves the reliability and user satisfaction of the in-vehicle fragrance system in complex in-vehicle environments.
[0049] To avoid potential misjudgments caused by monitoring the communication status of a single LIN communication chip, and to mitigate the risk of secondary failures due to inappropriate recovery strategies adopted without fully considering the current functional scenario of the system during anomaly recovery, this application embodiment employs a fault-tolerant protection strategy that combines multi-source perception fusion and scenario adaptation. Based on the original communication status monitoring, the execution status of the fragrance function is introduced as an auxiliary judgment criterion, constructing a multi-dimensional anomaly perception and cross-validation mechanism. Furthermore, the optimal recovery strategy is dynamically selected according to the current functional scenario of the system, thereby achieving accurate judgment and adaptive recovery.
[0050] Specifically, in this embodiment, the MCU simultaneously acquires multiple signals, including: status register information from the LIN communication chip, fan speed feedback signal, and atomizer driver operating status signal. Specifically, the fan speed is acquired in real-time through the speed feedback pin of the fan drive unit in the vehicle fragrance system; the atomizer driver operating status signal is determined by detecting the PWM output status or drive current feedback value of the atomization control pin. These multiple signals constitute a complete functional execution status view of the fragrance system, providing a data foundation for subsequent cross-validation.
[0051] The MCU performs cross-validation and hierarchical judgment for abnormal states. When the LIN communication status register indicates communication loss, the MCU does not immediately determine that the chip is in abnormal standby mode. Instead, it comprehensively compares and verifies the LIN communication status with the fan speed feedback signal and the atomizer operating status signal. Specifically, this includes the following scenarios: If the LIN communication status is abnormal, but the fan speed feedback signal is normal (i.e., the speed value is within the expected range) and the atomizer driver is operating normally (i.e., the PWM output or drive current is normal), then the current abnormality is determined to be a false communication loss. That is, the communication bus is affected by a momentary interference, resulting in message loss, but the fragrance generator hardware is still in normal working condition. In this case, a lightweight recovery strategy is executed. The MCU only performs a software reset operation on the LIN protocol stack, such as reinitializing the LIN communication controller registers, clearing the transmit and receive buffers, and resynchronizing the bus timing, without performing a forced hardware reset or power intervention to avoid unnecessary hardware restarts that could disturb the ongoing fragrance generation process. If the LIN communication status is abnormal, and the fan speed feedback signal is also abnormal (e.g., speed is zero or significantly deviates from the target value) and the atomizing driver's operating status is abnormal (e.g., no PWM output or zero drive current), then the current abnormality is determined to be a true standby mode of the chip. This means the LIN communication chip enters an abnormal standby mode due to a conflict between sleep and wake-up events, and the entire fragrance generator malfunctions. In this situation, a hardware-level forced wake-up recovery strategy is executed. The MCU outputs a valid level to the EN pin of the LIN communication chip, forcing the chip to switch from abnormal standby mode to normal communication mode and reinitializing the communication interface to restore data transmission and reception capabilities. If the above three types of signals exhibit a mixed state of partial abnormality and partial normality, the MCU will make a weighted judgment based on the signal confidence level, and select the corresponding recovery strategy after comprehensively judging the abnormality level.
[0052] After completing cross-validation and grading of abnormal states, the MCU dynamically selects the optimal recovery strategy based on the current functional scenario of the fragrance generator. Specifically, this includes the following scenarios: If the system is currently in the fragrance generation process (i.e., the fan is running, the atomizer is working, and fragrance is being output), the EN pin level intervention method is prioritized for recovery. Since the fragrance generation process has high real-time requirements, prolonged interruptions can lead to fragrance interruption or abnormal fragrance concentration. The EN pin intervention method has the fastest response speed (microsecond level), restoring communication capabilities in the shortest time and minimizing the impact on the fragrance generation experience. If the system is currently in a sleep state (i.e., both the fan and atomizer are off, and the system is waiting to enter a low-power mode), the local wake-up pin trigger method is prioritized for recovery. This method does not rely on LIN bus communication; it directly outputs a wake-up signal to the LIN communication chip through the MCU's GPIO pin, resulting in the lowest power consumption and avoiding unnecessary vehicle network activity. If neither of the above two recovery methods successfully restores communication, a LIN bus wake-up signal is used to attempt recovery. The MCU monitors bus activity via the RXD pin of the LIN communication chip. When a wake-up pulse (such as a dominant level lasting more than 250μs) is detected on the bus, the LIN communication chip is triggered to switch from standby mode to normal mode. This method serves as a last resort, providing a final recovery channel when the local recovery mechanism fails.
[0053] Through the above-mentioned fault-tolerant protection strategy of multi-source perception fusion and scene adaptation, the embodiments of this application realize a closed-loop fault-tolerant architecture of perception-judgment-decision, which effectively avoids unnecessary intervention or recovery strategy mismatch caused by misjudgment of a single signal source, greatly improves the accuracy of abnormal recovery and system robustness, and ensures the stable and reliable operation of the fragrance system in complex vehicle environment.
[0054] To prevent the fragrance system from completely losing its communication capability with the vehicle controller and thus being unable to receive control commands or report fault status when the main LIN bus communication path malfunctions, this embodiment constructs a primary and backup dual-channel communication architecture to collaboratively restore the LIN chip's communication capability. An auxiliary communication path is introduced on top of the existing LIN bus communication. When the primary communication path is abnormally blocked, the auxiliary channel can still maintain the system's basic control capabilities and transmit the trigger signals required for LIN chip recovery, forming a cross-channel collaborative recovery mechanism.
[0055] Specifically, an independent GPIO signal line is added as an auxiliary communication channel between the fragrance generator node and the upstream controller (such as the vehicle control module (BCM) or central gateway). This GPIO signal line is a unidirectional or bidirectional general-purpose input / output pin connection, physically independent of the existing LIN bus and not sharing the same communication medium. This ensures that the auxiliary channel can still function normally in the event of a LIN bus physical layer failure or LIN communication chip malfunction. If the vehicle already has a reserved I2C bus and this bus is not under heavy load, it can also be used as an auxiliary communication channel without adding additional physical wiring harnesses. However, it is necessary to ensure that the communication priority of the I2C bus is configured lower than that of the main LIN bus to avoid interfering with existing communication tasks. This auxiliary channel is only activated and used in abnormal recovery scenarios; it remains silent under normal operating conditions and does not participate in regular data communication. This auxiliary channel adopts a lightweight communication protocol design and is only used to transmit critical status and control commands. Critical commands include, but are not limited to: forced wake-up, which instructs the fragrance generator to forcibly switch the LIN communication chip from standby mode to normal mode; status query, which reports the current working mode of the LIN communication chip and the operating status of the fragrance generator to the upstream controller; and emergency stop, which immediately stops the fragrance output to ensure safety when communication abnormalities cause the inability to respond to control commands normally.
[0056] Based on this, the MCU continuously monitors the operating status of the LIN communication chip. When it detects that the LIN communication chip has entered an abnormal standby mode and LIN bus communication is lost, the MCU automatically switches to the auxiliary communication channel and reports the abnormal status to the upstream controller through GPIO signal lines (e.g., transmitting communication loss or chip standby status codes through predefined pulse codes or level change sequences), and at the same time receives the forced wake-up command issued by the upstream controller through the auxiliary channel; Upon receiving a forced wake-up command from the auxiliary channel, the MCU immediately forces the LIN communication chip to exit abnormal standby mode and enter normal communication mode via the EN pin. Specifically, the MCU switches the EN pin of the LIN communication chip from low to high. According to the state transition characteristics of the LIN communication chip, when the EN pin changes from low to high, the chip switches from standby mode to normal mode, the transceiver restarts, and the data transmission and reception capabilities on the LIN bus are restored. Simultaneously, after the upstream controller sends a forced wake-up command through the auxiliary channel, it can also instruct other LIN bus nodes (such as other vehicle slave nodes) to send a wake-up pulse (i.e., a dominant level with a duration exceeding 250μs) on the LIN bus. This wake-up pulse, as an auxiliary wake-up method, is emitted by other normally operating nodes on the LIN bus. When the LIN communication chip of the fragrance generator detects this wake-up pulse on the bus, its internal state machine also responds to the wake-up event, further ensuring the chip recovers from abnormal standby mode. This multi-node collaborative wake-up mechanism can complete the wake-up process with the help of auxiliary signals from other nodes on the bus when a single node fails to recover locally, forming a multi-node collaborative recovery and improving the success rate of wake-up.
[0057] Furthermore, in this embodiment, the auxiliary communication channel adopts a lightweight design, only undertaking abnormal recovery control functions and not transmitting real-time fragrance data (such as fragrance concentration adjustment parameters, fragrance type switching commands, etc.), in order to reduce bandwidth consumption and software complexity. Under normal operating conditions, all fragrance control commands are transmitted through the LIN bus; only when LIN communication fails and the auxiliary channel is activated is a limited set of control commands transmitted through the auxiliary channel. This design ensures that the auxiliary channel will not interfere with or burden the vehicle's existing communication network, while also reducing the complexity of software implementation.
[0058] Through the above-mentioned dual-channel fault-tolerant protection strategy based on redundant communication paths, the embodiments of this application realize that when the main communication path (LIN) is blocked, the backup channel can still maintain the basic control capability and fault reporting capability of the system. The cross-channel collaborative recovery mechanism effectively solves the recovery problem when a single communication path fails, significantly improving the communication reliability and fault tolerance capability of the fragrance system in complex vehicle environments.
[0059] This application provides an embodiment of a vehicle-mounted fragrance control device, see reference. Figure 4 As shown, the in-vehicle fragrance control device provided in this application embodiment includes: The monitoring signal module 410 is used to monitor the working mode of the LIN communication chip if a wake-up signal sent by the vehicle controller is received during the sleep operation of the fragrance generator. The mode switching module 420 is used to control the LIN communication chip to exit the abnormal standby mode and enter the normal communication mode if it is detected that the LIN communication chip is in an abnormal standby mode.
[0060] This application provides a vehicle including the aforementioned in-vehicle fragrance control device.
[0061] It should be noted that the principle of the in-vehicle fragrance control device provided in this application embodiment to solve the technical problem is similar to that of the in-vehicle fragrance control method provided in this application embodiment. Therefore, the implementation of the in-vehicle fragrance control device provided in this application embodiment can refer to the implementation of the in-vehicle fragrance control method provided in this application embodiment, and the repeated parts will not be described again.
[0062] After introducing the in-vehicle fragrance control method and device provided in the embodiments of this application, the electronic device provided in the embodiments of this application will be briefly introduced next.
[0063] See Figure 5 As shown, the electronic device 500 provided in this application embodiment includes at least a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program, it implements the in-vehicle fragrance control method provided in this application embodiment.
[0064] The electronic device 500 provided in this application embodiment may further include a bus 503 connecting different components (including processor 501 and memory 502). The bus 503 represents one or more types of bus structures, including memory bus, peripheral bus, local area bus, etc.
[0065] Memory 502 may include a readable storage medium in the form of volatile memory, such as random access memory (RAM) 5021 and / or cache memory 5022, and may further include read-only memory (ROM) 5023. Memory 502 may also include a program tool 5025 having a set (at least one) of program modules 5024, including but not limited to an operating subsystem, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0066] Processor 501 can be a single processing element or a collective term for multiple processing elements. For example, processor 501 can be a central processing unit (CPU) or one or more integrated circuits configured to implement the in-vehicle fragrance control method provided in the embodiments of this application. Specifically, processor 501 can be a general-purpose processor, including but not limited to CPUs, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0067] Electronic device 500 can communicate with one or more external devices 504 (e.g., keyboard, remote control, etc.), and also with one or more devices that enable a user to interact with electronic device 500 (e.g., mobile phone, computer, etc.), and / or with devices that enable electronic device 500 to communicate with one or more other electronic devices 500 (e.g., router, modem, etc.). This communication can be performed through input / output (I / O) interface 505. Furthermore, electronic device 500 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) through network adapter 506. Figure 5 As shown, network adapter 506 communicates with other modules of electronic device 500 via bus 503. It should be understood that, although... Figure 5 As not shown, other hardware and / or software modules may be used in conjunction with the electronic device 500, including but not limited to microcode, device drivers, redundant processors, external disk drive arrays, Redundant Arrays of Independent Disks (RAID) subsystems, tape drives, and data backup storage subsystems.
[0068] It should be noted that, Figure 5 The electronic device 500 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0069] The computer-readable storage medium provided in the embodiments of this application is described below. The computer-readable storage medium provided in the embodiments of this application stores computer instructions, which, when executed by a processor, implement the in-vehicle fragrance control method provided in the embodiments of this application. Specifically, the computer instructions can be built into or installed in a processor, so that the processor can implement the in-vehicle fragrance control method provided in the embodiments of this application by executing the built-in or installed computer instructions.
[0070] In addition, the in-vehicle fragrance control method provided in this application embodiment can also be implemented as a computer program product, which includes program code. The program code implements the in-vehicle fragrance control method provided in this application embodiment when it runs on a processor.
[0071] The computer program product provided in this application embodiment may employ one or more computer-readable storage media, which may be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. Specifically, more specific examples (a non-exhaustive list) of computer-readable storage media include electrical connections with one or more wires, portable disks, hard disks, RAM, ROM, erasable programmable read-only memory (EPROM), optical fibers, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0072] The computer program product provided in this application embodiment can be a CD-ROM and include program code, and can also run on electronic devices such as computers. However, the computer program product provided in this application embodiment is not limited thereto. In this application embodiment, the computer-readable storage medium can be any tangible medium that contains or stores program code, which can be used by or in conjunction with an instruction execution system, device, or apparatus.
[0073] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.
[0074] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0075] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0076] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of the embodiments of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.
Claims
1. A method for controlling in-vehicle fragrance, characterized in that, include: If a wake-up signal is received from the vehicle controller during the fragrance generator's sleep operation, the operating mode of the LIN communication chip will be monitored. If the LIN communication chip is detected to be in an abnormal standby mode, the LIN communication chip is controlled to exit the abnormal standby mode and enter the normal communication mode.
2. The in-vehicle fragrance control method according to claim 1, characterized in that, The LIN communication chip was detected to be in an abnormal standby mode, including: When the LIN communication chip is detected to be in abnormal standby mode, the mode control pin is at a low level, the data transmission pin is at a high level, and the reset pin is at a high level.
3. The in-vehicle fragrance control method according to claim 1, characterized in that, Controlling the LIN communication chip to exit the abnormal standby mode and enter the normal communication mode includes: By outputting a valid level to the enable pin of the LIN communication chip, the LIN communication chip is made to exit the abnormal standby mode and enter the normal communication mode.
4. The in-vehicle fragrance control method according to claim 1, characterized in that, After controlling the LIN communication chip to exit the abnormal standby mode and enter the normal communication mode, the method further includes: Initialize the communication interface of the LIN communication chip.
5. The in-vehicle fragrance control method according to claim 4, characterized in that, After initializing the communication interface of the LIN communication chip, the process also includes: When the fragrance generator receives a fragrance operation command from the vehicle controller via the communication interface of the LIN communication chip, it controls the fragrance generator to enter the fragrance function mode corresponding to the fragrance operation command.
6. The in-vehicle fragrance control method according to claim 4, characterized in that, After initializing the communication interface of the LIN communication chip, the process also includes: If no working command is received from the vehicle controller within a preset time range, the LIN communication chip is controlled to enter sleep mode.
7. A vehicle-mounted fragrance control device, characterized in that, include: The monitoring signal module is used to monitor the working mode of the LIN communication chip if a wake-up signal sent by the vehicle controller is received during the sleep operation of the fragrance generator. The mode switching module is used to control the LIN communication chip to exit the abnormal standby mode and enter the normal communication mode if it is detected that the LIN communication chip is in an abnormal standby mode.
8. A vehicle, characterized in that, Includes the in-vehicle fragrance control device as described in claim 7.
9. An electronic device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the in-vehicle fragrance control method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the in-vehicle fragrance control method as described in any one of claims 1 to 6.