Reset recovery method and related device

By acquiring and using the variable information of the storage area to restore the function status after the vehicle controller is reset, the problem that the function cannot be restored quickly after the controller is reset is solved, improving the user experience and reducing security risks.

CN120363933APending Publication Date: 2025-07-25YINWANG INTELLIGENT TECHNOLOGIES CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410074191.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-18
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

After the vehicle controller is reset, the function cannot be quickly restored to the state before reset, resulting in poor user experience and may bring safety risks.

Method used

After the vehicle controller is reset, by obtaining the variable information before reset, skipping the start condition judgment logic of the target function, directly restore the function state to the state before reset, and using the storage area of the microcontroller to save the information before reset, avoiding re-judging the state.

Benefits of technology

It realizes the rapid recovery of functional status after the vehicle controller is reset, reducing processing time, improving user experience and reducing safety risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120363933A_ABST
    Figure CN120363933A_ABST
Patent Text Reader

Abstract

The invention discloses a reset recovery method and a related device. The method is applied to a microcontroller of a vehicle. The method comprises the steps that software initialization is completed in response to a reset instruction; variable information is obtained; the variable information comprises state information of a target function before resetting, and the target function comprises a vehicle starting function before resetting; and under the condition that the variable information indicates that the reset belongs to abnormal reset, skipping the starting condition judgment logic of the target function, and setting the state of the target function as a target state based on the variable information, the target state being a function state of the target function before the reset. By adopting the scheme, the use state of the function can be quickly recovered after the controller of the vehicle is reset, potential safety hazards are reduced, and the vehicle use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of vehicles, and specifically relates to a reset recovery method and related devices. Background Art

[0002] With the development of vehicle technology, the computing power of the controllers in vehicles is getting higher and higher, and the software functions carried are also getting more and more complex. Therefore, during the use of vehicles, it is inevitable that the controllers will be reset for various reasons. After the controller is reset, many functions it carries will re-judge the conditions. If the startup conditions of the functions are not met, it is impossible to restore to the function usage state before the reset, which brings a bad experience to the function usage and even poses a safety hazard to the occupants under certain working conditions. Therefore, how to quickly restore the function usage state after the controller is reset is a technical problem that needs to be solved urgently. Summary of the Invention

[0003] This application provides a reset recovery method and related devices, which can quickly restore the function usage state after the vehicle controller is reset, reduce safety hazards, and improve the user's vehicle usage experience.

[0004] In a first aspect, this application provides a reset recovery method, which is applied to a microcontroller of a vehicle. The method includes:

[0005] Respond to the reset instruction to complete software initialization;

[0006] Obtain variable information; the variable information includes the state information of the target function before the reset occurs, and the target function includes the functions started by the vehicle before the reset occurs;

[0007] In the case where the variable information indicates that the reset is an abnormal reset, skip the startup condition judgment logic of the target function, and set the state of the target function to the target state based on the variable information, where the target state is the function state of the target function before the reset.

[0008] In the above solution, it can be judged that it is an abnormal reset based on the variable information itself, and then the function state before the reset is restored based on the variable information. Compared with the prior art, this solution does not need to re-judge the startup conditions of the vehicle's function state, nor does it need to compare the current vehicle state with the state before the reset, so the processing time can be greatly reduced, and the function usage state can be quickly restored after the vehicle controller is reset.

[0009] In a possible implementation, the obtaining of the variable information includes:

[0010] Obtain the variable information within the first operating system scheduling cycle after the software initialization is completed.

[0011] In the above solution, within the first operating system scheduling cycle after the reset initialization is completed, the variable information stored before the reset is obtained. Because within the first scheduling cycle, the stored variable information has not changed due to software operation and remains the latest vehicle function state information stored before the reset. Therefore, based on the variable information itself, an abnormal reset can be determined.

[0012] In a possible implementation manner, when the variable information indicates that the reset belongs to an abnormal reset, the method further includes: closing the information sending channel of the microcontroller to the outside;

[0013] After setting the state of the target function to the target state based on the variable information, it further includes: opening the information sending channel of the microcontroller to the outside.

[0014] In the above solution, during the reset process of the microcontroller, the microcontroller is substantially in a node loss state on the entire vehicle. To prevent abnormal functions of the peripheral controllers after the controller is reset, the communication channel for sending information from the controller to the outside can be closed first, and then reopened after the restoration is completed.

[0015] In a possible implementation manner, the variable information includes the power system readiness state information of the vehicle; the variable information indicating that the reset belongs to an abnormal reset includes:

[0016] When the power system readiness state information indicates that the power system is ready, the reset belongs to an abnormal reset.

[0017] In the above solution, it is possible to quickly determine whether it belongs to an abnormal reset through the power system readiness state information, thereby greatly reducing the processing time for state restoration.

[0018] In a possible implementation manner, after setting the state of the target function to the target state based on the variable information, it further includes:

[0019] Obtaining the latest torque information of the vehicle;

[0020] Performing torque filtering based on the latest torque information.

[0021] In the above solution, after restoration, torque filtering is used to achieve the purpose of quickly transitioning the torque before the reset to the latest target torque, reducing vehicle oscillation and improving the user experience.

[0022] In a possible implementation manner, the variable information includes the battery charge and discharge state information of the vehicle; the variable information indicating that the reset belongs to an abnormal reset includes:

[0023] When the battery charge and discharge status information indicates that the battery is in a charging state or an external discharging state, the reset is an abnormal reset; the external discharging state includes the battery supplying power to devices outside the vehicle.

[0024] In the above solution, it is possible to quickly determine whether it is an abnormal reset through the battery charge and discharge status information, thereby greatly reducing the processing time for state recovery.

[0025] In a possible implementation, setting the state of the target function to the target state based on the variable information includes:

[0026] Within a first preset duration, setting the state of the target function to the target state based on the variable information; the value of the first preset duration is between three and eight times the duration of the scheduling period.

[0027] In the above solution, the recovery of the vehicle function state can be completed within three to eight scheduling periods, which is much better than the recovery duration of the existing solution.

[0028] In a possible implementation, within the first preset duration, setting the state of the target function to the target state based on the variable information includes:

[0029] Generating a first notification message and a second notification message; the generation time interval between the first notification message and the second notification message is the first preset duration, the first notification message is used to indicate that the target function is restored to the target state, and the second notification message indicates restoring the function startup condition judgment logic of the target function before the reset;

[0030] In response to the first notification message, start setting the state of the target function to the target state based on the variable information, and complete the recovery of the target state before restoring the function startup condition judgment logic in response to the second notification message.

[0031] In the above solution, through the cooperation of the first notification message and the second notification message, the target function module can complete the recovery operation within the preset duration and restore the function startup condition judgment logic in a timely manner to ensure vehicle use safety.

[0032] In a possible implementation, within the first preset duration, setting the state of the target function to the target state based on the variable information includes:

[0033] Start setting the state of the target function to the target state based on the variable information at a first moment and complete the recovery of the target state before a second moment; the interval between the first moment and the second moment is the first preset duration;

[0034] Function startup condition judgment logic of the target function before starting to resume the reset at the second moment.

[0035] In the above solution, the microcontroller can set a timer to resume their previous judgment logic at the right time to ensure driving safety.

[0036] In a possible implementation, the obtaining the variable information includes: obtaining the variable information in a target storage area; the target storage area belongs to the memory or external memory of the microcontroller.

[0037] In the above solution, the variable information is stored in the memory of the microcontroller for easy access.

[0038] Optionally, the completing software initialization in response to a reset instruction includes: completing the initialization of the target memory of the microcontroller in response to the reset instruction; if the target storage area belongs to the memory of the microcontroller, the target storage area belongs to a memory area outside the target memory.

[0039] In the above solution, the target storage area is not affected by the memory initialization of the reset, so that the information before the reset can be retained.

[0040] In a possible implementation, the target storage area is used to periodically write the status information of the target function; before obtaining the variable information in the target storage area, it further includes: pausing the write function of the target storage area based on the reset instruction.

[0041] In the above solution, the microcontroller notifies each application layer function software to pause writing variable information into the target storage area (close the write of the target storage area) based on the reset instruction to ensure that the information in the target storage area is the information written last time before the reset. After obtaining the information in the target storage area, it then notifies each application layer software to continue storing variable information into the target storage area (open the write of the target storage area). Thus, it can be ensured that the variable information in the target storage area after the reset has not changed due to software operation and is still the latest stored vehicle function status information before the reset. Therefore, an abnormal reset can be judged based on the variable information itself.

[0042] In a possible implementation, the obtaining the variable information includes: receiving the variable information from a target device; the target device is independent of the microcontroller and can be used to store the variable information.

[0043] In the above solution, the target device can be a server or other controllers in a vehicle, etc. The microcontroller can interact with the target device to store and read the variable information, and the storage of the variable information in this implementation is not affected by the reset of the microcontroller either.

