Hibernation control method, device and computer equipment of electronic control unit

By employing multi-stage power supply mode switching and asynchronous data storage, the problems of low efficiency and high cost in traditional electronic control unit sleep control are solved, achieving efficient sleep control and data storage, and reducing overall sleep time and cost.

CN121704288BActive Publication Date: 2026-07-21CHONGQING JINKANG POWER NEW ENERGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING JINKANG POWER NEW ENERGY CO LTD
Filing Date
2025-12-23
Publication Date
2026-07-21

Smart Images

  • Figure CN121704288B_ABST
    Figure CN121704288B_ABST
Patent Text Reader

Abstract

The application relates to a hibernation control method and device of an electronic control unit, computer equipment and a storage medium. The method comprises the following steps: switching the working mode of the electronic control unit from a normal running mode to a preparation sleep mode, monitoring the first duration of the preparation sleep mode, and asynchronously storing hibernation to-be-stored data; in response to the first duration being greater than or equal to a first duration threshold, switching the working mode from the preparation sleep mode to a preparation bus sleep mode, monitoring the second duration of the preparation bus sleep mode; in response to the second duration being greater than or equal to a second duration threshold, switching the working mode from the preparation bus sleep mode to a bus sleep mode, switching the power supply control mode from a second power supply mode to a third power supply mode, controlling the CAN transceiver of the electronic control unit to be closed, and controlling the electronic control unit to be powered off after storing the remaining hibernation to-be-stored data. The method can improve the hibernation efficiency and reduce the cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic control unit sleep technology, and in particular to a sleep control method, apparatus, computer device and storage medium for an electronic control unit. Background Technology

[0002] To prevent vehicles from failing to start due to excessive battery drain, the electronic control unit (ECU) will execute a hibernation process under certain conditions to enter a low-power mode. The core of ECU hibernation involves two types of actions: operating mode switching and data saving. Operating mode switching must be performed according to network management specifications; data saving is crucial because modern ECUs need to record a large amount of data, including fault snapshots and operational statistics, and writing to flash memory itself takes time.

[0003] However, traditional sleep control methods for electronic control units suffer from problems such as low efficiency or high cost. Summary of the Invention

[0004] Therefore, it is necessary to provide a sleep control method, apparatus, computer device, and storage medium for an electronic control unit that can improve sleep efficiency and reduce costs, in order to address the aforementioned technical problems.

[0005] In a first aspect, a sleep control method for an electronic control unit is provided, the method being applied to a microcontroller of the electronic control unit, the method comprising: In response to receiving a sleep control command from the electronic control unit, the power control mode of the electronic control unit is switched from the first power supply mode to the second power supply mode, the operating mode of the electronic control unit is switched from the normal operation mode to the sleep preparation mode, the first duration of the sleep preparation mode is monitored, and the sleep data to be stored is asynchronously stored; the first power supply mode is used to represent controlling the vehicle power supply to the electronic control unit through the power supply control switch; the second power supply mode is used to represent controlling the vehicle power supply to the electronic control unit through the CAN controller of the electronic control unit. In response to a first duration being greater than or equal to a first duration threshold, the control mode is switched from the preparation sleep mode to the preparation bus sleep mode, and the second duration of the preparation bus sleep mode is monitored. In response to a second duration being greater than or equal to a second duration threshold, the control operating mode is switched from the preparation bus sleep mode to the bus sleep mode, the power control mode is switched from the second power supply mode to the third power supply mode, the CAN transceiver of the electronic control unit is turned off, the remaining unstored sleep data is stored, and the electronic control unit is powered down; the third power supply mode is used to characterize the control of the vehicle power supply to the electronic control unit through the wake-up pin.

[0006] In one example, after storing the remaining unstored sleep data to be stored, the electronic control unit is powered down, including: storing the remaining unstored sleep data to be stored; in response to the completion of the storage of the remaining unstored sleep data to be stored, switching the power control mode from the third power supply mode to the first power-off mode; the first power-off mode is used to indicate that the vehicle power supply is stopped from supplying power to the electronic control unit by controlling the wake-up pin, so that the electronic control unit is powered down.

[0007] In one example, the method further includes: when controlling the CAN transceiver of the electronic control unit, starting the sleep timer of the electronic control unit and controlling each pending task in the task queue of the microcontroller to stop execution.

[0008] In one example, the method further includes: in response to the operating mode being in a sleep-ready mode and receiving a first recovery signal from the power supply control switch or a network management message from another node on the CAN bus, switching the operating mode from the sleep-ready mode to the normal operating mode and stopping monitoring for a first duration; wherein the first recovery signal is used to indicate switching the power control mode from the second power supply mode to the first power supply mode; and the other nodes are any nodes on the CAN bus other than the node corresponding to the electronic control unit.

