Communication bus detection method, vehicle-mounted communication device, and electronic device
By enabling interrupt detection in the vehicle communication device to obtain the communication bus status and control the controller's sleep or wake-up, the problem of repeated sleep and wake-up of the controller is solved, the stability of the controller is improved, vehicle energy consumption is reduced, and the user experience is improved.
Patent Information
- Application Number
- CN202510038502.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2045-01-10
AI Technical Summary
In the existing technology, the controller's sleep or wake-up is unstable, which leads to increased vehicle energy consumption and reduced user experience. This is mainly due to the disappearance of network management messages and the appearance of other messages, which cause the controller to repeatedly sleep and wake up.
By enabling interrupt detection in the vehicle communication device, the communication bus status is obtained, and the controller is controlled to sleep or wake up according to the status, ensuring that the controller is kept awake when there is a message transmission, and avoiding repeated sleep and wake-up.
This improved the stability of controller wake-up and sleep modes, reduced vehicle energy consumption, and enhanced the user experience.
Smart Images

Figure CN119484200B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicles, in particular to a communication bus detection method, a vehicle-mounted communication device and an electronic device. BACKGROUND
[0002] The sleep or wake-up of the controller is very important for saving the energy consumption of the vehicle, in the related art, the sleep or wake-up of the controller is mainly based on the controller, the CAN (Controller Area Network) transceiver, the power management module, the level of the related pin is controlled by judging whether the network management message is transmitted on the CAN bus, and then the sleep or wake-up of the controller is controlled.
[0003] However, the above-mentioned method has the risk of repeatedly sleeping or waking up the controller, which leads to poor stability of the sleep or wake-up of the controller, increased energy consumption of the vehicle, and reduced user experience of using the vehicle, for example, when the network management message disappears, the controller enters the sleep mode, if there is other message on the bus at this time, the controller will be woken up, since the received is not the network management message, the controller will enter the sleep. SUMMARY
[0004] The present application aims to at least solve one of the technical problems existing in the prior art.
[0005] To this end, one object of the present application is to provide a communication bus detection method, which reduces the risk of repeatedly sleeping or waking up the controller, improves the stability of the sleep or wake-up of the controller, reduces the energy consumption of the vehicle, and improves the user experience of using the vehicle.
[0006] To this end, a second object of the present application is to provide a vehicle-mounted communication device.
[0007] To this end, a third object of the present application is to provide an electronic device.
[0008] In order to achieve the above-mentioned objects, an embodiment of the first aspect of the present application provides a communication bus detection method for a vehicle-mounted communication device, the method comprising: when the network mode of the vehicle-mounted communication device is determined to be a first sleep mode, starting an interrupt detection function of the vehicle-mounted communication device; acquiring a communication bus state corresponding to the interrupt detection function; and controlling a controller in the vehicle-mounted communication device to sleep or wake up according to the communication bus state.
[0009] According to the communication bus detection method, the interrupt detection function of the vehicle-mounted communication device is used to effectively detect the communication bus state, that is, whether there is message transmission, so that the controller is kept awake all the time when there is message transmission on the communication bus, precise control of the wake-up or sleep of the controller is realized, repeated sleep and wake-up of the controller caused by different transmission messages on the communication bus is avoided, the risk of repeated wake-up or sleep of the controller is reduced, the stability of the wake-up or sleep of the controller is improved, the energy consumption of the vehicle is reduced, and the user experience of using the vehicle is improved.
[0010] In some embodiments, obtaining the communication bus state corresponding to the interrupt detection function comprises: after the interrupt detection function is closed, if an interrupt flag bit is not detected within a first preset time, determining that the communication bus is in an idle state.
[0011] In some embodiments, controlling the controller in the vehicle-mounted communication device to sleep or wake up according to the communication bus state comprises: when the communication bus state is an idle state, controlling the controller to sleep.
[0012] In some embodiments, obtaining the communication bus state corresponding to the interrupt detection function comprises: after the interrupt detection function is closed, if an interrupt flag bit is detected within a first preset time, determining that the communication bus is in an occupied state.
[0013] In some embodiments, controlling the controller in the vehicle-mounted communication device to sleep or wake up according to the communication bus state comprises: when the communication bus state is an occupied state, controlling the controller to wake up.
[0014] In some embodiments, controlling the controller to sleep comprises: controlling a communication transceiver in the vehicle-mounted communication device to enter a second sleep mode; after a time in the second sleep mode reaches a second preset time, controlling the communication transceiver to enter a third sleep mode; and controlling a first set pin of the communication transceiver in the third sleep mode to be at a low level to control the controller to sleep after being powered off.
[0015] In some embodiments, after the controller is controlled to wake up, the method further comprises: resetting the interrupt flag bit.
[0016] In some embodiments, detecting the interrupt flag bit comprises: determining that a second set pin of the controller has a level jump.
[0017] In some embodiments, controlling the controller to wake up comprises: receiving a first message; adjusting and converting the first message to output a digital signal; controlling the communication transceiver to switch from the third sleep mode to a set mode according to the digital signal; and after a power management module of the vehicle-mounted communication device receives a high-level signal in the set mode, controlling the controller to wake up.
[0018] To achieve the above object, the embodiment of the second aspect of the present application proposes a vehicle-mounted communication device, comprising: a communication transceiver; a communication bus connected with the communication transceiver; a controller connected with the communication transceiver, configured to determine a communication bus state corresponding to an interrupt detection function of the vehicle-mounted communication device after the interrupt detection function is turned on, and to hibernate or wake up according to the communication bus state; and a power management module connected with the controller and the communication transceiver respectively, configured to supply power for the controller and the communication transceiver.
[0019] According to the vehicle-mounted communication device of the embodiment of the present application, the interrupt detection function of the vehicle-mounted communication device is used to effectively detect the communication bus state, i.e., whether there is message transmission, so that the controller is kept awake all the time when there is message transmission on the communication bus, precise control of the wake-up or hibernation of the controller is realized, the controller is prevented from repeatedly hibernating and waking up due to the transmission of different messages on the communication bus, the risk of the controller being repeatedly woken up or hibernated is reduced, the stability of the wake-up or hibernation of the controller is improved, the energy consumption of the vehicle is reduced, and the user's driving experience is improved.
[0020] To achieve the above object, the embodiment of the third aspect of the present application proposes an electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a communication bus detection program executable by the at least one processor, and the communication bus detection program, when executed by the at least one processor, causes the at least one processor to perform the communication bus detection method as described in the above embodiment.
[0021] According to the electronic device of the embodiment of the present application, the interrupt detection function of the vehicle-mounted communication device is used to effectively detect the communication bus state, i.e., whether there is message transmission, so that the controller is kept awake all the time when there is message transmission on the communication bus, precise control of the wake-up or hibernation of the controller is realized, the controller is prevented from repeatedly hibernating and waking up due to the transmission of different messages on the communication bus, the risk of the controller being repeatedly woken up or hibernated is reduced, the stability of the wake-up or hibernation of the controller is improved, the energy consumption of the vehicle is reduced, and the user's driving experience is improved.
[0022] Additional aspects and advantages of the present application will be made apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0023] The above and / or additional aspects and advantages of the present application will become apparent and be readily understood by considering the following detailed description, including the accompanying drawings, in which:
[0024] Figure 1 is a block diagram of an in-vehicle communication device according to an embodiment of the present application;
[0025] Figure 2 is a flowchart of a communication bus detection method according to an embodiment of the present application;
[0026] Figure 3 is a flowchart of a communication bus detection method according to another embodiment of the present application;
[0027] Figure 4 is a block diagram of an in-vehicle communication device according to another embodiment of the present application;
[0028] Figure 5 is a block diagram of an electronic device according to an embodiment of the present application.
[0029] Reference Signs:
[0030] in-vehicle communication device 105;
[0031] controller unit 80; CAN transceiver 81; power management system 82; CANH bus 84; CANL bus 83;
[0032] controller 100; communication transceiver 101; communication bus 102; power management module 103;
[0033] electronic device 90;
[0034] processor 92; memory 93. DETAILED DESCRIPTION
[0035] The embodiments described with reference to the drawings are exemplary, and the embodiments of the present application are described in detail below.
[0036] With the increasing emphasis on environmental protection and low carbon, the development pace of new energy vehicles has also accelerated significantly. The relevant technologies in the fields of automobiles, energy, transportation, and information communication are accelerating integration, and electrification, networking, and intelligence have become the trend and trend of the automobile industry. New energy vehicle technologies are emerging like mushrooms, such as:
[0037] Application No. CN202410658157.7, Publication No. CN118238797B, Invention Name: New Energy Vehicle Energy Intelligent Management System, Control Method and Related Equipment; Application No. CN202410672579.X, Publication No. CN118597091A, Invention Name: New Energy Vehicle Energy Intelligent Management Method, System and Related Equipment; both describe hybrid technology dominated by electricity, with multiple advantages such as speed, economy, quietness, smoothness, and greenness.
[0038] CN202211678720.4, CN117382629B, vehicle power control method, device, medium, vehicle controller and vehicle; CN202311164098.X, CN116890770B, vehicle control system, method and vehicle; CN202311170393.6, CN117533292B, vehicle control system, control method, controller and vehicle; all describe a new energy power system with four wheel edge motors as the core, which greatly improves the safety and power of new energy vehicles.
[0039] More and more controllers are deployed to the automotive electronic and electrical architecture, which means that more functions can be realized, but also means more energy consumption. In addition, the increasingly complex network topology poses great challenges to how controllers work together. In order to save energy and reduce power consumption, some controllers that do not need to work at some time should be hibernated; but at some time, the controller that needs to be hibernated should wake up immediately to participate in work. Therefore, a control mechanism or strategy is needed to make the controller nodes in the communication topology network hibernate and wake up in order, so that the functions of the vehicle can be guaranteed while saving as much power as possible.
[0040] In the related art, taking the hibernation or wake-up of an MCU (Microcontroller Unit) as an example, the hibernation or wake-up of the MCU can be mainly realized by judging whether there is a network management message. When there is no network management message on the bus, and the MCU has no work demand, the network management module will set the network mode to the hibernation mode. At this time, the power management module detects that the network mode is in the hibernation mode, and controls the MCU to enter the hibernation mode. The hibernation process first changes the STB (Set-Top Box) and EB (state pin) levels of the CAN transceiver to make it enter the hibernation mode. After the transceiver enters the hibernation mode, the INH (Inhibit) pin level is pulled low, and after the pin level is low, the power management module is notified. The power management module controls the MCU to enter the power-down process and enter the hibernation mode.
[0041] When the MCU is in the hibernation mode, if a frame of message is transmitted on the bus at this time, the CAN transceiver receives the CAN message transmitted by the bus and pulls the INH pin high. After the pin level is high, the power management module is notified. After the power management module detects that the INH is high, the MCU is powered, and the MCU enters the wake-up process. At this time, if the network management module detects that the transmitted message is a network management message, it can switch the network mode to the working mode. If it is other message, the network mode is switched to the hibernation mode again.
[0042] However, the above-mentioned method has the risk of repeatedly putting the controller into sleep or wake-up mode. When the network management message disappears, the MCU will be powered off and enter sleep mode. At this time, if there is other message on the bus, the transceiver will pull up the INH pin level. After the power management module detects the high level, it controls the MCU to enter the wake-up process. However, since the received message is not a network management message, the MCU will immediately enter the sleep process and switch the transceiver to sleep mode, resulting in poor stability of the controller sleep or wake-up, increased energy consumption of the vehicle, and reduced user experience.
[0043] Therefore, by using the interrupt detection function of the vehicle-mounted communication device, the communication bus detection method of the embodiment of the present application effectively detects the state of the communication bus, i.e., whether there is message transmission, so that the controller always remains awake when there is message transmission on the communication bus, thereby realizing precise control of the wake-up or sleep of the controller, avoiding repeated sleep and wake-up of the controller due to different transmission messages on the communication bus, reducing the risk of repeated wake-up or sleep of the controller, improving the stability of the wake-up or sleep of the controller, reducing the energy consumption of the vehicle, and improving the user experience.
[0044] The above-mentioned communication bus detection method is based on the sleep or wake-up control of the vehicle-mounted communication device. The vehicle-mounted communication device is described below.
[0045] First, refer to Figure 1 the block diagram of the vehicle-mounted communication device of the embodiment of the present application.
[0046] As Figure 1 shown, it is the block diagram of the vehicle-mounted communication device of one embodiment of the present application. The vehicle-mounted communication device 105 of the embodiment of the present application includes a controller unit 80, a CAN transceiver 81, a power management system 82, a CANH (Controller Area Network High) bus 84, and a CANL (Controller Area Network Low) bus 83.
[0047] The controller unit 80 has RXD (Receive Data), TXD (Transmit Data) and IO (Input / Output) ports; the CAN transceiver 81 has RXD, TXD, CANL, CANH, STB, EB and INH pins; and the power management system 82 has an IO port. The CAN transceiver 81 receives messages sent by the CANH bus 84 and the CANL bus 83 through the CANH and CANL pins; the sleep state change of the CAN transceiver 81 causes the level of the INH pin to change; the power management system 82 controls the power-on and wake-up of the controller unit 80 according to the level of the INH pin; and the state switching of the CAN transceiver 81 is controlled through the STB and EB pins.
[0048] Based on the vehicle-mounted communication device described above, the following describes Figures 1-3 a communication bus detection method of an embodiment of the application.
[0049] As Figure 2 shown, a flowchart of a communication bus detection method of an embodiment of the application. The communication bus detection method of the embodiment of the application is used in a vehicle-mounted communication device, and the method includes at least steps S1-S3.
[0050] In step S1, when the network mode of the vehicle-mounted communication device is determined to be a first sleep mode, the interrupt detection function of the vehicle-mounted communication device is enabled.
[0051] In the embodiment, as Figure 1 shown, the first sleep mode is, for example, a Bus Sleep (low-power-consumption state) mode; the interrupt detection function is, for example, the edge detection interrupt of the RXD pin; when there is no network management message on the CAN bus (the CANH bus 84 and the CANL bus 83), the network management module sets the network mode to the Bus Sleep mode after a period of time; when the power management system 82 finds that the network mode is the Bus Sleep mode, the edge detection interrupt of the RXD pin is enabled; the jump of the RXD pin is detected; when the jump occurs, the controller unit 80 is triggered to enter a specific interrupt; a flag bit is set in the interrupt address; the interrupt flag bit triggered by the edge detection is polled by the software task of the controller unit 80; the counter is incremented by 1 in the interrupt processing function every time the interrupt is triggered; and the interrupt is disabled, to prepare for judging the state of the communication bus according to the interrupt detection function.
[0052] In step S2, the state of the communication bus corresponding to the interrupt detection function is acquired.
[0053] In the embodiment, as Figure 1As shown, the communication bus, such as the CAN bus (CANH bus 84 and CANL bus 83), starts timing from the moment the RXD edge detection interrupt is enabled. A time period for checking the counter is set according to requirements and experimental factors to detect interrupts triggered within this period, for example, 4 seconds. Four seconds after enabling the RXD edge detection interrupt, the counter is checked. If the counter counts, it indicates an interrupt occurred within 4 seconds. This means the CAN bus is not yet idle, and the controller unit 80 cannot enter sleep mode. If the counter does not count, it means no interrupt occurred within 4 seconds. This means the CAN bus is idle, with no messages being sent and no interrupts occurring. If interference occurs and the power-down conditions are met, the controller unit 80 can enter a sleep state. The time period for checking the counter can be increased or decreased as needed, and the number of times the counter is checked can be set according to requirements and the number of times the interrupt detection function is enabled. The interrupt detection function can also be enabled multiple times as needed. It is understood that the longer the counter viewing time period, the more times the counter viewing time period is set, and the more times the interrupt detection function is enabled, the more reliable and accurate the interrupt detection results will be. This better avoids interference from the communication bus, making the obtained communication bus status results more reliable and accurate, reducing the risk of the controller being repeatedly put into sleep or woken up, and improving the stability of the controller's sleep or wake-up.
[0054] Step S3: Control the controller in the vehicle communication device to go into sleep or wake up according to the communication bus status.
[0055] In an embodiment, such as Figure 1 As shown, for example, if the communication bus status indicates that the CAN bus is not idle, then the controller unit 80 cannot enter sleep mode. Specifically, if the communication bus status is not awake before interrupt detection, the controller is awakened; if the communication bus status is awake before interrupt detection, it remains awake. If the communication bus status indicates that the CAN bus is idle, then the controller unit 80 enters sleep mode. By controlling the controller in the vehicle communication device to sleep or wake up through the communication bus status, precise wake-up or sleep mode can be achieved, reducing the risk of the controller being repeatedly woken up or put into sleep mode, improving the stability of controller wake-up or sleep mode, reducing vehicle energy consumption, and enhancing the user's driving experience.
[0056] According to the control method of the vehicle, when the network mode of the vehicle-mounted communication device is determined as the first sleep mode, the interrupt detection function of the vehicle-mounted communication device is started, the communication bus state corresponding to the interrupt detection function is obtained, the obtained communication bus state is more reliable and accurate, and the controller in the vehicle-mounted communication device is controlled to sleep or wake up according to the communication bus state, so that the controller can be accurately woken up or put to sleep, the risk of repeatedly waking up or putting the controller to sleep is reduced, the stability of waking up or putting the controller to sleep is improved, the energy consumption of the vehicle is reduced, and the user experience of using the vehicle is improved.
[0057] In some embodiments, obtaining the communication bus state corresponding to the interrupt detection function comprises: after the interrupt detection function is turned off, if the interrupt flag bit is not detected within the first preset time, it is determined that the communication bus is in an idle state.
[0058] In an embodiment, as shown in Figure 1 , the first preset time is the time counted from the start of the edge detection of the RXD to detect the interrupt, a time period for checking the counter is set according to the requirements and experiments and other factors to detect the interrupt triggered in the interrupt start time period, and the time period is set to 4s; when the controller unit 80 does not receive the network management message and has no work demand, if the CAN transceiver 81 does not receive other messages of the bus within a period of time, the RXD pin level of the CAN transceiver 81 will always be in a high level and will not be toggled, so the controller unit 80 will not be triggered to enter a specific interrupt; after the network management module switches the network mode to the Bus Sleep mode, the power management module 103 detects the Bus Sleep mode, the edge detection of the RXD is turned on to detect the interrupt, the RXD pin is toggled, the controller unit 80 is triggered to enter a specific interrupt when the toggle occurs, a flag bit is set in the interrupt address, the interrupt flag bit triggered by the edge detection is polled by the software task of the controller unit 80, the counter is incremented by 1 in the interrupt processing function every time the interrupt is triggered, and the interrupt is turned off; within 4s after the edge detection of the RXD is turned on, the count of the counter is checked, if there is no count, it indicates that the interrupt flag bit is not detected within 4s, that is, no interrupt occurs, and it can be understood that no interrupt occurrence indicates that the CAN bus is idle, no message is sent, and no interference occurs, so it is determined that the communication bus is in an idle state, and preparation is made for controlling the controller to sleep according to the idle state of the communication bus.
[0059] In some embodiments, the controller in the vehicle-mounted communication device is controlled to sleep or wake up according to the communication bus state, comprising: when the communication bus state is an idle state, the controller is controlled to sleep.
[0060] In an embodiment, as shown in Figure 1As shown, when it is determined that the communication bus is in an idle state, the power management system 82 controls the pin level on the CAN transceiver 81 through the IO port, controls the controller to sleep, so as to realize precise sleep controller, reduce the risk of repeatedly sleeping controller, improve the stability of the controller to sleep, and thus reduce the energy consumption of the vehicle and improve the user's driving experience.
[0061] In some embodiments, the communication bus state corresponding to the interrupt detection function is acquired, including: after the interrupt detection function is closed, if the interrupt flag bit is detected within the first preset time, it is determined that the communication bus is in an occupied state.
[0062] In an embodiment, as shown in Figure 1 The first preset time is the time from the start of the edge detection of RXD to the detection of the interrupt, and a viewing counter time period is set according to the requirements and experiments and other factors to detect the interrupt triggering condition in the interrupt start time period, which is set to 4s. After the network management module switches the network mode to the Bus Sleep mode, the power management system 82 detects the Bus Sleep mode, opens the edge detection of RXD, detects the jump of the RXD pin, and when the jump occurs, triggers the controller unit 80 to enter a specific interrupt. A flag bit is set in the interrupt address, and the controller unit 80 software task polls the interrupt flag bit triggered by the edge detection. The counter is incremented by 1 in the interrupt processing function every time the interrupt is triggered, and the interrupt is closed. Within 4s after the edge detection of RXD is opened, the counter is checked. If there is a count, it means that the interrupt flag bit has been detected within 4s, that is, an interrupt has occurred. It can be understood that the occurrence of the interrupt means that the CAN bus is not idle, so it is determined that the communication bus is in an occupied state, and preparation is made for controlling the controller to wake up according to the occupied state of the communication bus.
[0063] In some embodiments, the controller in the vehicle-mounted communication device is controlled to sleep or wake up according to the communication bus state, including: when the communication bus state is in an occupied state, the controller is controlled to wake up.
[0064] In an embodiment, as shown in Figure 1 When it is determined that the communication bus state is in an occupied state, the message received by the CAN transceiver 81 is processed, the mode of the CAN transceiver 81 is converted, and finally the controller unit 80 is controlled to wake up by the power management system 82, so as to realize precise wake-up controller, reduce the risk of repeatedly waking up the controller, improve the stability of the controller to wake up, and thus reduce the energy consumption of the vehicle and improve the user's driving experience.
[0065] In some embodiments, the method of controlling the controller to sleep comprises: controlling the communication transceiver in the vehicle-mounted communication device to enter a second sleep mode; after the time in the second sleep mode reaches a second preset time, controlling the communication transceiver to enter a third sleep mode; and controlling a first set pin of the communication transceiver in the third sleep mode to be at a low level to control the controller to sleep after being powered off.
[0066] In embodiments, as shown in Figure 1 the communication transceiver is, for example, a CAN transceiver 81; the second sleep mode is, for example, a Go to Sleep mode, which is a specific operating mode of the CAN transceiver, and when the node on the CAN bus does not need to communicate, it can enter this mode to reduce power consumption, in this mode, the CAN transceiver usually does not send or receive CAN messages, unless there is a specific wake-up signal trigger; the third sleep mode is, for example, a sleep mode, which is a deeper low-power state of the CAN transceiver, compared with the Go to Sleep mode, it may have lower power consumption and stricter wake-up conditions, in the Sleep mode, the power consumption of the CAN transceiver is further reduced, and it can usually only be awakened by a specific wake-up signal (such as a message on the CAN bus); the second preset time is counted from when the CAN transceiver enters the second sleep mode, and the time from entering the third sleep mode is set to 5us to 50us; the controller is, for example, a controller unit 80; the first set pin is, for example, an INH pin, which is a control external voltage regulator to achieve the wake-up and sleep management of the ECU.
[0067] The power management module will pull the STB pin of the CAN transceiver 81 to a low level and the EN pin to a high level through the IO port, and the CAN transceiver 81 will enter the Go to Sleep mode, preparing for entering the third sleep mode; after the CAN transceiver enters the Go to Sleep mode, after 5us to 50us, the CAN transceiver 81 will automatically enter the Sleep mode, preparing for controlling the controller to sleep; the CAN transceiver 81 will jump the INH pin of the CAN transceiver 81 from a high level to a low level and keep it at a low level in the Sleep mode, because the INH pin of the CAN transceiver 81 is only at a low level in the Sleep mode, and it is at a high level in other modes, so the power-on and power-off of the controller unit 80 can be indirectly controlled through the level of the INH pin, when the power management system 82 detects that the INH pin is at a low level, it will cut off the power supply of the controller unit 80, so that the controller unit 80 enters the power-off process, and after the controller unit 80 is powered off, it enters the sleep mode, waiting for the next wake-up process, to reduce the energy consumption of the vehicle and improve the user's driving experience.
[0068] In some embodiments, after the controller is controlled to wake up, the method further comprises resetting the interrupt flag bit.
[0069] In an embodiment, such as Figure 1 As shown, after the controller unit 80 is woken up, when other nodes do not send network management messages but only send other messages to the communication bus such as the CAN bus (CANH bus 84 and CANL bus 83), an interrupt detection function is used at the RXD pin of the controller unit 80 to detect the transition of the RXD pin. When a transition occurs, the controller unit 80 is triggered to enter a specific interrupt. A flag bit is set in the interrupt address. After the controller unit 80 polls and detects the flag bit, it will not immediately enter sleep mode after being woken up, but will remain in the wake-up state and reset the flag bit. At this time, the CAN transceiver 81 will not be switched to Sleep mode by the controller unit 80 due to the lack of network management messages, thus reducing the risk of the controller being repeatedly put to sleep or woken up and improving the stability of the controller's sleep or wake-up.
[0070] In some embodiments, detecting an interrupt flag bit includes: determining that a level transition has occurred on the second setting pin of the controller.
[0071] In an embodiment, such as Figure 1 As shown, the second setting pin, such as the RXD pin, is the data receiving pin of the CAN transceiver. It is responsible for receiving data signals from the CAN bus and converting these signals into level signals suitable for the controller to process. During CAN communication, the RXD pin continuously monitors the signal changes on the CAN bus. When a valid data frame is received, an interrupt is triggered to notify the controller that data has arrived so that the controller can read and process this data in a timely manner. A flag bit is set in the interrupt address of the interrupt detection to detect the transition of the RXD pin of the controller unit 80. When a transition occurs, the controller unit 80 is triggered to enter a specific interrupt. The controller unit 80 polls the task detection flag bit to determine the status of the communication bus.
[0072] In some embodiments, the controller wake-up process includes: receiving a first message; adjusting and converting the first message to output a digital signal; controlling the communication transceiver to switch from a third sleep mode to a setting mode according to the digital signal; and in the setting mode, the controller wakes up after the power management module of the vehicle communication device receives a high-level signal.
[0073] In an embodiment, such as Figure 3As shown, the first message is, for example, a message sent by the CAN bus (CANH bus 84 and CANL bus 83); the Normal (working) mode is when the CAN transceiver can send and receive CAN messages normally, that is, the transceiver is in a fully working state; the setting mode is, for example, the Standby mode, which is between the Normal mode and the third sleep mode (e.g., sleep mode). In this mode, the transceiver may still keep some functions active in order to quickly respond to the wake-up signal and return to the normal working mode; the power management module is, for example, the power management system 82; the controller is, for example, the controller unit 80; and the communication transceiver is, for example, the CAN transceiver 81.
[0074] When the controller wakes up, the CAN transceiver 81 receives the message sent by the CAN bus, converts and adjusts the signal between the CAN controller and the CAN bus physical layer, converting the differential signal of the CAN bus into the digital signal of the CAN controller and outputting it, preparing for the CAN transceiver 81 to switch modes. The CAN transceiver 81 will switch from Sleep mode to Standby mode. The INH pin of the CAN transceiver 81 will switch from low level to high level, and the connection relationship between the INH pin and the IO port on the power management system 82 will be communicated to the power management module with the WAKE_MCU_PMIC (signal to wake up the controller) signal, preparing for the controller to wake up. After the hardware circuit on the power management system 82 detects that INH is high level, it powers on the controller unit 80 and controls the controller unit 80 to enter the wake-up process. After the controller unit 80 is initialized by power-on, it will pull the STB and EB pins high through the IO port to switch the CAN transceiver 81 from Standby mode to Normal mode. In this mode, CAN messages can be sent and received normally, thus completing the controller wake-up.
[0075] The following is for reference. Figure 3 The communication bus detection method of this invention will be described in detail below.
[0076] like Figure 4 The diagram shown is a flowchart of a communication bus detection method according to another embodiment of the present invention. The communication bus detection method of this embodiment includes at least steps S10-S30.
[0077] Step S10, Begin.
[0078] Step S11: Determine whether the network mode of the vehicle communication device is the first sleep mode. If yes, proceed to step S13; otherwise, proceed to step S12.
[0079] Step S12, End.
[0080] Step S13: Enable the interruption detection function of the vehicle communication device.
[0081] Step S14, the communication bus state corresponding to the interrupt detection function is acquired.
[0082] Step S15, the interrupt detection function is closed.
[0083] Step S16, it is judged whether the interrupt flag bit is not detected within the first preset time. If yes, step S24 is executed; otherwise, step S17 is executed.
[0084] Step S17, it is determined that the second setting pin of the controller appears a level jump.
[0085] Step S18, it is determined that the communication bus is in the occupied state.
[0086] Step S19, the first message is received.
[0087] Step S20, the first message is adjusted and converted, and the digital signal is output.
[0088] Step S21, the communication transceiver is switched from the third sleep mode to the setting mode according to the digital signal.
[0089] Step S22, the power management module of the vehicle-mounted communication device receives the high level signal, and controls the controller to wake up.
[0090] Step S23, the interrupt flag bit is reset.
[0091] Step S24, it is determined that the communication bus is in the idle state.
[0092] Step S25, the communication transceiver in the vehicle-mounted communication device is controlled to enter the second sleep mode.
[0093] Step S26, it is judged whether the time in the second sleep mode reaches the second preset time. If yes, step S28 is executed; otherwise, step S27 is executed.
[0094] Step S27, the third sleep mode is not entered.
[0095] Step S28, the communication transceiver is controlled to enter the third sleep mode.
[0096] Step S29, the first setting pin of the communication transceiver is low.
[0097] Step S30, the controller is controlled to sleep after power off.
[0098] According to the communication bus detection method of the embodiment of the present application, the interrupt detection function of the vehicle-mounted communication device is used to effectively detect the communication bus state, that is, whether there is message transmission, so that the controller is always kept awake when there is message transmission on the communication bus, precise control of the wake-up or sleep of the controller is realized, the controller is prevented from repeatedly sleeping and waking up due to different transmission messages on the communication bus, the risk of the controller being repeatedly woken up or put to sleep is reduced, the stability of the wake-up or sleep of the controller is improved, the energy consumption of the vehicle is reduced, and the user's driving experience is improved.
[0099] Reference will be made to Figure 4 The vehicle-mounted communication device of the embodiment of the present application is described.
[0100] As Figure 5 shown, it is a block diagram of the vehicle-mounted communication device of another embodiment of the present application. The vehicle-mounted communication device 105 of the embodiment of the present application comprises a communication transceiver 101, a communication bus 102 connected with the communication transceiver 101, a controller 100 connected with the communication transceiver 101, used to determine the communication bus state corresponding to the interrupt detection function of the vehicle-mounted communication device after the interrupt detection function is turned on, and put to sleep or wake up according to the communication bus state, and a power management module 103 connected with the controller 100 and the communication transceiver 101 respectively, used to supply power for the controller 100 and the communication transceiver 101.
[0101] According to the vehicle-mounted communication device 105 of the embodiment of the present application, when the network mode of the vehicle-mounted communication device 105 is determined to be the first sleep mode, the interrupt detection function of the vehicle-mounted communication device is turned on, the communication bus state corresponding to the interrupt detection function is obtained, the obtained communication bus state is more reliable and accurate, and the controller in the vehicle-mounted communication device is controlled to sleep or wake up according to the communication bus state, so as to precisely wake up or put to sleep the controller, reduce the risk of the controller being repeatedly woken up or put to sleep, improve the stability of the wake-up or sleep of the controller, reduce the energy consumption of the vehicle, and improve the user's driving experience.
[0102] Reference will be made to Figure 5 The electronic device of the embodiment of the present application is described.
[0103] As shown, it is a block diagram of the electronic device of one embodiment of the present application. The electronic device 90 of the embodiment of the present application comprises at least one processor 92 and a memory 93 connected in communication with the at least one processor 92, wherein the memory 93 stores a communication bus detection program executable by the at least one processor 92, and the communication bus detection program, when executed by the at least one processor 92, causes the at least one processor 92 to perform the communication bus detection method of the above-mentioned embodiment.
[0104] The electronic device 90 according to the embodiment of the present application uses the interrupt detection function of the vehicle-mounted communication device to effectively detect the communication bus state, that is, whether there is a message transmission, so that the controller is always kept awake when there is a message transmission on the communication bus, precise control of the wake-up or sleep of the controller is achieved, repeated sleep and wake-up of the controller caused by different transmission messages on the communication bus is avoided, the risk of repeated wake-up or sleep of the controller is reduced, the stability of the wake-up or sleep of the controller is improved, the energy consumption of the vehicle is reduced, and the user's driving experience is improved.
[0105] In some embodiments, the processor 92 acquires the communication bus state corresponding to the interrupt detection function, including: after the interrupt detection function is turned off, if the interrupt flag bit is not detected within the first preset time, it is determined that the communication bus is in an idle state.
[0106] In some embodiments, the processor 92 controls the controller in the vehicle-mounted communication device to sleep or wake up according to the communication bus state, including: when the communication bus state is in an idle state, the controller is controlled to sleep.
[0107] In some embodiments, the processor 92 acquires the communication bus state corresponding to the interrupt detection function, including: after the interrupt detection function is turned off, if the interrupt flag bit is detected within the first preset time, it is determined that the communication bus is in an occupied state.
[0108] In some embodiments, the processor 92 controls the controller in the vehicle-mounted communication device to sleep or wake up according to the communication bus state, including: when the communication bus state is in an occupied state, the controller is controlled to wake up.
[0109] In some embodiments, the processor 92 controls the controller to sleep, including: controlling the communication transceiver in the vehicle-mounted communication device to enter a second sleep mode; after the time in the second sleep mode reaches a second preset time, controlling the communication transceiver to enter a third sleep mode; and the first set pin of the communication transceiver in the third sleep mode is at a low level, so as to control the controller to sleep after being powered off.
[0110] In some embodiments, after the processor 92 controls the controller to wake up, it further includes: resetting the interrupt flag bit.
[0111] In some embodiments, the processor 92 detects the interrupt flag bit, including: determining that the second set pin of the controller appears a level jump.
[0112] In some embodiments, the processor 92 controls the controller to wake up, including: receiving a first message; adjusting and converting the first message to output a digital signal; controlling the communication transceiver to switch from the third sleep mode to the set mode according to the digital signal; and in the set mode, after the power management module of the vehicle-mounted communication device receives a high level signal, the controller is controlled to wake up.
[0113] The electronic device 90 according to the embodiment of the present application uses the interrupt detection function of the vehicle-mounted communication device to effectively detect the state of the communication bus, i.e., whether there is a message transmission, so that the controller is always kept awake when there is a message transmission on the communication bus, thereby realizing precise control of the wake-up or sleep of the controller, avoiding repeated sleep and wake-up of the controller caused by different transmission messages on the communication bus, reducing the risk of repeated wake-up or sleep of the controller, improving the stability of the wake-up or sleep of the controller, reducing the energy consumption of the vehicle, and improving the user experience of using the vehicle.
[0114] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "exemplary embodiment", "example", "specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the exemplary description of the above terms does not necessarily mean the same embodiment or example.
[0115] Although the embodiments of the present application have been shown and described, those skilled in the art can understand that various changes, modifications, replacements and variations can be made to the embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the claims and their equivalents.
Claims
1. A communication bus detection method, characterized in that, For use in a vehicle-mounted communication device, the method includes: When the network mode of the vehicle communication device is determined to be the first sleep mode, the interrupt detection function of the RXD pin of the controller unit in the vehicle communication device is enabled. Obtaining the interrupt flag bit within a first preset time period in the interrupt detection function and determining the corresponding communication bus status includes: after disabling the interrupt detection function, if no interrupt flag bit is detected within the first preset time period, determining that the communication bus is in an idle state; if an interrupt flag bit is detected within the first preset time period, determining that the communication bus is in an occupied state. The controller in the vehicle communication device is put into sleep or woken up according to the status of the communication bus.
2. The communication bus detection method according to claim 1, characterized in that, Controlling the controller in the vehicle communication device to sleep or wake up according to the communication bus status includes: When the communication bus is in an idle state, the controller is controlled to go into sleep mode.
3. The communication bus detection method according to claim 1, characterized in that, Controlling the controller in the vehicle communication device to sleep or wake up according to the communication bus status includes: When the communication bus is in an occupied state, the controller is woken up.
4. The communication bus detection method according to claim 2, characterized in that, Controlling the controller to sleep includes: The communication transceiver in the vehicle-mounted communication device is controlled to enter a second sleep mode; After the second sleep mode reaches the second preset time, the communication transceiver is controlled to enter the third sleep mode; In the third sleep mode, the first setting pin of the communication transceiver is at a low level to control the controller to go into sleep mode after power-down.
5. The communication bus detection method according to claim 3, characterized in that, After the controller is woken up, the method further includes: resetting the interrupt flag.
6. The communication bus detection method according to claim 1, characterized in that, Interrupt flags detected, including: A level transition is detected on the second setting pin of the controller.
7. The communication bus detection method according to claim 1, characterized in that, Controlling the controller to wake up includes: Receive the first message; Adjust and convert the first message to output a digital signal; The digital signal controls the communication transceiver to switch from the third sleep mode to the set mode; In the specified setting mode, the power management module of the vehicle communication device receives a high-level signal and controls the controller to wake up.
8. A vehicle-mounted communication device, characterized in that, include: Communication transceiver; A communication bus, connected to the communication transceiver; The controller, connected to the communication transceiver, is used to determine the interrupt flag bit within a first preset time period in the interrupt detection function after the interrupt detection function of the controller unit RXD pin in the vehicle communication device is enabled, and to determine the corresponding communication bus state, including: after the interrupt detection function is disabled, if no interrupt flag bit is detected within the first preset time period, the communication bus is determined to be in an idle state; if an interrupt flag bit is detected within the first preset time period, the communication bus is determined to be in an occupied state, and the controller is put into sleep or woken up according to the communication bus state. The power management module is connected to both the controller and the communication transceiver, and is used to supply power to both the controller and the communication transceiver.
9. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores a communication bus detection program that can be executed by the at least one processor. When the communication bus detection program is executed by the at least one processor, the at least one processor performs the communication bus detection method as described in any one of claims 1-7.
Citation Information
Patent Citations
Vehicle control system, method and vehicle
CN116890770B
Vehicle power control method and device, medium, vehicle controller and vehicle
CN117382629A
Vehicle power control method, device, medium, vehicle controller and vehicle
CN117382629B
Vehicle control system, control method, controller and vehicle
CN117533292A
Vehicle control system, control method, controller and vehicle
CN117533292B