[0044] Optionally, the variable information includes one or more of the following: vehicle energy control request, vehicle high-voltage mode request, high-voltage enable flag, high-voltage state of the battery management system, vehicle high-low voltage state, charge-discharge state, power system readiness state, vehicle gear position, pedal learning value, power anti-theft state, vehicle mode, driving mode, single-pedal mode, scenario mode, steering mode, and electronic stability control system mode. This solution can achieve the rapid recovery of multiple functional states and has a wide range of application scenarios.

[0045] In a possible implementation, the opening of the information sending channel of the microcontroller to the outside includes: after a second preset duration from the closing of the information sending channel of the microcontroller to the outside, opening the information sending channel of the microcontroller to the outside.

[0046] In the above solution, an overtime protection mechanism for closing the external sending channel is designed. As long as the closing reaches the second preset duration, it will be opened to prevent the adverse effects caused by too long communication interruption.

[0047] In a second aspect, the present application provides a microcontroller, which includes:

[0048] A processing unit, configured to complete software initialization in response to a reset instruction;

[0049] An acquisition unit, configured to acquire variable information; the variable information includes the state information of the target function before the occurrence of the reset, and the target function includes the function of starting the vehicle before the occurrence of the reset;

[0050] The processing unit is further configured to, when the variable information indicates that the reset belongs to an abnormal reset, skip the startup condition judgment logic of the target function, and set the state of the target function to a target state based on the variable information, where the target state is the functional state of the target function before the reset.

[0051] In a possible implementation, the acquisition unit is specifically configured to:

[0052] Acquire the variable information within the first operating system scheduling cycle after the completion of the software initialization.

[0053] In a possible implementation, the processing unit is further configured to:

[0054] When the variable information indicates that the reset is an abnormal reset, close the information sending channel of the microcontroller to the outside;

[0055] And after setting the state of the target function to the target state based on the variable information, open the information sending channel of the microcontroller to the outside.

[0056] In a possible implementation, the variable information includes the power system readiness status information of the vehicle; the variable information indicating that the reset is an abnormal reset includes:

[0057] When the power system readiness status information indicates that the power system is ready, the reset is an abnormal reset.

[0058] In a possible implementation, the processing unit is further configured to:

[0059] After setting the state of the target function to the target state based on the variable information, obtain the latest torque information of the vehicle;

[0060] Perform torque filtering based on the latest torque information.

[0061] In a possible implementation, the variable information includes the battery charge and discharge status information of the vehicle; the variable information indicating that the reset is an abnormal reset includes:

[0062] When the battery charge and discharge status information indicates that the battery is in a charging state or an external discharge state, the reset is an abnormal reset; the external discharge state includes the battery supplying power to devices outside the vehicle.

[0063] In a possible implementation, the processing unit is specifically configured to:

[0064] Within a first preset duration, set the state of the target function to the target state based on the variable information; the value of the first preset duration is between three and eight times the duration of the scheduling period.

[0065] In a possible implementation, the processing unit is specifically configured to:

[0066] Generate a first notification message and a second notification message; the generation time interval between the first notification message and the second notification message is the first preset duration, the first notification message is used to indicate restoring the target function to the target state, and the second notification message indicates restoring the function startup condition judgment logic of the target function before the reset;

[0067] In response to the first notification message, start setting the state of the target function to the target state based on the variable information, and complete the restoration of the target state before resuming the function startup condition judgment logic in response to the second notification message.

[0068] In one possible implementation, the processing unit is specifically configured to:

[0069] Start setting the state of the target function to the target state based on the variable information at a first moment, and complete the restoration of the target state before a second moment; the first moment and the second moment are separated by the first preset duration;

[0070] Resume the function startup condition judgment logic of the target function before the reset at the second moment.

[0071] In one possible implementation, the acquisition unit is specifically configured to:

[0072] Acquire the variable information in the target storage area; the target storage area belongs to the internal memory or external memory of the microcontroller;

[0073] In one possible implementation, the processing unit is specifically configured to: in response to the reset instruction, complete the initialization of the target memory of the microcontroller;

[0074] If the target storage area belongs to the internal memory of the microcontroller, the target storage area belongs to the memory area outside the target memory.

[0075] In one possible implementation, the target storage area is used to periodically write the state information of the target function;

[0076] Before acquiring the variable information in the target storage area, the processing unit is further configured to: pause the writing function of the target storage area based on the reset instruction.

[0077] In one possible implementation, the variable information includes one or more of the following:

[0078] Vehicle energy control request, vehicle high-voltage mode request, high-voltage enable flag, battery management system high-voltage state, vehicle high-low voltage state, charge-discharge state, power system ready state, vehicle gear, pedal learning value, power anti-theft state, vehicle mode, driving mode, single-pedal mode, scenario mode, steering mode, and electronic stability control system mode.

[0079] In one possible implementation, the processing unit is specifically configured to: after a second preset duration after closing the information sending channel of the microcontroller to the outside, open the information sending channel of the microcontroller to the outside.

[0080] In a third aspect, the present application provides a microcontroller, which includes a processor and a memory. The memory is coupled to the processor. When the processor executes the computer program or computer instructions stored in the memory, the method described in any item of the first aspect above can be implemented. The microcontroller may further include a communication interface, which is used for the microcontroller to communicate with other microcontrollers. Exemplarily, the communication interface may be a transceiver, a circuit, a bus, a module, or other types of communication interfaces.

[0081] In a possible implementation, the microcontroller may include:

[0082] A memory for storing computer programs or computer instructions;

[0083] A processor for:

[0084] Completing software initialization in response to a reset instruction;

[0085] Obtaining variable information; the variable information includes the status information of the target function before the occurrence of the reset, and the target function includes the function of starting the vehicle before the occurrence of the reset;

[0086] In the case where the variable information indicates that the reset is an abnormal reset, skipping the startup condition judgment logic of the target function, and setting the status of the target function to the target state based on the variable information, where the target state is the function state of the target function before the reset.

[0087] It should be noted that the computer programs or computer instructions in the memory of the present application may be pre-stored or stored after being downloaded from the Internet when using the microcontroller. The present application does not specifically limit the source of the computer programs or computer instructions in the memory. The coupling in the embodiments of the present application is an indirect coupling or connection between devices, units, or modules, which may be electrical, mechanical, or other forms, and is used for information interaction between devices, units, or modules.

[0088] In a fourth aspect, the present application provides a controller, which includes a system basis chip, a transceiver, and a microcontroller; wherein, the microcontroller is the microcontroller described in any item of the second aspect above, or the microcontroller described in the third aspect above; the system basis chip is used to supply power to the microcontroller; the transceiver is used to provide external communication for the microcontroller.

[0089] In a fifth aspect, the present application provides a vehicle, which includes the microcontroller described in any item of the second aspect above, or includes the microcontroller described in the third aspect above.

[0090] In a sixth aspect, the present application provides a computer-readable storage medium storing a computer program or computer instructions, and the computer program or computer instructions are executed by a processor to implement the method according to any one of the first aspect above.

[0091] In a seventh aspect, the present application provides a computer program product, and when the computer program product is executed by a processor, the method according to any one of the first aspect above will be implemented.

[0092] The solutions provided in the second to seventh aspects above are used to implement or cooperate with the method provided correspondingly in the first aspect, and thus can achieve the same or corresponding beneficial effects as the corresponding method in the first aspect, which will not be elaborated here. Description of the Drawings

[0093] Figure 1 The figure shows a schematic structural diagram of a vehicle controller provided by an embodiment of the present application;

[0094] Figure 2 The figure shows a schematic diagram of a reset initialization process provided by an embodiment of the present application;

[0095] Figure 3 The figure shows a schematic diagram of a method flow provided by an embodiment of the present application;

[0096] Figure 4 and Figure 5 The figure is a schematic structural diagram of a microcontroller provided by an embodiment of the present application. Detailed Embodiments

[0097] In the embodiments of the present application, "a plurality of" means two or more. In the embodiments of the present application, "and / or" is used to describe the association relationship of associated objects, indicating three relationships that can exist independently. For example, A and / or B can represent: A exists alone, B exists alone, or both A and B exist simultaneously. In the embodiments of the present application, the description methods such as "at least one (or at least one) of a1, a2,..., and an" include the case where any one of a1, a2,..., and an exists alone, and also include any combination of any plurality of a1, a2,..., and an, and each case can exist alone; for example, the description method of "at least one of a, b, and c" includes the cases of a alone, b alone, c alone, the combination of a and b, the combination of a and c, the combination of b and c, or the combination of a, b, and c.

[0098] In this application, terms such as "first" and "second" are used to distinguish between identical or similar items with basically the same functions. It should be understood that there is no logical or chronological dependency between "first", "second", and "nth", nor are the quantity and execution order limited. It should also be understood that although the following description uses terms such as first and second to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another.

[0099] In various embodiments of this application, if there is no special description and logical conflict, the terms and / or descriptions between the embodiments are consistent and can be referenced to each other. The technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.

[0100] During the use of the vehicle, it is inevitable that the controller will be reset. The reset can include a soft reset (i.e., software reset) and a hard reset (i.e., hardware reset). A soft reset refers to a reset triggered by the microcontroller unit (MCU) chip in the controller itself. A hard reset refers to a reset triggered by hardware outside the MCU chip or by power supply, such as a reset triggered by the system base chip, etc. The controller reset involved in the embodiments of this application includes the soft reset and hard reset of the MCU.