[0009] In one example, the method further includes: in response to the operating mode being a ready bus sleep mode and receiving a first recovery signal from the power supply control switch or a network management message from another node on the CAN bus, switching the operating mode from the ready bus sleep mode to the normal operating mode, and stopping monitoring for a second duration; wherein the first recovery signal is used to indicate switching the power control mode from the second power supply mode to the first power supply mode; and other nodes are any nodes on the CAN bus other than the node corresponding to the electronic control unit.

[0010] In one example, the method further includes: in response to the operating mode being bus sleep mode and receiving a second recovery signal from the power control switch or a network management message from another node on the CAN bus, stopping the storage of remaining unstored sleep data to be stored, and resetting and waking up the electronic control unit; wherein the second recovery signal is used to indicate switching the power control mode from the third power supply mode to the first power supply mode; and other nodes are any nodes on the CAN bus other than the node corresponding to the electronic control unit.

[0011] In one example, the method further includes: acquiring sleep execution condition analysis data of the electronic control unit; determining whether the electronic control unit meets the sleep execution conditions based on the sleep execution condition analysis data; and outputting a sleep control command in response to the electronic control unit meeting the sleep execution conditions.

[0012] Secondly, a sleep control device for an electronic control unit is provided. The device is applied to the microcontroller of the electronic control unit and includes a sleep mode switching preparation module, a bus sleep mode switching preparation module, and a bus sleep mode switching module.

[0013] The sleep mode switching module is used to switch the power control mode of the electronic control unit from the first power supply mode to the second power supply mode in response to receiving the sleep control command from the electronic control unit, switch the operating mode of the electronic control unit from the normal operation mode to the sleep mode, monitor the first duration of the sleep mode, and asynchronously store the sleep data to be stored. The first power supply mode is used to represent controlling the vehicle power supply to the electronic control unit through the power supply control switch. The second power supply mode is used to represent controlling the vehicle power supply to the electronic control unit through the CAN controller of the electronic control unit. The bus sleep mode switching module is used to switch the operating mode from the sleep mode to the bus sleep mode in response to the first duration being greater than or equal to the first duration threshold, and monitor the second duration of the bus sleep mode. The bus sleep mode switching module is used to switch the operating mode from the bus sleep mode to the bus sleep mode in response to the second duration being greater than or equal to the second duration threshold, switch the power control mode from the second power supply mode to the third power supply mode, control the CAN transceiver of the electronic control unit to turn off, store the remaining unstored sleep data to be stored, and then control the electronic control unit to power down. The third power supply mode is used to represent controlling the vehicle power supply to the electronic control unit through the wake-up pin.

[0014] Thirdly, a computer device is provided, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described in the above method embodiments.

[0015] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of any of the methods described in the above method embodiments.

[0016] The aforementioned sleep control method, apparatus, computer device, and storage medium for the electronic control unit (ECU) switch the power control mode of the ECU from a first power supply mode to a second power supply mode in response to receiving a sleep control command from the ECU, switch the operating mode of the ECU from a normal operating mode to a sleep preparation mode, monitor the first duration of the sleep preparation mode, and asynchronously store sleep data to be stored. The first power supply mode represents controlling the vehicle power supply to the ECU via a power supply control switch. The second power supply mode represents controlling the vehicle power supply to the ECU via the ECU's CAN controller. Then, in response to the first duration being greater than or equal to a first duration threshold, the operating mode is switched from the sleep preparation mode to the bus sleep preparation mode, and the second duration of the bus sleep preparation mode is monitored. Next, in response to the second duration being greater than or equal to a second duration threshold, the operating mode is switched from the bus sleep preparation mode to the bus sleep mode, the power control mode is switched from the second power supply mode to a third power supply mode, the CAN transceiver of the ECU is turned off, the remaining unstored sleep data to be stored is stored, and the ECU is powered down. The third power supply mode represents controlling the vehicle power supply to the ECU via a wake-up pin. This allows the electronic control unit to completely hibernate, pre-shut down the CAN transceiver, and then store the remaining unstored hibernation data. This decouples hibernation and storage, meets testing specifications, and effectively reduces overall hibernation time and costs. Attached Figure Description