[0101] After the controller is reset, many functions it carries will re-perform conditional judgments. If the startup conditions of the functions are not met, it cannot return to the function usage state before the reset, which brings a bad experience to the function usage and even poses a safety hazard to the occupants under certain working conditions.

[0102] For example, in one scenario, if the vehicle is in a charging state and the vehicle's controller (such as an electronic control unit (ECU)) is reset at this time, the controller may not be able to re-enter the charging state. If the user returns to the car after a few hours and finds that the vehicle is still in a low battery state, it affects the user's experience.

[0103] For another example, in another scenario, generally, for a vehicle to enter a drivable state, at least two conditions need to be met: 1. The gear is in the P gear (parking gear) or N gear (neutral gear), and 2. The vehicle speed is 0. If the vehicle is driving at a constant speed or accelerating to overtake on the highway and the vehicle's controller is reset at this time. Since the vehicle cannot meet these two conditions at this time, the controller cannot re-enter the driving state. The vehicle will lose power, and the user must pull over and power on again to shift gears, which poses a safety risk.

[0104] For another example, in another scenario, when a vehicle is turning in an advanced driving assistance system (ADAS) driving scenario, if the vehicle controller is reset at this time, the vehicle may lose the lateral vehicle control ability of the ADAS while losing power, posing a safety risk.

[0105] It can be understood that the scenarios described above are only examples and do not constitute a limitation on the embodiments of the present application.

[0106] Based on the problems of poor user experience or safety hazards caused by the reset of the vehicle controller, quickly restoring the usage state of the function after the controller is reset is the key to solving the problem. Based on this, the embodiments of the present application provide a reset recovery method and related device, which can quickly restore the usage state of the function after the vehicle controller is reset, reduce safety hazards, and improve the user's vehicle usage experience. The following is an exemplary introduction.

[0107] First, refer to Figure 1 , which exemplarily shows the structural schematic diagram of the vehicle controller 100 provided by the embodiments of the present application. It can be seen that the controller 100 may include a micro-controller unit (MCU) 110, a system basic chip (SBC) 120, and a transceiver 130. The system basic chip 120 and the transceiver 130 are connected to the microcontroller 110.

[0108] Exemplarily, the above-mentioned microcontroller 110 integrates various functional units such as a microprocessor, a memory, an input / output interface, a timer, and a counter. In addition, an operating system (OS) software and one or more application layer softwares are also deployed in the microcontroller 110. The one or more application layer softwares can be used to implement one or more of the following functions: high-voltage management function of the vehicle, powertrain (PT) ready arbitration function, gear arbitration function, vehicle mode arbitration function, driving mode arbitration function, single-pedal mode arbitration function, acceleration pedal processing function, power anti-theft function, and torque filtering function, etc. It can be understood that the description of the functions that the application layer software can implement here is only an example and does not constitute a limitation on the embodiments of the present application. In specific implementations, the application layer software deployed in the microcontroller 110 can also implement other more or fewer functions, and the embodiments of the present application do not limit this.

[0109] Exemplarily, in specific implementations, the above-mentioned system basic chip 120 can be used to supply power to the microcontroller 110 and undertake functions such as detecting and diagnosing the safety state of the microcontroller 110.

[0110] Exemplarily, the above transceiver 130 can implement the communication between the microcontroller 110 and other controllers or components in the vehicle. Exemplarily, the transceiver 130 can be, for example, a controller area network (CAN) transceiver, a local interconnect network (LIN) transceiver, or an Ethernet transceiver (such as a port physical layer (PHY) chip, etc.).

[0111] Exemplarily, the above controller 100 can be, for example: a vehicle control unit (VCU), a hybrid control unit (HCU), a vehicle domain controller (VDC), a vehicle intranet unit (VIU), or an intelligent driving controller, etc. The embodiments of the present application do not limit the specific type of the controller 100.

[0112] Exemplarily, after the above microcontroller 110 is powered on from the system base chip 120, the microcontroller 110 first needs to complete the power-on process. For example, the power-on process can be exemplarily referred to Figure 2 . Exemplarily, after the microcontroller 110 is powered on from the system base chip 120, the hardware self-check of the microcontroller 110 is first performed. The process of the hardware self-check is completely executed by the internal circuit of the microcontroller 110.

[0113] In a possible implementation manner, the above hardware self-check is not an essential process for the controller to power on. Exemplarily, it can be configured whether to perform the hardware self-check during the power-on process according to actual application needs. The embodiments of the present application do not limit this. In the description of the embodiments of the present application, the case where the hardware self-check is configured is taken as an example for introduction.

[0114] After the above microcontroller 110 completes the hardware self-check, it enters the software boot phase. The first line of code starts running in this phase. Exemplarily, usually, the application layer software and data are stored in flash or stored in read-only memory (ROM). In one possible implementation, during the boot phase, the microcontroller 110 can load the application layer software and data into the memory space of the microcontroller 110 (for example, load it into the internal random access memory (RAM)) to run. In another possible implementation, during the boot phase, the microcontroller 110 does not need to load the application layer software and data into the memory space of the microcontroller 110 and can directly run in flash.

[0115] After the above boot phase ends, it starts to enter the software initialization phase. Exemplarily, this software initialization phase mainly includes steps such as software security self-check, driver initialization, operating system startup, and communication protocol stack initialization. Among them, the software security self-check can ensure the security of the software and prevent it from being maliciously tampered with. Driver initialization can achieve external driving. Operating system startup can provide a normal running environment for the application layer software. Communication protocol stack initialization can prepare for the communication between the microcontroller 110 and the outside. This communication protocol stack can communicate with the transceiver 130 to achieve the communication between the microcontroller 110 and the outside. It can be understood that Figure 2 The shown software initialization process is only an example. In specific implementations, the order of each step in this software initialization phase can be unrestricted, or this software initialization phase can include more or fewer steps, which can be specifically set according to actual application requirements. The embodiments of the present application do not limit this.

[0116] After the above software initialization phase ends, the operating system starts to schedule the application layer software, and the application layer software starts to run normally.

[0117] In addition, exemplarily, in the above Figure 2 it can also be seen that when the microcontroller 110 is working properly, it outputs a signal to the watchdog timer (WTD) in the system base chip 120 at regular intervals. This process is called feeding the dog and is used to detect whether the microcontroller 110 is working properly.

[0118] It can be understood that the above Figure 1 and Figure 2 shown structure of the controller 100 is only an example and does not constitute a limitation on the embodiments of the present application.

[0119] Based on the above introduction, in order to quickly restore the usage state of the vehicle's functions after the vehicle's controller is reset, the embodiments of the present application provide a reset recovery method. For example, reference can be made to Figure 3 . The method includes but is not limited to the following steps:

[0120] S301. The microcontroller completes software initialization in response to a reset instruction.

[0121] Exemplarily, the microcontroller can be, for example, the above Figure 1 or Figure 2 shown microcontroller 110.

[0122] In a specific implementation, the microcontroller is triggered to reset due to detecting an abnormality. Exemplarily, the microcontroller usually has corresponding reliability and safety requirements. Therefore, after the software runs, the system base chip (such as the above Figure 1 or Figure 2 shown system base chip 120) and / or the reset trigger detection function module in the microcontroller (which can be a software module or a hardware module) can detect the microcontroller abnormality by means of polling. And when an abnormality is detected, a reset instruction is sent to the microcontroller to trigger the reset of the microcontroller. Exemplarily, the reset instruction can be, for example, an electrical signal or a variable that notifies the microcontroller to reset, etc., and the embodiments of the present application do not limit this.

[0123] Exemplarily, the polling detection can continue until the end of the entire driving cycle (such as until the power-off ends). Reset is a common controller recovery measure, and for system transient failures, they can usually be repaired by resetting so that the controller can continue to work.

[0124] Exemplarily, the above abnormalities can be, for example, self-check errors of the microcontroller, stack overflow errors, or program flow monitoring errors, etc., and the embodiments of the present application do not limit this. For ease of understanding, the following will be introduced exemplarily in combination with a specific vehicle usage scenario.

[0125] For example, in Scenario 1, the vehicle is running normally, the PTReady state is in a ready-completed state, the gear is in the R gear (reverse gear), N gear (neutral gear), or D gear (forward gear), the vehicle is traveling in the first driving mode (such as the sport mode or the economy mode), and the single-pedal mode of the vehicle is in the state of closing the single pedal. In this scenario, if the microcontroller of the vehicle detects an abnormality, such as an abnormality in the program flow, such as a scheduling timeout. Then it will trigger the reset of the microcontroller and try to solve this abnormality by resetting and restarting.

[0126] For another example, in Scenario 2, the vehicle is in a stationary state, the PTReady state is not ready, and the gear is in the P gear. The vehicle is in a charging state or in an external power discharge state (for example, when camping, using the high-voltage battery of the vehicle to supply power to electrical equipment outside the vehicle). In this scenario, if the microcontroller of the vehicle detects an abnormality, such as an abnormality in the self-check of the microcontroller. Then it will trigger the reset of the microcontroller and try to solve this abnormality by resetting and restarting.

[0127] It can be understood that the above scenarios for the occurrence of reset are only examples and do not constitute a limitation on the embodiments of the present application. In specific implementations, there may be more other scenarios for the occurrence of reset, and the embodiments of the present application do not limit this.

[0128] Exemplarily, after the microcontroller is reset, the microcontroller will re-enter the boot phase and then start the power-on process again from the boot phase. That is, the microcontroller will re-initialize the software. For specific details, please refer to the above Figure 2 description and will not be elaborated here.

[0129] S302. The microcontroller obtains variable information; the variable information includes the status information of the target function before the occurrence of this reset, and the target function includes the functions started by the vehicle before the occurrence of this reset.

[0130] Exemplarily, the above target functions may include, for example, one or more of the following: high-voltage management function, power system ready arbitration function, gear function, vehicle mode function, single-pedal mode function, accelerator pedal processing function, power anti-theft function, and torque filtering function. It can be understood that the functions introduced here are only examples and do not constitute a limitation on the embodiments of the present application. In specific implementations, there may be more or fewer functions, and the present embodiment does not limit this.

[0131] Exemplarily, for the convenience of the following introduction, the software modules used to implement the above target functions are simply referred to as target function modules. Exemplarily, the target function module includes one or more of the following: high-voltage management module, power system ready arbitration module, gear arbitration module, vehicle mode arbitration module, single-pedal mode arbitration module, accelerator pedal processing module, power anti-theft module, and torque filtering module. It can be understood that the function modules introduced here are only examples and do not constitute a limitation on the embodiments of the present application. In specific implementations, there may be more or fewer function modules, and the present embodiment does not limit this.

[0132] Exemplarily, the above variable information may include, for example, one or more of the following: vehicle energy control request, vehicle high-voltage mode request, high-voltage enable flag, high-voltage state of the battery management system (BMS), vehicle high- and low-voltage state, charge and discharge state, PTready state, vehicle gear position, pedal learning value, power anti-theft state, vehicle mode, driving mode, single-pedal mode, scenario mode, steering mode, and electronic stability control (ESC) mode. It can be understood that the variable information introduced here is only an example and does not constitute a limitation on the embodiments of the present application. In specific implementations, more or fewer variable information may be included, and the present embodiment does not limit this.

[0133] Exemplarily, in specific implementations, after the above microcontroller completes software initialization, it can obtain variable information. In one possible implementation, the variable information can be obtained from the target storage area of the microcontroller. Exemplarily, in specific implementations, during the normal operation of the vehicle, the state of the above target function can be periodically stored in the target storage area. After the above reset of the microcontroller, the variable information obtained from the target storage area can be the state information of the target function that was last stored in the target storage area before the reset.

[0134] Exemplarily, the above target storage area is not affected by software initialization. Exemplarily, during this software initialization phase, the initialization of the target memory in the microcontroller will also be performed. That is, the data in the target memory will be erased. In one possible implementation of the embodiments of the present application, the above target storage area can be the storage area of the memory of the microcontroller. And when configuring the memory initialization, the address segment of the target storage area is excluded, that is, this address segment is not on the target memory address segment of the memory initialization. That is, the target storage area does not belong to the area in the target memory. Thus, the data written before the reset can still be saved after the reset initialization. In another possible implementation, the target storage area can also be not affected by hardware reset, that is, the data in the target storage area will not be erased after hardware reset. Thus, the state before the reset can be quickly restored based on the data in the target storage area.

[0135] In another implementation manner, the above target storage area can be the storage area of the external memory of the microcontroller. And the external memory does not need to be erased together with the software initialization, so the data written before the reset can still be saved after the reset initialization.

[0136] Exemplarily, the memory of the above microcontroller or the external memory of the microcontroller can be a memory that can be written to and read from. For example, it can be a random access memory (RAM) or a flash memory, etc. The embodiments of the present application do not limit the type of this memory.

[0137] In a possible implementation, to ensure the security of the data in the above target storage area, a security mechanism with the highest security level can be configured for the target storage area. For example, one or more of the following protection mechanisms can be configured: Error Correcting Code (ECC) mechanism, error-detectionand-correction (EDC) mechanism, access protection mechanism, etc. The embodiments of the present application do not limit this.

[0138] In a possible implementation manner, after the above microcontroller completes software initialization in response to the above reset, the operating system in the microcontroller starts to schedule the software in the application layer (including the above target function module) to run. That is, the vehicle starts to run normally. Since the vehicle will periodically store the state of the above target function in the above target storage area during normal operation. Then, after the software scheduling in the application layer is completed, new state information will be generated and stored in the target storage area. To ensure that the above variable information obtained from the target storage area is the state information stored last before the reset, the microcontroller can read the variable information from the target storage area within the first operating system scheduling cycle after the software initialization is completed. Exemplarily, the operating system scheduling cycle can be, for example, from 1 millisecond to 100 milliseconds, such as 5 milliseconds, 10 milliseconds, or 20 milliseconds, etc. The embodiments of the present application do not limit the duration of this scheduling cycle.

[0139] In another possible implementation manner, since the vehicle will periodically store the state of the above target function in the above target storage area during normal operation. Then, after the above reset occurs, the microcontroller can pause the write function of the target storage area in response to the above reset instruction. And after the microcontroller completes the above software initialization, it can timely read the above variable information from the target storage area. Exemplarily, the microcontroller can read the variable information from the target storage area within one to three scheduling cycles after the software initialization is completed. After the microcontroller reads the variable information, it can enable the write function of the target storage area. So that during normal operation of the vehicle, the state of the above target function can continue to be periodically stored in the above target storage area for use when the next reset occurs.

[0140] Exemplarily, the above microcontroller may pause the target storage area writing function in response to the above reset instruction. For example, it may send a notification to the application layer software including the above target function module to pause storing the status information to the target storage area. Or, for example, it may directly turn off the writing function of the target storage area. For example, the storage controller of the target storage area no longer writes information to the target storage area. It can be understood that the introduction here is only an example and does not constitute a limitation on the embodiments of the present application.

[0141] In another possible implementation manner, after the above microcontroller completes software initialization, it may receive the above variable information from the target device. The target device is a device independent of the above microcontroller and can be used to store the variable information. Exemplarily, the target device may be, for example, a cloud server, or a terminal device capable of communicating with the vehicle (such as a mobile phone, a tablet, or a smart wearable device, etc.), or other controllers in the vehicle, etc. The embodiments of the present application do not limit this.

[0142] Exemplarily, in specific implementation, during the normal operation of the vehicle, the vehicle may periodically or triggeringly send the status of the above target function to the above target device for storage. After the above reset occurs in the microcontroller, the microcontroller may send a request to the target device to obtain the above variable information. The target device responds to the request and sends the variable information to the microcontroller. The variable information sent by the target device to the microcontroller may be the status information of the above target function that was last stored in the target device before the reset.

[0143] S303. In the case where the variable information indicates that the reset belongs to an abnormal reset, the microcontroller skips the startup condition judgment logic of the target function and sets the status of the target function to the target status based on the variable information. The target status is the function status of the target function before the reset.

[0144] Exemplarily, in specific implementation, after the microcontroller obtains the above variable information, it may judge whether the above reset belongs to an abnormal reset based on the variable information. That is, it judges whether the reset occurs during the process when the vehicle is providing the above target function. If so, it belongs to an abnormal reset. For the sake of easy understanding, the following will be exemplarily introduced in combination with the two scenarios in the above step S301.

[0145] Exemplarily, for the above-mentioned scenario 1, i.e., when the above-mentioned reset occurs in this scenario 1, the above-mentioned variable information obtained by the microcontroller after re-initializing the software may include the information of the PTready state. Then, the microcontroller can determine whether it belongs to an abnormal reset based on the indication of this PTready state information. Specifically, if this PTready state information indicates that the power system is ready, i.e., in the ready state, it means that the vehicle was in a normal operating state before the reset (for example, refer to the vehicle state described in the above description of scenario 1). If a reset occurs at this time, it can be determined that this reset belongs to an abnormal reset.

[0146] Or, exemplarily, for the above-mentioned scenario 1, the above-mentioned variable information obtained by the microcontroller after re-initializing the software may include the information of the vehicle gear position. Then, the microcontroller can determine whether it belongs to an abnormal reset based on the indication of this vehicle gear position information. For example, if this vehicle gear position information indicates that the vehicle is in the R gear, N gear, or D gear, it means that the vehicle was reversing (corresponding to the R gear), temporarily parked (corresponding to the N gear), or moving forward normally (corresponding to the D gear) before the reset. If a reset occurs at this time, it can be determined that this reset belongs to an abnormal reset.

[0147] Or, exemplarily, for the above-mentioned scenario 1, the above-mentioned variable information obtained by the microcontroller after re-initializing the software may include the information of the vehicle driving mode. Then, the microcontroller can determine whether it belongs to an abnormal reset based on the indication of this driving mode information. For example, if this driving mode information indicates that the vehicle is in the sport mode or economy mode, it means that the vehicle was moving forward normally before the reset. If a reset occurs at this time, it can be determined that this reset belongs to an abnormal reset.