[0017] Figure 1 This is an application environment diagram of the sleep control method of the electronic control unit in one embodiment; Figure 2 This is a first flowchart illustrating the sleep control method of an electronic control unit in one embodiment; Figure 3 This is a schematic diagram of the process of controlling the electronic control unit to power down after storing the remaining unstored dormant data to be stored in one embodiment; Figure 4 This is a second flowchart illustrating the sleep control method of an electronic control unit in one embodiment; Figure 5 This is a schematic diagram of the third process of the sleep control method of the electronic control unit in one embodiment; Figure 6 This is a structural block diagram of the sleep control device of the electronic control unit in one embodiment; Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0019] To facilitate understanding of this application, a more complete description will be provided below with reference to the accompanying drawings, which illustrate embodiments of the present application. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that the disclosure of this application will be thorough and complete.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.

[0021] It is understood that the terms "first," "second," etc., used herein may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of this application, a first resistor may be referred to as a second resistor, and similarly, a second resistor may be referred to as a first resistor. Both the first resistor and the second resistor are resistors, but they are not the same resistor.

[0022] It is understood that the term "connection" in the following embodiments should be understood as "electrical connection," "communication connection," etc., if the connected circuits, modules, units, etc., have electrical signal or data transmission with each other.

[0023] When used herein, the singular forms of “a,” “an,” and “the” may also include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “comprising,” “including,” or “having,” etc., specify the presence of the stated feature, whole, step, operation, component, part, or combination thereof, but do not preclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof.

[0024] The sleep control method for the electronic control unit disclosed herein can be applied to... Figure 1The vehicle 100 shown may include an electronic control unit 110 and an on-board power supply 120. The electronic control unit 110 includes at least one microcontroller 10, a CAN transceiver 20, a wake-up pin 30, a CAN controller 40, and a power control switch 50. The microcontroller 10 stores a computer program that, when executed by the microcontroller 10, performs a sleep control method for the electronic control unit 110 according to exemplary embodiments of this disclosure. It is understood that the microcontroller 10 is not necessarily a single electronic device, but may be any collection of devices or circuits capable of executing the aforementioned computer program individually or in combination.

[0025] In one specific example, the electronic control unit 110 needs to support direct network management. The above is just a specific example. In actual applications, it can be flexibly set according to user needs, and there are no restrictions here.

[0026] Firstly, such as Figure 2 As shown, a sleep control method for an electronic control unit 110 is provided, which is applied to... Figure 1 Taking the microcontroller 10 of the electronic control unit 110 in the example, the method includes the following steps 201 to 203.

[0027] Step 201: In response to receiving the sleep control command from the electronic control unit, switch the power control mode of the electronic control unit from the first power supply mode to the second power supply mode, switch the operating mode of the electronic control unit from the normal operation mode to the sleep preparation mode, monitor the first duration of the sleep preparation mode, and asynchronously store the sleep data to be stored.

[0028] The first power supply mode is used to characterize the power supply of the vehicle power supply to the electronic control unit 110 by controlling the power supply control switch 50; the second power supply mode is used to characterize the power supply of the vehicle power supply to the electronic control unit 110 by controlling the CAN controller 40 of the electronic control unit 110.

[0029] Specifically, when the microcontroller 10 of the electronic control unit 110 receives the sleep control command of the electronic control unit 110, it switches the power control mode of the electronic control unit 110 from the first power supply mode to the second power supply mode. That is, at this time, the power supply control switch 50 is turned off, and the vehicle power supply cannot be controlled by the power supply control switch 50 to supply power to the electronic control unit 110. The CAN controller 40 of the electronic control unit 110 needs to control the vehicle power supply to maintain the power supply to the electronic control unit 110. The working mode of the electronic control unit 110 is switched from the normal operation state (NOS) to the ready sleep state (RSS). The first duration of the ready sleep state is monitored, and the sleep data to be stored is stored asynchronously. Thus, the execution of the sleep process of the electronic control unit 110 and the storage of the sleep data to be stored are carried out asynchronously, which can effectively reduce the overall sleep time.

[0030] In a specific example, the data to be stored during hibernation may include, but is not limited to, black box data and fault data. The above is just a specific example, and in actual applications, it can be flexibly set according to user needs, without any restrictions.

[0031] Step 202: In response to the first duration being greater than or equal to the first duration threshold, the operating mode is switched from the preparation sleep mode to the preparation bus sleep mode, and the second duration of the preparation bus sleep mode is monitored.

[0032] In a specific instance, according to the direct network management specification, the first duration threshold is 2 seconds. The above is only a specific example, and in actual applications, it can be flexibly set according to user needs. No restrictions are imposed here.

[0033] Specifically, when the microcontroller 10 of the electronic control unit 110 is greater than or equal to the first duration threshold, it controls the operating mode to switch from the prepare-to-sleep mode to the prepare-to-bus-sleep mode (PBSM) and monitors the second duration of the prepare-to-bus-sleep mode.

[0034] Step 203: In response to the second duration being greater than or equal to the second duration threshold, the control operating mode is switched from the preparation bus sleep mode to the bus sleep mode, the power control mode is switched from the second power supply mode to the third power supply mode, the CAN transceiver of the control unit is turned off, the remaining unstored sleep data is stored, and then the control unit is powered down.

[0035] The third power supply mode is used to characterize the supply of power from the vehicle power supply to the electronic control unit 110 via the wake-up pin 30. Specifically, when the microcontroller 10 of the electronic control unit 110 is greater than or equal to the second duration threshold, the control mode switches from the bus sleep mode to the bus sleep mode (BSM), and the power control mode switches from the second power supply mode to the third power supply mode. That is to say, at this time, the vehicle power supply cannot be controlled by the CAN controller 40 of the electronic control unit 110 to maintain the power supply of the electronic control unit 110. The vehicle power supply needs to be controlled by the wake-up pin 30 to supply power to the electronic control unit 110, and the CAN transceiver 20 of the electronic control unit 110 is turned off, so that the electronic control unit 110 exits the node on the bus. After storing the remaining unstored sleep data, the electronic control unit 110 is powered down, thereby achieving complete sleep of the electronic control unit 110. The CAN transceiver 20 is turned off in advance before the storage of the remaining unstored sleep data is executed, realizing the decoupling of sleep and storage, which meets the test specification requirements, effectively reduces the overall sleep time, and reduces sleep cost.

[0036] In a specific instance, according to the direct network management specification, the second duration threshold is 2 seconds. The above is only a specific example, and in actual applications, it can be flexibly set according to user needs. No restrictions are imposed here.

[0037] In one of the instances, such as Figure 3 As shown, after storing the remaining unstored sleep data to be stored, the electronic control unit is powered down, including steps 301 and 302.

[0038] Step 301: Store the remaining unstored dormant data to be stored; Step 302: In response to the completion of data storage of the remaining unstored hibernation data, switch the power control mode from the third power supply mode to the first power failure mode.

[0039] The first power-down mode is used to indicate that the vehicle power supply to the electronic control unit 110 is stopped by controlling the wake-up pin 30, thereby powering down the electronic control unit 110. Specifically, the microcontroller 10 of the electronic control unit 110 stores the remaining unstored sleep data to be stored; then, in response to the completion of the storage of the remaining unstored sleep data, the power control mode is switched from the third power supply mode to the first power-down mode. At this time, the power supply to the electronic control unit 110 is switched from being controlled by the wake-up pin 30 to being controlled by the wake-up pin 30 to stop being controlled by the vehicle power supply to the electronic control unit 110, accurately controlling the electronic control unit 110 to be powered down, improving the power-down efficiency and convenience of the electronic control unit 110.

[0040] In a specific example, the vehicle power supply to the electronic control unit 110 is controlled by pulling the wake-up pin 30 high, and the vehicle power supply to the electronic control unit 110 is stopped by pulling the wake-up pin 30 low. The above is only a specific example. In actual applications, it can be flexibly set according to user needs, and there are no restrictions here.

[0041] In this embodiment, the remaining unstored dormant data to be stored is stored; then, in response to the completion of the storage of the remaining unstored dormant data to be stored, the power control mode is switched from the third power supply mode to the first power-off mode. At this time, the control mode is switched from controlling the vehicle power supply to the electronic control unit 110 through the wake-up pin 30 to controlling the vehicle power supply to stop supplying power to the electronic control unit 110 through the wake-up pin 30, which accurately controls the electronic control unit 110 to be powered off, improving the power-off efficiency and convenience of the electronic control unit 110.

[0042] In one of the examples, the method further includes: When controlling the CAN transceiver 20 of the electronic control unit, the sleep timer of the electronic control unit is started, and the tasks to be executed in the task queue of the microcontroller 10 are stopped from executing.

[0043] Specifically, when the microcontroller 10 of the electronic control unit 110 controls the CAN transceiver 20 of the electronic control unit 110, it starts the sleep timer of the electronic control unit 110, so that the overall sleep time meets the test specifications, and stops the execution of each task to be executed in the task queue of the microcontroller 10, thereby improving the storage efficiency of the remaining unstored sleep data to be stored.

[0044] In this embodiment, when controlling the CAN transceiver 20 of the electronic control unit 110, the sleep timer of the electronic control unit 110 is started, so that the overall sleep time meets the test specifications, and the tasks to be executed in the task queue of the microcontroller 10 are stopped, thereby improving the storage efficiency of the remaining unstored sleep data to be stored.