[0148] It can be understood that the above introduction to the judgment of abnormal reset in scenario 1 is only an example. In specific implementation, it can also be used to judge abnormal reset through state information such as the vehicle energy control request, vehicle high-voltage mode request, high-voltage enable flag bit, BMS high-voltage state, vehicle high and low voltage state, pedal learning value, power anti-theft state, vehicle mode, single-pedal mode, scenario mode, steering mode, or ESC mode, etc. The embodiments of the present application will not elaborate on this one by one.

[0149] In another possible implementation manner, in order to more accurately determine whether it is an abnormal reset, it can be comprehensively judged through one or more of the above-mentioned information. For example, if more than half of the multiple pieces of information can be used to judge as abnormal, it can be determined that it belongs to an abnormal reset. Or, for example, the judgment results of multiple pieces of information can be weighted and calculated to finally determine whether it belongs to an abnormal reset. It can be understood that the introduction here is only an example and does not constitute a limitation to the embodiments of the present application.

[0150] Exemplarily, for the above-mentioned scenario two, i.e., in the case of the above-mentioned reset occurring in this scenario two, the above-mentioned variable information obtained by the microcontroller after re-performing software initialization may include information on the charge and discharge state of the battery in the vehicle. Then, the microcontroller can determine whether it belongs to an abnormal reset based on the indication of the charge and discharge state information of the battery. Specifically, if the charge and discharge state information of the battery indicates that the battery is in a charging state or in an external discharge state (for example, the battery supplies power to electrical devices outside the vehicle), it indicates that the vehicle was providing a high-voltage management function and / or a vehicle mode arbitration function (arbitrating whether to provide a charging mode or a discharging mode) before the reset occurred. If a reset occurs at this time, it can be determined that this reset belongs to an abnormal reset.

[0151] It can be understood that the above introduction to determining abnormal reset is only an example and does not constitute a limitation on the embodiments of the present application.

[0152] In a specific implementation, after the microcontroller determines that the above-mentioned reset belongs to an abnormal reset, it can skip the startup condition judgment logic of the above-mentioned target function and directly set the state of the target function to the function state before the reset based on the above-mentioned variable information. For the convenience of subsequent description, the function state of the target function before this reset is simply referred to as the target state.

[0153] In a possible implementation manner, the restoration of the state of the above-mentioned target function can be completed within a first preset duration. Exemplarily, the value of the first preset duration is between three times the scheduling period and eight times the scheduling period. The scheduling period is the scheduling period of the operating system in the above-mentioned microcontroller. For example, assuming the scheduling period is 10 milliseconds, then the microcontroller can complete the restoration of the state of the above-mentioned target function between 30 milliseconds and 80 milliseconds. Another example, assuming the scheduling period is 20 milliseconds, then the microcontroller can complete the restoration of the state of the above-mentioned target function between 60 milliseconds and 160 milliseconds. It can be understood that the description of the first preset duration here is only an example and does not constitute a limitation on the embodiments of the present application. For the convenience of understanding, the following is an exemplary introduction.

[0154] In a possible implementation manner, within the first preset duration, setting the state of the target function to the target state based on variable information may include the following steps: generating a first notification message and a second notification message; the generation time interval between the first notification message and the second notification message is the first preset duration, the first notification message is used to indicate that the target function is restored to the target state (or it can also indicate that this initialization power-on process belongs to a reset power-on process), and the second notification message indicates the restoration of the function startup condition judgment logic before the reset; in response to the first notification message, start setting the state of the target function to the target state based on variable information, and complete the restoration of the target state before responding to the second notification message to restore the function startup condition judgment logic.

[0155] Exemplarily, the above first notification information and second notification information may be two values of a first target parameter generated by a microcontroller. The first target parameter may, for example, be a parameter generated by an application layer software module newly deployed in the microcontroller in the embodiments of the present application (abbreviated as a reset recovery module). Exemplarily, the first target parameter may specifically be represented as a flag bit, and the value of the flag bit is the above first notification information or second notification information. Exemplarily, the first notification information may be 0, and the second notification information may be 1. Alternatively, the first notification information may be 1, and the second notification information may be 0. It can be understood that the introduction of the values of the first notification information and the second notification information here is only an example and does not constitute a limitation on the embodiments of the present application.

[0156] Exemplarily, in a possible implementation, if the above reset occurs during the vehicle's driving (for example, refer to the above scenario one), then the above flag bit may be referred to as the "driving reset recovery flag bit" for example. Alternatively, exemplarily, in a possible implementation, if the above reset occurs during the vehicle's charging and discharging process (for example, refer to the above scenario two), then the above flag bit may be referred to as the "charging and discharging reset recovery flag bit" for example. It can be understood that the name of the flag bit here is only an example and does not constitute a limitation on the embodiments of the present application.

[0157] Specifically, after the above microcontroller determines that the above reset belongs to an abnormal reset, it may first generate the above first notification information. Here, take the first notification information being generated by the above reset recovery module as an example. After the reset recovery module generates the first notification information, it may send the first notification information to the above target function module. In addition, after the microcontroller determines that the above reset belongs to an abnormal reset, the reset recovery module also sends the above obtained variable information to the target function module.

[0158] Exemplarily, the reset recovery module may package the above obtained variable information into a structure, and then send the structure to the target function module through the run-time environment (RTE). RTE is a specific implementation of the virtual function bus of the ECU and supports communication between application layer software components, between basic software (including software such as operating systems, virtualization modules, and middleware), and between application layer software components and basic software. It can be understood that the introduction here is only an example and does not constitute a limitation on the embodiments of the present application. In specific implementations, other methods may also be used to send the variable information to the target function module.

[0159] After receiving the first notification message and the variable information, the above-mentioned target function module can start setting the state of the target function to the above-mentioned target state based on the variable information according to the indication of the first notification message. In addition, after generating the first notification message, the above-mentioned reset recovery module generates the second notification message after the above-mentioned first preset duration and sends the second notification message to the above-mentioned target function module. Then, the target function module can restore the function startup condition judgment logic of itself according to the indication of the second notification message. Then, the target function module can complete the restoration of the target state before restoring its own function startup condition judgment logic in response to the second notification message. For the convenience of understanding, the following will be described by way of examples in conjunction with the above Scenario 1 and Scenario 2.

[0160] For the reset that occurs in the above Scenario 1, exemplarily, it may include one or more of the following target function state recovery processing procedures.

[0161] For example, assume that the above-mentioned target function module includes a high-voltage management module. After receiving the first notification message and the variable information, the high-voltage management module determines that the first notification message is an information indicating to restore the function to the state before reset. Based on this, the judgment logic of the power-on state machine of the high-voltage management module is skipped, that is, the startup condition judgment logic of the high-voltage management function is skipped, and the state of the high-voltage management function is forcibly set to the high-voltage management function state indicated by the high-voltage enable flag bit in the variable information. Then, after receiving the second notification message, the high-voltage management module restores the judgment logic of the power-on state machine of the high-voltage management module, that is, makes a real-time determination according to the vehicle's high-voltage state.

[0162] For example, assume that the above-mentioned target function module includes a PT Ready arbitration module. After receiving the first notification message and the variable information, the PT Ready arbitration module determines that the first notification message is an information indicating to restore the function to the state before reset. Based on this, assuming that the PTready state indication in the variable information is the ready state, then the PT Ready arbitration module skips the startup condition judgment logic of the ready state and forcibly sets the PTready state to the ready state. Then, after receiving the second notification message, the PT Ready arbitration module restores the logic of making a real-time determination of the ready state of the PT Ready arbitration module.

[0163] For example, assume that the above-mentioned target function module includes a gear arbitration module. After receiving the above-mentioned first notification information and variable information, the gear arbitration module determines that the first notification information is information indicating that the function is to be restored to the state before reset. Based on this, the judgment logic of the gear determination state machine of the gear arbitration module is skipped, that is, the start condition judgment logic of this gear is skipped, and the state of this gear is forcibly set to the actual gear indicated by the vehicle gear in the variable information. Then, after receiving the above-mentioned second notification information, the gear arbitration module restores the logic of the real-time determination of the gear of the gear arbitration module.

[0164] For example, assume that the above-mentioned target function module includes a vehicle mode arbitration module (or a single-pedal mode arbitration module). After receiving the above-mentioned first notification information and variable information, the vehicle mode arbitration module (or the single-pedal mode arbitration module) determines that the first notification information is information indicating that the function is to be restored to the state before reset. Based on this, the mode start condition judgment logic of the vehicle mode arbitration module (or the single-pedal mode arbitration module) is skipped, and the state of the vehicle mode (or the single-pedal mode) is forcibly set to the actual mode indicated by the vehicle mode (or the single-pedal mode) in the variable information. Then, after receiving the above-mentioned second notification information, the vehicle mode arbitration module (or the single-pedal mode arbitration module) restores the logic of the real-time determination of each mode of the vehicle mode arbitration module (or the single-pedal mode arbitration module).

[0165] For example, assume that the above-mentioned target function module includes an accelerator pedal processing module. After receiving the above-mentioned first notification information and variable information, the accelerator pedal processing module determines that the first notification information is information indicating that the function is to be restored to the state before reset. Based on this, the accelerator pedal learning process is skipped, that is, the start condition judgment logic of the accelerator pedal state is skipped, and the learning value of the accelerator pedal is forcibly set to the learning value indicated by the pedal learning value in the variable information. Then, after receiving the above-mentioned second notification information, the accelerator pedal processing module restores the logic of the real-time determination of the vehicle accelerator pedal learning value of the accelerator pedal processing module.

[0166] For example, assume that the above-mentioned target function module includes a power anti-theft module. After receiving the above-mentioned first notification information and variable information, the power anti-theft module determines that the first notification information is information indicating that the function is to be restored to the state before reset. Based on this, the judgment logic of the anti-theft authentication state machine of the power anti-theft module is skipped, that is, the start condition judgment logic of this power anti-theft function is skipped, and the state of this power anti-theft is forcibly set to the state indicated by the power anti-theft state in the variable information. Then, after receiving the above-mentioned second notification information, the power anti-theft module restores the logic of the real-time determination of the anti-theft state of the power anti-theft module.

[0167] For the reset that occurs in the above Scenario 2, the exemplary target function state recovery processing procedures may include one or more of the following.

[0168] For example, assume that the above target function module includes a high-voltage management module. After receiving the above first notification information and variable information, the high-voltage management module determines that the first notification information is information indicating that the function is to be restored to the state before reset. Based on this, the judgment logic of the power-on state machine of the high-voltage management module is skipped, that is, the startup condition judgment logic of the high-voltage management function is skipped, and the state of the high-voltage management function is forcibly set to the high-voltage management function state indicated by the high-voltage enable flag bit in the variable information. Then, after receiving the above second notification information, the high-voltage management module resumes the judgment logic of the power-on state machine of the high-voltage management module, that is, makes a real-time determination according to the vehicle high-voltage state.

[0169] For example, assume that the above target function module includes a vehicle mode arbitration module. After receiving the above first notification information and variable information, the vehicle mode arbitration module determines that the first notification information is information indicating that the function is to be restored to the state before reset. Based on this, the mode startup condition judgment logic of the vehicle mode arbitration module is skipped, and the state of the vehicle mode is forcibly set to the state indicated by the charge and discharge state in the variable information. Then, after receiving the above second notification information, the vehicle mode arbitration module resumes the logic of the vehicle mode arbitration module for real-time determination of the charge and discharge mode.

[0170] It can be understood that the above introduction is only an example and does not constitute a limitation on the embodiments of the present application. In specific implementations, other functional modules may also perform corresponding operations in response to the above first notification information and second notification information, which will not be elaborated one by one.

[0171] In a possible implementation manner, within the above first preset duration, the reset recovery module may periodically send the first notification information to the above target function module. In this case, the above first notification information that triggers the target function module to start setting the state of the target function to the above target state based on the above variable information may be the notification information sent by the reset recovery module to the target function module for the first time.

[0172] In the above example, the reset recovery module packs the above obtained variable information and sends it to each functional module. In another implementation manner, the reset recovery module may send the variable information required by each functional module to the corresponding functional module. For example, taking the above PT Ready arbitration module as an example, the reset recovery module may send the variable information required by the PT Ready arbitration module (such as the PTready state, etc.) to the PT Ready arbitration module. The remaining variable information may not be sent, thereby saving transmission bandwidth.

[0173] It can be understood that both the above-mentioned reset recovery module and the above-mentioned target function module are software modules running in the microcontroller. Therefore, the operations performed by these modules described above are all operations performed by the microcontroller.

[0174] In another possible implementation manner, setting the state of the target function to the target state based on the variable information within the first preset duration may include the following steps: starting at the first moment to set the state of the target function to the target state based on the variable information, and completing the recovery of the target state before the second moment; the interval between the first moment and the second moment is the first preset duration; starting at the second moment to recover the function startup condition judgment logic of the target function before the reset.

[0175] Exemplarily, after the microcontroller determines that the above-mentioned reset belongs to an abnormal reset, the reset recovery module may send the obtained variable information to the above-mentioned target function module. For the specific introduction of the sending, reference can be made to the foregoing introduction and will not be elaborated here. After receiving the variable information, the target function module may start at the first moment to set the state of the target function to the above-mentioned target state based on the variable information. For the specific implementation of the recovery, reference can be made to the foregoing introduction and will not be elaborated here. Then, complete the recovery of the target state within the first preset duration starting from the first moment. Start recovering the function startup condition judgment logic of the target function before the reset at the second moment. Exemplarily, a timer may be set starting from the first moment, and the duration of the timer is the first preset duration. When the timer times out, the function startup condition judgment logic of the target function before the reset can be started. For the specific implementation of the recovery condition judgment logic, reference can be made to the above introduction and will not be elaborated here.

[0176] Alternatively, exemplarily, the reset recovery module may start timing when sending the variable information to the above-mentioned target function module. For example, timing through a timer. After the first preset duration, send a third notification message to the target function module. The third notification message may be the same as the above-mentioned second notification message and is used to instruct the target function module to recover the function startup condition judgment logic of the target function before the reset. For the specific details, reference can be made to the relevant introduction of the second notification message and will not be elaborated here.

[0177] It can be understood that the above introduction to the specific implementation of setting the state of the target function to the target state based on the variable information within the first preset duration is only an example and does not constitute a limitation on the embodiments of the present application.

[0178] In a possible implementation, assume that the above-mentioned microcontroller is the MCU in a controller that responds to vehicle torque requirements, such as the MCU in a VCU, HCU, VIU, or VDC. Then, if the above-mentioned reset occurs during normal vehicle driving (for example, a reset occurs in the above-mentioned Scenario 1), in order to quickly transition the vehicle torque before the reset to the latest target torque of the vehicle, a torque filtering operation can be performed after the above-mentioned target state recovery is completed.

[0179] Exemplarily, in a specific implementation, when a microcontroller reset occurs during vehicle driving, the microcontroller cannot respond to vehicle torque requirements during the reset, so the vehicle torque will decrease. In order to quickly transition to the latest target torque of the vehicle, torque filtering can be achieved with this latest target torque as the target. This latest target torque is calculated by the microcontroller based on the latest actual accelerator pedal position and the latest actual vehicle speed of the vehicle.

[0180] Exemplarily, an open-loop or closed-loop torque filtering method can be adopted. If an open-loop torque filtering method is adopted, then the microcontroller can start filtering from 0. That is, this filtering process uses 0 as the initial torque value for filtering and the above-mentioned latest target torque as the target value for filtering. If a closed-loop torque filtering method is adopted, then the microcontroller can obtain the current actual torque of the vehicle from the motor, and then use this actual torque as the initial torque value for filtering and the above-mentioned latest target torque as the target value for filtering.

[0181] Exemplarily, the above-mentioned torque filtering operation can be implemented, for example, by a torque filtering module in the microcontroller. This torque filtering module can receive a notification message (such as receiving the above-mentioned second notification message or the above-mentioned third notification message) after the above-mentioned target state recovery is completed. Then, in response to this notification message, the above-mentioned filtering operation is executed. By achieving a quick transition of the torque before the reset to the latest target torque through torque filtering after the target state recovery, vehicle oscillation can be reduced and the user experience can be improved.

[0182] In a possible implementation, during the above-mentioned reset process of the microcontroller, since it cannot correctly respond to external requirements, for the vehicle, this controller is essentially in a node loss state. In order to prevent the microcontroller from affecting the normal implementation of the functions of peripheral controllers during the reset process, the microcontroller can temporarily close the external information sending channel. After the above-mentioned target state recovery is completed, the external information sending channel of this microcontroller is reopened.

[0183] Exemplarily, in a specific implementation, the information sending channel of the microcontroller to the outside is constructed by the communication protocol stack in the microcontroller. Therefore, after the microcontroller determines that the above reset belongs to an abnormal reset, the reset recovery module can also send a notification message to the communication protocol stack. The notification message can be, for example, the above first notification message or other notification messages different from the first notification message, and the embodiments of the present application do not limit this. The communication protocol stack can close the information sending channel to the outside in response to the notification message. For example, referring to Figure 1 or Figure 2 , after closing the information sending channel to the outside, the communication protocol stack will no longer send information to the transceiver 130. However, it can receive information from the outside from the transceiver 130. For example, receive the torque information from the motor as described above. Then, after the above target state recovery is completed, for example, after the first preset duration after the reset recovery module sends a notification message to the communication protocol stack, the reset recovery module can send another notification message to the communication protocol stack. The another notification message can be, for example, the above second notification message, or the above third notification message, or other notification messages, and the embodiments of the present application do not limit this. The communication protocol stack can open the information sending channel to the outside in response to the another notification message. For example, referring to Figure 1 or Figure 2 , after opening the information sending channel to the outside, the communication protocol stack can send information to the transceiver 130.