[0045] Based on this, the sleep control method of the aforementioned electronic control unit 110, in response to receiving a sleep control command from the electronic control unit 110, switches the power control mode of the electronic control unit 110 from a first power supply mode to a second power supply mode, switches the operating mode of the electronic control unit 110 from a normal operating mode to a sleep preparation mode, monitors the first duration of the sleep preparation mode, and asynchronously stores the sleep data to be stored; the first power supply mode is used to indicate that the vehicle power supply is controlled to supply power to the electronic control unit 110 through the power supply control switch 50; the second power supply mode is used to indicate that the vehicle power supply is controlled to supply power to the electronic control unit 110 through the CAN controller 40 of the electronic control unit 110; and then... In response to a first duration being greater than or equal to a first duration threshold, the control operating mode switches from a prepare-to-sleep mode to a prepare-to-bus-sleep mode, and the second duration of the prepare-to-bus-sleep mode is monitored. Then, in response to a second duration being greater than or equal to a second duration threshold, the control operating mode switches from a prepare-to-bus-sleep mode to a bus-sleep mode, the power control mode switches from a second power supply mode to a third power supply mode, the CAN transceiver 20 of the electronic control unit 110 is turned off, and after storing the remaining unstored sleep data, the electronic control unit 110 is powered down. The third power supply mode is used to characterize the supply of power to the electronic control unit 110 via the wake-up pin 30. This achieves complete sleep mode for the electronic control unit 110, preemptively turning off the CAN transceiver 20 before storing the remaining unstored sleep data, decoupling sleep and storage, meeting test specification requirements, and effectively reducing overall sleep time and sleep costs.

[0046] In one of the instances, such as Figure 4 As shown, the method further includes step 401.

[0047] Step 401: In response to the operating mode being in sleep mode and receiving a first recovery signal from the power supply control switch or a network management message from another node on the CAN bus, switch the operating mode from sleep mode to normal operation mode and stop monitoring for the first duration.

[0048] The first recovery signal is used to indicate the switching of the power control mode from the second power supply mode to the first power supply mode; the other nodes are any nodes on the CAN bus other than the node corresponding to the electronic control unit 110.

[0049] Specifically, in response to the operating mode being in sleep mode and receiving the first recovery signal from the power supply control switch 50 or a network management message from another node on the CAN bus, the microcontroller 10 of the electronic control unit 110 switches the operating mode from sleep mode to normal operation mode, stops monitoring the first duration, thereby enabling the ECU to switch from RSS mode to NOS mode in a timely manner, stops monitoring the first duration to terminate the ECU's hibernation process, and continues to execute the step of asynchronously storing the hibernation data to be stored, thereby improving the efficiency and convenience of ECU wake-up.

[0050] In this embodiment, in response to the working mode being in sleep mode and receiving the first recovery conduction signal from the power supply control switch 50 or a network management message from another node on the CAN bus, the working mode is switched from sleep mode to normal operation mode, and the monitoring of the first duration is stopped. This allows the ECU to switch from RSS mode to NOS mode in a timely manner, and the monitoring of the first duration is stopped to terminate the ECU's hibernation process. The step of asynchronously storing the hibernation data to be stored continues to be executed, improving the efficiency and convenience of ECU wake-up.

[0051] In one of the instances, such as Figure 4 As shown, the method further includes step 402.

[0052] Step 402: In response to the operating mode being in the ready bus sleep mode and receiving the first recovery turn-on signal from the power supply control switch or a network management message from another node on the CAN bus, switch the operating mode from the ready bus sleep mode to the normal operating mode and stop monitoring the second duration.

[0053] The first recovery signal is used to indicate the switching of the power control mode from the second power supply mode to the first power supply mode; the other nodes are any nodes on the CAN bus other than the node corresponding to the electronic control unit 110.

[0054] Specifically, in response to the operating mode being in the bus sleep mode and receiving the first recovery conduction signal from the power supply control switch 50 or a network management message from another node on the CAN bus, the microcontroller 10 of the electronic control unit 110 switches the operating mode from the bus sleep mode to the normal operating mode, stops monitoring the second duration, thereby enabling the ECU to switch from PBSM mode to NOS mode in a timely manner, stops monitoring the first duration to terminate the ECU's hibernation process, and continues to execute the asynchronous storage of hibernation data to be stored, thereby improving the efficiency and convenience of ECU wake-up.