[0184] In a possible implementation manner, in order to avoid the above information sending channel to the outside being closed for a long time, resulting in the microcontroller still being unable to normally respond to external requirements after the above target state is restored. An overtime protection mechanism for closing the information sending channel to the outside can be set. For example, after the communication protocol stack closes the information sending channel to the outside, if it still does not receive a notification message to open the information sending channel to the outside after a second preset duration. Then it will no longer continue to wait for the notification message, but directly open the information sending channel to the outside. Exemplarily, the value range of the second preset duration is from 200 ms to 300 ms.

[0185] In summary, the embodiments of the present application can determine an abnormal reset based on the variable information itself, and then restore the functional state before the reset based on the variable information. Compared with the prior art, this solution does not need to re-determine the start conditions of the vehicle's functional state, nor does it need to compare the current vehicle state with the state before the reset, so that the processing time can be greatly reduced, and the functional usage state can be quickly restored after the vehicle's controller is reset.

[0186] The above mainly introduces the reset recovery method provided by the embodiments of the present application. It can be understood that, in order to implement the corresponding functions above, each control unit or device includes the corresponding hardware structure and / or software module for executing each function. Combining the units and steps of each example described in the embodiments disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0187] The embodiments of the present application can divide the functions of the device according to the above method examples. For example, each function module can be divided corresponding to each function, or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software function module. It should be noted that the division of modules in the embodiments of the present application is illustrative, only a logical function division, and there can be other division methods in actual implementation.

[0188] In the case of dividing each function module corresponding to each function, the embodiments of the present application also provide a device for implementing any of the above methods. For example, the provided device includes units (or means) for implementing each step in any of the above methods.

[0189] For example, please refer to Figure 4 , which is a schematic structural diagram of a microcontroller 400 provided by the embodiments of the present application. Figure 4 The shown microcontroller 400 can be a microcontroller for implementing any embodiment of the above reset recovery method. The microcontroller 400 can include a processing unit 401 and an acquisition unit 402. Among them:

[0190] The processing unit 401 is used to complete software initialization in response to a reset instruction;

[0191] The acquisition unit 402 is used to acquire variable information; the variable information includes the status information of the target function before the occurrence of the reset, and the target function includes the function that the vehicle starts before the occurrence of the reset;

[0192] The processing unit 401 is further used to, when the variable information indicates that the reset belongs to an abnormal reset, skip the start condition judgment logic of the target function, and set the status of the target function to the target status based on the variable information, and the target status is the function status of the target function before the reset.

[0193] In a possible implementation manner, the acquisition unit 402 is specifically used for:

[0194] In the first operating system scheduling cycle after the software initialization is completed, obtain the variable information.

[0195] In a possible implementation, the processing unit 401 is further configured to:

[0196] When the variable information indicates that the reset belongs to an abnormal reset, close the information sending channel of the microcontroller to the outside;

[0197] And after setting the state of the target function to the target state based on the variable information, open the information sending channel of the microcontroller to the outside.

[0198] In a possible implementation, the variable information includes the power system preparation status information of the vehicle; the variable information indicating that the reset belongs to an abnormal reset includes:

[0199] When the power system preparation status information indicates that the power system is ready, the reset belongs to an abnormal reset.

[0200] In a possible implementation, the processing unit 401 is further configured to:

[0201] After setting the state of the target function to the target state based on the variable information, obtain the latest torque information of the vehicle;

[0202] Perform torque filtering based on the latest torque information.

[0203] In a possible implementation, the variable information includes the battery charge and discharge status information of the vehicle; the variable information indicating that the reset belongs to an abnormal reset includes:

[0204] When the battery charge and discharge status information indicates that the battery is in a charging state or an external discharge state, the reset belongs to an abnormal reset; the external discharge state includes the battery supplying power to devices other than the vehicle.

[0205] In a possible implementation, the processing unit 401 is specifically configured to:

[0206] Within a first preset duration, set the state of the target function to the target state based on the variable information; the value of the first preset duration is between three and eight times the duration of the scheduling cycle.

[0207] In a possible implementation, the processing unit 401 is specifically configured to:

[0208] Generate a first notification message and a second notification message; the generation time interval between the first notification message and the second notification message is the first preset duration, the first notification message is used to indicate restoring the target function to the target state, and the second notification message indicates restoring the function startup condition judgment logic of the target function before the reset.

[0209] In response to the first notification message, start setting the state of the target function to the target state based on the variable information, and complete the restoration of the target state before restoring the function startup condition judgment logic in response to the second notification message.

[0210] In a possible implementation manner, the processing unit 401 is specifically configured to:

[0211] Start setting the state of the target function to the target state based on the variable information at a first moment, and complete the restoration of the target state before a second moment; the time interval between the first moment and the second moment is the first preset duration;

[0212] Start restoring the function startup condition judgment logic of the target function before the reset at the second moment.

[0213] In a possible implementation manner, the obtaining unit 402 is specifically configured to:

[0214] Obtain the variable information in the target storage area; the target storage area belongs to the memory or external storage of the microcontroller;

[0215] In a possible implementation manner, the processing unit 401 is specifically configured to: in response to the reset instruction, complete the initialization of the target memory of the microcontroller;

[0216] If the target storage area belongs to the memory of the microcontroller, the target storage area belongs to the memory area outside the target memory.

[0217] In a possible implementation manner, the target storage area is used to periodically write the state information of the target function;

[0218] Before obtaining the variable information in the target storage area, the processing unit 401 is further configured to: pause the writing function of the target storage area based on the reset instruction.

[0219] In a possible implementation manner, the variable information includes one or more of the following:

[0220] The whole vehicle energy control request, the whole vehicle high-voltage mode request, the high-voltage enable flag bit, the high-voltage state of the battery management system, the high-low voltage state of the whole vehicle, the charge and discharge state, the power system ready state, the vehicle gear, the pedal learning value, the power anti-theft state, the vehicle mode, the driving mode, the one-pedal mode, the scenario mode, the steering mode, and the electronic stability control system mode.

[0221] In a possible implementation, the processing unit 401 is specifically configured to: after a second preset duration after closing the information sending channel of the microcontroller to the outside, open the information sending channel of the microcontroller to the outside.

[0222] Figure 4 The specific operations and beneficial effects of each unit in the shown microcontroller 400 can be referred to the corresponding descriptions in the above Figure 2 and its possible embodiments, which will not be elaborated here.

[0223] Figure 5 Shown is a possible hardware structure schematic diagram of the microcontroller provided by this application. The microcontroller can be the microcontroller in the method described in the above embodiments. The microcontroller 500 includes: a processor 501, a memory 502, and a communication interface 503. The processor 501, the communication interface 503, and the memory 502 can be connected to each other or connected to each other through a bus 504.

[0224] Exemplarily, the memory 502 is used to store the computer programs and data of the microcontroller 500. The memory 502 can include but is not limited to a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a compact disc read-only memory (CD-ROM), etc.

[0225] The software or program code required for the functions of all or part of the units of the terminal device in the above method embodiments is stored in the memory 502.

[0226] In a possible implementation, if the software or program code required for the functions of part of the units is stored in the memory 502, then in addition to calling the program code in the memory 502 to implement part of the functions, the processor 501 can also cooperate with other components (such as the communication interface 503) to jointly complete other functions described in the method embodiments (such as the function of receiving or sending data).

[0227] The number of communication interfaces 503 can be multiple, which is used to support the microcontroller 500 for communication, such as receiving or sending data or signals, etc.

[0228] Exemplarily, the processor 501 can be a central processing unit, a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The processor can also be a combination for implementing computing functions, such as a combination including one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on. The processor 501 can be used to read the program stored in the above-mentioned memory 502 and execute the operations performed by the microcontroller in the method described in the above Figure 2 and its possible embodiments.

[0229] Figure 5 For the specific operations and beneficial effects of each unit in the microcontroller 500 shown, reference can be made to the corresponding descriptions in the above method embodiments, which will not be elaborated here.

[0230] The embodiment of the present application also provides a vehicle, which includes the microcontroller described in any one of the above embodiments or includes the Figure 1 controller 100 shown above.

[0231] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the operations performed by the microcontroller in any one of the above embodiments and its possible embodiments.

[0232] The embodiment of the present application also provides a computer program product. When the computer program product is read and executed by a computer, the operations performed by the microcontroller in any one of the above embodiments and its possible embodiments will be executed.

[0233] It should be understood that in the various embodiments of the present application, the magnitude of the sequence numbers of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0234] It should also be understood that the term "comprising" (also referred to as "includes", "including", "comprises" and / or "comprising") when used in this specification specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or their groups.

[0235] It should also be understood that the "one embodiment", "an embodiment", and "a possible implementation" mentioned throughout the specification mean that the specific features, structures, or characteristics related to the embodiment or implementation are included in at least one embodiment of the present application. Therefore, the "in one embodiment" or "in an embodiment", "a possible implementation" that appear throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics can be combined in one or more embodiments in any suitable manner.