[0055] In this embodiment, in response to the working mode being in the bus sleep mode and receiving the first recovery conduction signal from the power supply control switch 50 or a network management message from another node on the CAN bus, the working mode is switched from the bus sleep mode to the normal operating mode, and the monitoring of the second duration is stopped. This allows the ECU to switch from PBSM mode to NOS mode in a timely manner, and the monitoring of the first duration is stopped to terminate the ECU's hibernation process. The step of asynchronously storing the hibernation data to be stored continues to be executed, improving the efficiency and convenience of ECU wake-up.

[0056] In one of the instances, such as Figure 4 As shown, the method further includes step 403.

[0057] Step 403: In response to the bus sleep mode being in operation mode and receiving the second recovery conduction signal from the power supply control switch or a network management message from another node on the CAN bus, stop storing the remaining unstored sleep data to be stored, and reset and wake up the electronic control unit.

[0058] The second recovery signal is used to indicate the switching of the power control mode from the third power supply mode to the first power supply mode; the other nodes are any nodes on the CAN bus except for the node corresponding to the electronic control unit 110.

[0059] Specifically, in response to the bus sleep mode and receiving the second recovery signal from the power supply control switch 50 or a network management message from another node on the CAN bus, the microcontroller 10 of the electronic control unit 110 stops storing the remaining unstored sleep data and resets the electronic control unit 110 to wake it up. This allows the ECU to be reset and woken up from BSM mode in a timely manner. After being reset and woken up, it is reinitialized back to NOS mode. The storage of the remaining unstored sleep data is stopped to avoid the time spent on storage from taking up the wake-up time, which would exceed the specified wake-up time requirement. This improves the efficiency and convenience of ECU wake-up.

[0060] In this embodiment, in response to the bus sleep mode and the receipt of the second recovery conduction signal of the power supply control switch 50 or the network management message of other nodes on the CAN bus, the storage of the remaining unstored sleep data to be stored is stopped, and the electronic control unit 110 is reset and woken up. This allows the ECU to be woken up from BSM mode and reset in a timely manner. After being woken up by the reset, it is reinitialized back to NOS mode. The storage of the remaining unstored sleep data to be stored is stopped to avoid wasting storage resources, thereby improving the efficiency and convenience of ECU wake-up.

[0061] In one of the instances, such as Figure 5 As shown, the method further includes steps 501 to 503.

[0062] Step 501: Obtain the sleep execution condition analysis data of the electronic control unit; Step 502: Determine whether the electronic control unit meets the hibernation execution conditions based on the hibernation execution condition analysis data; Step 503: In response to the electronic control unit meeting the hibernation execution conditions, a hibernation control command is output.

[0063] Specifically, the microcontroller 10 of the electronic control unit 110 acquires the sleep execution condition analysis data of the electronic control unit 110; then, it determines whether the electronic control unit 110 meets the sleep execution conditions based on the sleep execution condition analysis data; then, in response to the electronic control unit 110 meeting the sleep execution conditions, it outputs a sleep control command, thereby improving the start-up efficiency and convenience of sleep control.

[0064] In a specific example, the hibernation execution condition analysis data includes the working status data of the node corresponding to the vehicle power supply, the node status data corresponding to the power supply control switch 50, and the bus network management message data; it can be understood that the node corresponding to the vehicle power supply is referred to as the KL30 node; the node corresponding to the power supply control switch 50 is referred to as the KL15 node.

[0065] The conditions for hibernation execution may include, but are not limited to, the first and second conditions. The first condition is that the vehicle power supply is in an electrically held state and the ECU has not received any network management messages (NM messages) from any node on the bus. The second condition is that the vehicle power supply is in an electrically held state, the power supply control switch 50 is in the off state, and the target network messages currently received by the ECU on the bus have stopped. The above are only specific examples, and in actual applications, they can be flexibly set according to user needs, and are not limited here.

[0066] In this embodiment, the sleep execution condition analysis data of the electronic control unit 110 is obtained; then, it is determined whether the electronic control unit 110 meets the sleep execution conditions based on the sleep execution condition analysis data; then, in response to the electronic control unit 110 meeting the sleep execution conditions, a sleep control command is output, thereby improving the start-up efficiency and convenience of sleep control.

[0067] It should be understood that, although Figure 2-5 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2-5At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0068] Secondly, such as Figure 6 As shown, a sleep control device for an electronic control unit is provided. The device is applied to the microcontroller 10 of the electronic control unit and includes a sleep mode switching preparation module 610, a bus sleep mode switching preparation module 620, and a bus sleep mode switching module 630.