[0236] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A reset recovery method, characterized in that, The method is applied to a microcontroller of a vehicle, and the method includes: Completing software initialization in response to a reset instruction; Obtaining variable information; the variable information includes the status information of a target function before the occurrence of the reset, and the target function includes the function that the vehicle starts before the occurrence of the reset; In the case where the variable information indicates that the reset belongs to an abnormal reset, skipping the startup condition judgment logic of the target function, and setting the status of the target function to a target status based on the variable information, where the target status is the functional status of the target function before the reset.

2. The method according to claim 1, characterized in that The obtaining of the variable information includes: Obtaining the variable information within the first operating system scheduling cycle after the completion of the software initialization.

3. The method according to claim 1 or 2, characterized in that, In the case where the variable information indicates that the reset belongs to an abnormal reset, the method further includes: closing the information sending channel of the microcontroller to the outside; After setting the status of the target function to the target status based on the variable information, it further includes: opening the information sending channel of the microcontroller to the outside.

4. The method according to any one of claims 1-3, characterized in that, The variable information includes the power system readiness status information of the vehicle; The variable information indicating that the reset belongs to an abnormal reset includes: In the case where the power system readiness status information indicates that the power system is ready, the reset belongs to an abnormal reset.

5. The method according to claim 4, wherein After setting the status of the target function to the target status based on the variable information, it further includes: Obtaining the latest torque information of the vehicle; Performing torque filtering based on the latest torque information.

6. The method according to any one of claims 1-5, characterized in that, The variable information includes the battery charge and discharge status information of the vehicle; The variable information indicating that the reset belongs to an abnormal reset includes: In the case where the battery charge and discharge status information indicates that the battery is in a charging state or an external discharging state, the reset belongs to an abnormal reset; The state of external discharging includes the battery supplying power to devices outside the vehicle.

7. The method according to any one of claims 1-6, characterized in that Setting the status of the target function to the target status based on the variable information includes: Within a first preset duration, setting the status of the target function to the target status based on the variable information; the value of the first preset duration is between three and eight times the duration of the scheduling cycle.

8. The method according to claim 7, wherein The setting the status of the target function to the target status within the first preset duration based on the variable information includes: Generating a first notification message and a second notification message; the generation time interval between the first notification message and the second notification message is the first preset duration, the first notification message is used to indicate restoring the target function to the target status, and the second notification message indicates restoring the function startup condition judgment logic before the reset; In response to the first notification message, starting to set the status of the target function to the target status based on the variable information, and completing the restoration of the target status before restoring the function startup condition judgment logic in response to the second notification message.

9. The method according to claim 7, wherein The setting the status of the target function to the target status within the first preset duration based on the variable information includes: At the first moment, start setting the state of the target function to the target state based on the variable information, and complete the restoration of the target state before the second moment; the first moment and the second moment are separated by the first preset duration; At the second moment, start restoring the function startup condition judgment logic of the target function before the reset.

10. The method according to any one of claims 1-9, characterized in that, The obtaining of the variable information includes: Obtain the variable information in the target storage area; the target storage area belongs to the memory or external memory of the microcontroller.

11. The method according to claim 10, wherein The completing of the software initialization in response to the reset instruction includes: completing the initialization of the target memory of the microcontroller in response to the reset instruction; If the target storage area belongs to the memory of the microcontroller, the target storage area belongs to the memory area outside the target memory.

12. The method according to claim 10 or 11, characterized in that, The target storage area is used to periodically write the status information of the target function; before obtaining the variable information in the target storage area, it further includes: suspending the write function of the target storage area based on the reset instruction.

13. The method according to any one of claims 1 to 10, characterized in that, The obtaining of the variable information includes: Receive the variable information from the target device; the target device is independent of the microcontroller and can be used to store the variable information.

14. The method according to any one of claims 1-13, characterized in that, The variable information includes one or more of the following: Vehicle energy control request, vehicle high-voltage mode request, high-voltage enable flag, battery management system high-voltage state, vehicle high-low voltage state, charge and discharge state, powertrain readiness state, vehicle gear, pedal learning value, power anti-theft state, vehicle mode, driving mode, single-pedal mode, scenario mode, steering mode, and electronic stability control system mode.

15. The method according to claim 3, characterized in that, The opening of the information sending channel of the microcontroller to the outside includes: After a second preset duration from the closing of the information sending channel of the microcontroller to the outside, open the information sending channel of the microcontroller to the outside.

16. A microcontroller, characterized in that, The microcontroller includes: A processing unit for completing software initialization in response to a reset instruction; An obtaining unit for obtaining variable information; the variable information includes the status information of the target function before the reset occurs, and the target function includes the functions for vehicle startup before the reset occurs; The processing unit is further configured to, when the variable information indicates that the reset belongs to an abnormal reset, skip the function startup condition judgment logic of the target function, and set the state of the target function to the target state based on the variable information, where the target state is the function state of the target function before the reset.

17. The microcontroller according to claim 16, wherein, The obtaining unit is specifically configured to: Obtain the variable information within the first operating system scheduling cycle after the software initialization is completed.

18. The microcontroller according to claim 16 or 17, characterized in that, The processing unit is further configured to: When the variable information indicates that the reset belongs to an abnormal reset, close the information sending channel of the microcontroller to the outside; And after setting the state of the target function to the target state based on the variable information, open the information sending channel of the microcontroller to the outside.

19. The microcontroller according to any one of claims 16 - 18, characterized in that, The variable information includes the powertrain readiness state information of the vehicle; The variable information indicating that the reset belongs to an abnormal reset includes: In the case where the power system readiness information indicates that the power system is ready, the reset belongs to an abnormal reset.

20. The microcontroller according to claim 19, characterized in that, The processing unit is further configured to: After setting the state of the target function to the target state based on the variable information, obtain the latest torque information of the vehicle; Perform torque filtering based on the latest torque information.

21. The microcontroller according to any one of claims 16-20, characterized in that, The variable information includes the battery charge and discharge state information of the vehicle; The variable information indicating that the reset belongs to an abnormal reset includes: In the case where the battery charge and discharge state information indicates that the battery is in a charging state or an external discharging state, the reset belongs to an abnormal reset; The external discharging state includes the battery supplying power to devices outside the vehicle.

22. The microcontroller according to any one of claims 16-21, characterized in that, The processing unit is specifically configured to: Within a first preset duration, set the state of the target function to the target state based on the variable information; the value of the first preset duration is between three and eight times the duration of the scheduling period.

23. The microcontroller according to claim 22, characterized in that, The processing unit is specifically configured to: Generate a first notification message and a second notification message; the generation time interval between the first notification message and the second notification message is the first preset duration, the first notification message is used to indicate restoring the target function to the target state, and the second notification message indicates restoring the function startup condition judgment logic of the target function before the reset; In response to the first notification message, start setting the state of the target function to the target state based on the variable information, and complete the restoration of the target state before restoring the function startup condition judgment logic in response to the second notification message.

24. The microcontroller according to claim 22, wherein, The processing unit is specifically configured to: Start setting the state of the target function to the target state based on the variable information at a first moment, and complete the restoration of the target state before a second moment; the interval between the first moment and the second moment is the first preset duration; Start restoring the function startup condition judgment logic of the target function before the reset at the second moment.

25. The microcontroller according to any one of claims 16 - 24, characterized in that, The acquisition unit is specifically configured to: Acquire the variable information in the target storage area; the target storage area belongs to the internal memory or external memory of the microcontroller.

26. The microcontroller according to claim 25, characterized in that, The processing unit is specifically configured to: in response to the reset instruction, complete the initialization of the target memory of the microcontroller; If the target storage area belongs to the internal memory of the microcontroller, the target storage area belongs to the memory area outside the target memory.

27. The microcontroller according to claim 25 or 26, characterized in that, The target storage area is used to periodically write the state information of the target function; Before acquiring the variable information in the target storage area, the processing unit is further configured to: pause the writing function of the target storage area based on the reset instruction.

28. The microcontroller according to any one of claims 16 - 27, characterized in that, The variable information includes one or more of the following: Vehicle energy control request, vehicle high-voltage mode request, high-voltage enable flag, battery management system high-voltage state, vehicle high and low voltage state, charge and discharge state, power system readiness state, vehicle gear, pedal learning value, power anti-theft state, vehicle mode, driving mode, single-pedal mode, scenario mode, steering mode, and electronic stability control system mode.

29. The microcontroller according to claim 18, wherein The processing unit is specifically configured to: after a second preset duration after closing the information sending channel of the microcontroller to the outside, open the information sending channel of the microcontroller to the outside.

30. A microcontroller, characterized in that, The microcontroller includes a processor and a memory. Wherein, the memory is used to store computer programs or computer instructions, and the processor is used to execute the computer programs or computer instructions stored in the memory, so that the microcontroller executes the method according to any one of claims 1-15.

31. A controller, characterized in that, The controller includes a system base chip, a transceiver and a microcontroller; wherein, the microcontroller is the microcontroller according to any one of claims 16-29, or the microcontroller according to claim 30; the system base chip is used to supply power to the microcontroller; the transceiver is used to provide external communication for the microcontroller.

32. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer programs or computer instructions, and the computer programs or computer instructions are executed by a processor to implement the method according to any one of claims 1-15.

Citation Information

Cited By

  • Resetting restoration method and related apparatus

    WO2025152882A1