[0069] The sleep mode switching module 610 is used to switch the power control mode of the electronic control unit from the first power supply mode to the second power supply mode in response to receiving the sleep control command from the electronic control unit, switch the working mode of the electronic control unit from the normal operation mode to the sleep mode, monitor the first duration of the sleep mode, and asynchronously store the sleep data to be stored. The first power supply mode is used to represent the vehicle power supply to the electronic control unit controlled by the power supply control switch. The second power supply mode is used to represent the vehicle power supply to the electronic control unit controlled by the CAN controller of the electronic control unit. The bus sleep mode switching module 620 is used to switch the working mode from the sleep mode to the bus sleep mode in response to the first duration being greater than or equal to the first duration threshold, and monitor the second duration of the bus sleep mode. The bus sleep mode switching module 630 is used to switch the working mode from the bus sleep mode to the bus sleep mode in response to the second duration being greater than or equal to the second duration threshold, switch the power control mode from the second power supply mode to the third power supply mode, control the CAN transceiver of the electronic control unit to turn off, store the remaining unstored sleep data to be stored, and then control the electronic control unit to power down. The third power supply mode is used to represent the vehicle power supply to the electronic control unit controlled by the wake-up pin.

[0070] In one example, the bus sleep mode switching module 630 includes a power-down unit.

[0071] The power-down unit is used to store the remaining unstored hibernation data to be stored; the power-down unit is used to switch the power control mode from the third power supply mode to the first power-off mode in response to the completion of the storage of the remaining unstored hibernation data; the first power-off mode is used to indicate that the vehicle power supply stops supplying power to the electronic control unit through the wake-up pin, so as to power down the electronic control unit.

[0072] In one example, the bus sleep mode switching module 630 is also used to start the sleep timer of the electronic control unit when controlling the CAN transceiver of the electronic control unit, and to control the execution of each pending task in the task queue of the microcontroller to stop.

[0073] In one example, the device also includes a wake-up module.

[0074] The wake-up module is used to switch the operating mode from the ready-to-sleep mode to the normal operating mode and stop monitoring for a first duration when the operating mode is in the ready-to-sleep mode and a first recovery conduction signal is received from the power control switch or a network management message from another node on the CAN bus. The first recovery conduction signal is used to indicate that the power control mode is switched from the second power supply mode to the first power supply mode. Other nodes are any nodes on the CAN bus other than the node corresponding to the electronic control unit.

[0075] In one example, the wake-up module is also used to switch the operating mode from the ready bus sleep mode to the normal operating mode in response to the operation mode being in the ready bus sleep mode and receiving a first recovery conduction signal from the power supply control switch or a network management message from another node on the CAN bus, and to stop monitoring for a second duration; wherein, the first recovery conduction signal is used to indicate switching the power control mode from the second power supply mode to the first power supply mode; other nodes are any nodes on the CAN bus other than the node corresponding to the electronic control unit.

[0076] In one example, the wake-up module is also used to stop storing the remaining unstored sleep data and reset and wake up the electronic control unit in response to the bus sleep mode and the second power control switch receiving a second power-on signal or a network management message from another node on the CAN bus; wherein, the second power-on signal is used to indicate switching the power control mode from the third power supply mode to the first power supply mode; other nodes are any nodes on the CAN bus other than the node corresponding to the electronic control unit.

[0077] In one example, the device also includes an instruction output module.

[0078] The instruction output module is used to acquire the sleep execution condition analysis data of the electronic control unit; the instruction output module is used to determine whether the electronic control unit meets the sleep execution conditions based on the sleep execution condition analysis data; and the instruction output module is used to output a sleep control instruction in response to the electronic control unit meeting the sleep execution conditions.

[0079] Specific limitations regarding the sleep control device for the electronic control unit can be found in the above description of the sleep control method for the electronic control unit, and will not be repeated here. Each module in the aforementioned sleep control device for the electronic control unit can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the corresponding operations of each module.

[0080] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a sleep control method for an electronic control unit. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0081] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0082] Thirdly, a computer device is provided, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described in the above method embodiments.

[0083] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of any of the methods described in the above method embodiments.

[0084] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0085] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0086] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A sleep control method for an electronic control unit, the method being applied to a microcontroller of the electronic control unit, the method comprising: In response to receiving the sleep control command from the electronic control unit, the power control mode of the electronic control unit is switched from the first power supply mode to the second power supply mode, the operating mode of the electronic control unit is switched from the normal operation mode to the sleep preparation mode, the first duration of the sleep preparation mode is monitored, and the sleep data to be stored is asynchronously stored. The first power supply mode is used to characterize the supply of power from the vehicle power supply to the electronic control unit by controlling the power supply control switch; the second power supply mode is used to characterize the supply of power from the vehicle power supply to the electronic control unit by controlling the CAN controller of the electronic control unit. In response to the first duration being greater than or equal to a first duration threshold, the operating mode is controlled to switch from the preparation sleep mode to the preparation bus sleep mode, and the second duration of the preparation bus sleep mode is monitored. In response to the second duration being greater than or equal to the second duration threshold, the operating mode is switched from the preparation bus sleep mode to the bus sleep mode, the power control mode is switched from the second power supply mode to the third power supply mode, the CAN transceiver of the electronic control unit is turned off, and the remaining unstored sleep data is stored before the electronic control unit is powered down; the third power supply mode is used to indicate that the vehicle power supply is controlled to supply power to the electronic control unit through the wake-up pin.

2. The method according to claim 1, characterized in that, After storing the remaining unstored dormant data to be stored, the electronic control unit is powered down, including: Store the remaining unstored dormant data to be stored; In response to the completion of the storage of the remaining unstored data in the dormant state, the power control mode is switched from the third power supply mode to the first power-off mode; the first power-off mode is used to indicate that the vehicle power supply stops supplying power to the electronic control unit through the wake-up pin, so as to power down the electronic control unit.

3. The method according to claim 1, characterized in that, The method further includes: When controlling the CAN transceiver of the electronic control unit, the sleep timer of the electronic control unit is started, and the tasks to be executed in the task queue of the microcontroller are stopped from execution.

4. The method according to claim 1, characterized in that, The method further includes: In response to the operating mode being the sleep preparation mode and receiving a first recovery signal from the power supply control switch or a network management message from another node on the CAN bus, the operating mode is switched from the sleep preparation mode to the normal operating mode, and the monitoring of the first duration is stopped; wherein, the first recovery signal is used to indicate switching the power control mode from the second power supply mode to the first power supply mode; the other node is any node on the CAN bus other than the node corresponding to the electronic control unit.

5. The method according to claim 1, characterized in that, The method further includes: In response to the operating mode being the prepared bus sleep mode and receiving a first recovery signal from the power supply control switch or a network management message from another node on the CAN bus, the operating mode is switched from the prepared bus sleep mode to the normal operating mode, and the monitoring of the second duration is stopped; wherein, the first recovery signal is used to indicate switching the power control mode from the second power supply mode to the first power supply mode; the other node is any node on the CAN bus other than the node corresponding to the electronic control unit.

6. The method according to claim 1, characterized in that, The method further includes: In response to the operating mode being the bus sleep mode and receiving a second recovery signal from the power supply control switch or a network management message from another node on the CAN bus, the storage of the remaining unstored sleep data to be stored is stopped, and the electronic control unit is reset and woken up; wherein, the second recovery signal is used to indicate switching the power control mode from the third power supply mode to the first power supply mode; the other nodes are any nodes on the CAN bus other than the node corresponding to the electronic control unit.

7. The method according to claim 1, characterized in that, The method further includes: Obtain the sleep execution condition analysis data of the electronic control unit; Based on the analysis data of the hibernation execution conditions, determine whether the electronic control unit meets the hibernation execution conditions; In response to the electronic control unit meeting the hibernation execution conditions, the hibernation control command is output.

8. A sleep control device for an electronic control unit, characterized in that, The device is used in a microcontroller of an electronic control unit, and the device includes: A sleep mode switching module is configured to, in response to receiving a sleep control command from the electronic control unit, switch the power control mode of the electronic control unit from a first power supply mode to a second power supply mode, switch the operating mode of the electronic control unit from a normal operating mode to a sleep preparation mode, monitor the first duration of the sleep preparation mode, and asynchronously store sleep data to be stored; the first power supply mode is used to indicate that the vehicle power supply is controlled to supply power to the electronic control unit via a power supply control switch; the second power supply mode is used to indicate that the vehicle power supply is controlled to supply power to the electronic control unit via the CAN controller of the electronic control unit. A bus sleep mode switching module is configured to control the working mode to switch from the prepared sleep mode to the prepared bus sleep mode in response to the first duration being greater than or equal to the first duration threshold, and to monitor the second duration of the prepared bus sleep mode. A bus sleep mode switching module is used to control the operating mode to switch from the prepared bus sleep mode to the bus sleep mode in response to the second duration being greater than or equal to the second duration threshold, switch the power control mode from the second power supply mode to the third power supply mode, control the CAN transceiver of the electronic control unit to turn off, store the remaining unstored sleep data to be stored, and then control the electronic control unit to power down; the third power supply mode is used to indicate that the vehicle power supply is controlled to supply power to the electronic control unit through the wake-up pin.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.