Abnormality detection method and device, vehicle and storage medium
By acquiring the number of times the ECU is powered on and hibernated, the operating status of the ECU after its most recent wake-up state is determined, which solves the problem of abnormal vehicle function caused by abnormal power loss of the ECU, and achieves efficient and reliable detection and energy consumption reduction.
Patent Information
- Application Number
- CN202511362286.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2025-11-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In existing technologies, the ECU may experience abnormal power loss in the vehicle control system, leading to abnormal vehicle functions. Therefore, it is necessary to effectively detect and reduce its impact on vehicle functions.
By obtaining the number of power-on and sleep cycles of the ECU, the operating status of the ECU after the most recent wake-up state can be determined. The equality of the number of power-on and sleep cycles can be used to determine whether an abnormal power failure has occurred, simplifying the detection process and improving reliability.
It enables timely detection of abnormal power loss of ECU, improves detection reliability, reduces the impact of abnormal power loss on vehicle functions, improves detection efficiency and reduces energy consumption.
Smart Images

Figure CN120963567A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The embodiment of the present application relates to the technical field of vehicles, and relates to but is not limited to an abnormality detection method and device, a vehicle and a storage medium. BACKGROUND
[0002] In the current vehicle control technology, the control system of a vehicle usually includes an electronic control unit (ECU), and various functions of the vehicle can be controlled and implemented by the ECU.
[0003] It is found in practice that the ECU may have an abnormal power-off during the working process, which may cause abnormality of the vehicle function controlled by the ECU, and thus it is necessary to detect the abnormal power-off of the ECU to take corresponding measures. Therefore, how to detect the abnormal power-off of the ECU becomes a technical problem to be solved. SUMMARY
[0004] Therefore, the embodiment of the present application provides an abnormality detection method and device, a vehicle and a storage medium, which can not only detect the abnormal power-off of the ECU in time, but also improve the reliability of the abnormal power-off detection of the ECU, so as to reduce the influence of the abnormal power-off of the ECU on the normal operation of the vehicle function.
[0005] The abnormality detection method provided by the embodiment of the present application is applied to a vehicle, the vehicle includes an ECU, and the method includes the following steps.
[0006] Obtaining the power-on times and the sleep times of the ECU, the power-on times being the cumulative times of the ECU in an awake state, and the sleep times being the cumulative times of the ECU in a sleep state;
[0007] According to the power-on times and the sleep times, determining the running state of the ECU after the ECU is in the awake state last time, the running state including abnormal power-off or non-abnormal power-off.
[0008] In the above embodiment, the running state of the ECU after the ECU is in the awake state last time is determined by the cumulative power-on times of the ECU in the awake state and the cumulative sleep times of the ECU in the sleep state, so that whether the ECU has abnormal power-off after the ECU is in the awake state last time can be detected, that is, the running state of the ECU after the ECU is in the awake state last time is detected, and thus the abnormal power-off of the ECU can be detected in time, and the reliability of the detection of the abnormal power-off of the ECU is improved by the quantifiable power-on times and sleep times, so as to reduce the influence of the abnormal power-off of the ECU on the normal operation of the vehicle function.
[0009] In some embodiments, the determining the running state of the ECU after the ECU is last time in the wake-up state according to the power-on times and the sleep times comprises:
[0010] In the case that the power-on times are equal to the sleep times, determining the running state of the ECU after the ECU is last time in the wake-up state as the non-abnormal power-off; or,
[0011] In the case that the power-on times are not equal to the sleep times, determining the running state of the ECU after the ECU is last time in the wake-up state as the abnormal power-off.
[0012] In the above embodiments, if the power-on times are equal to the sleep times, it is determined that the running state of the ECU after the ECU is last time in the wake-up state is the non-abnormal power-off, that is, the ECU does not have abnormal power-off after being last time in the wake-up state; otherwise, if the power-on times are not equal to the sleep times, it is determined that the running state of the ECU after the ECU is last time in the wake-up state is the abnormal power-off, that is, the ECU has abnormal power-off after being last time in the wake-up state. This way does not need to perform a complex calculation process to detect whether the ECU has abnormal power-off, improves the detection efficiency of the abnormal power-off of the ECU, and to some extent, also reduces the energy consumption of the vehicle.
[0013] In some embodiments, the obtaining the power-on times and the sleep times of the ECU comprises:
[0014] In the case that the ECU is in the wake-up state, obtaining the power-on times and the sleep times of the ECU.
[0015] In the above embodiments, the power-on times and the sleep times of the ECU are obtained only in the case that the ECU is in the wake-up state, that is, the abnormal power-off of the ECU is detected only after the ECU is woken up. This way can timely combine the detection result of whether the ECU has abnormal power-off last time based on the power-on times and the sleep times in the scene that the ECU is in the wake-up state this time, which can effectively avoid the adverse effects on the working process of the ECU after being in the wake-up state this time.
[0016] In some embodiments, after the power-on times and the sleep times of the ECU are obtained in the case that the ECU is in the wake-up state, the method further comprises:
[0017] performing a counting operation on the power-on times to obtain counted power-on times, the counted power-on times being the sum of the sleep times and a preset step length.
[0018] In the above embodiment, the vehicle can also perform counting operation on the power-on number after the ECU is in the wake-up state this time, that is, the scheme can update the accumulated power-on number of the ECU in time after the ECU is in the wake-up state. Moreover, if the ECU has abnormal power-off after being in the wake-up state the last time, which will cause the accumulated sleep number to be inaccurate, and the sum of the accumulated sleep number of the ECU in the sleep state and the preset step length is taken as the counted power-on number, then when detecting whether the ECU has abnormal power-off after being in the wake-up state this time, even if the ECU has abnormal power-off after being in the wake-up state the last time, the counted power-on number can still be used to detect whether the ECU has abnormal power-off after being in the wake-up state this time, thereby ensuring the reliability and stability of detection of whether the ECU has abnormal power-off each time.
[0019] In some embodiments, the method further comprises:
[0020] In the case where the ECU switches from the wake-up state to the sleep state, performing counting operation on the sleep number to obtain a counted sleep number, the counted sleep number being the sum of the sleep number and the preset step length.
[0021] In the above embodiment, when the ECU switches from the wake-up state to the sleep state this time, it indicates that the ECU has not had abnormal power-off after being woken up this time, so counting operation can also be performed on the sleep number, that is, the scheme can update the accumulated sleep number of the ECU in time after the ECU is in the wake-up state without abnormal power-off. Moreover, the sum of the accumulated sleep number of the ECU in the sleep state and the preset step length is taken as the counted sleep number, which not only simplifies the complexity of performing counting operation on the sleep number, but also can still detect whether the ECU has abnormal power-off after being in the wake-up state this time based on the accumulated sleep number of the ECU in the sleep state, thereby also ensuring the reliability and stability of detection of whether the ECU has abnormal power-off each time.
[0022] In some embodiments, after the ECU is in the wake-up state, the method further comprises:
[0023] performing counting operation on the power-on number to obtain a counted power-on number, the counted power-on number being the sum of the power-on number and the preset step length.
[0024] In the above embodiment, the vehicle can also perform counting operation on the power-on number after the ECU is in the wake-up state this time, that is, the present scheme can update the accumulated power-on number of the ECU in time after the ECU is in the wake-up state. Moreover, the sum of the accumulated power-on number of the ECU in the wake-up state and the preset step length is taken as the counted power-on number, which not only simplifies the complexity of the counting operation on the power-on number, but also can detect whether the abnormal power-off occurs after the ECU is in the wake-up state this time based on the accumulated power-on number of the ECU in the wake-up state, thereby guaranteeing the reliability and stability of the detection of whether the abnormal power-off occurs each time.
[0025] In some embodiments, the method further comprises:
[0026] In the case that the ECU switches from the wake-up state to the sleep state, counting operation is performed on the sleep number to obtain a counted sleep number, and the counted sleep number is the sum of the power-on number and the preset step length.
[0027] In the above embodiment, in the case that the ECU switches from the wake-up state to the sleep state this time, it indicates that the ECU does not have abnormal power-off after being woken up this time, so counting operation can also be performed on the sleep number, that is, the present scheme can update the accumulated sleep number of the ECU in time in the case that the ECU does not have abnormal power-off after being in the wake-up state this time. Moreover, the abnormal power-off after the ECU is in the wake-up state last time will cause the accumulated sleep number to be inaccurate, and then the sum of the accumulated power-on number of the ECU in the wake-up state and the preset step length is taken as the counted sleep number, so that in the detection of whether the abnormal power-off occurs after the ECU is in the wake-up state this time, even if the abnormal power-off occurs after the ECU is in the wake-up state last time, the counted sleep number can still be used to detect whether the abnormal power-off occurs after the ECU is in the wake-up state this time, thereby guaranteeing the reliability and stability of the detection of whether the abnormal power-off occurs each time.
[0028] In some embodiments, the method further comprises:
[0029] In the case that the running state of the ECU after being in the wake-up state last time is the abnormal power-off, the power-on number is reset to a preset power-on number and the sleep number is reset to a preset sleep number, and the preset power-on number is equal to the preset sleep number.
[0030] In the above embodiment, when it is detected that the ECU has an abnormal power-off after being in the wake-up state last time, the power-on times and the sleep times are reset, that is, the subsequent counting operation and detection process are continued based on the preset power-on times and the preset sleep times after being reset, so as to avoid the inaccurate sleep times accumulated due to the abnormal power-off of the ECU after being in the wake-up state last time from having an adverse effect on the detection result, thereby ensuring the accuracy and reliability of the detection of whether the ECU has an abnormal power-off each time.
[0031] In some embodiments, the method further includes:
[0032] In the case where the running state of the ECU after being in the wake-up state last time is the abnormal power-off, the functional module controlled by the ECU in the wake-up state last time is initialized.
[0033] In the above embodiment, when it is detected that the ECU has an abnormal power-off after being in the wake-up state last time, the functional module controlled by the ECU in the wake-up state last time is initialized, thereby reducing the influence of the abnormal power-off of the ECU on the normal running of the vehicle.
[0034] The abnormal detection device provided by the embodiment of the present application is applied to a vehicle, and the vehicle includes a controller ECU. The device includes:
[0035] The obtaining module is configured to obtain the power-on times and the sleep times of the ECU, the power-on times being the cumulative times of the ECU in the wake-up state, and the sleep times being the cumulative times of the ECU in the sleep state.
[0036] The determining module is configured to determine the running state of the ECU after being in the wake-up state last time according to the power-on times and the sleep times, the running state including abnormal power-off or non-abnormal power-off.
[0037] The vehicle provided by the embodiment of the present application includes a memory and a processor. The memory stores a computer program capable of running on the processor. When the processor executes the program, the method provided by the embodiment of the present application is implemented.
[0038] The computer readable storage medium provided by the embodiment of the present application stores a computer program. When the computer program is executed by a processor, the method provided by the embodiment of the present application is implemented.
[0039] The computer program product provided by the embodiment of the present application includes a computer program. When the computer program is executed by a processor, the method provided by the embodiment of the present application is implemented. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0041] Figure 1 is a structural schematic diagram of a vehicle disclosed by an embodiment of the present application;
[0042] Figure 2 is a structural schematic diagram of another vehicle disclosed by an embodiment of the present application;
[0043] Figure 3 is a flow schematic diagram of an abnormality detection method disclosed by an embodiment of the present application;
[0044] Figure 4 is a flow schematic diagram of another abnormality detection method disclosed by an embodiment of the present application;
[0045] Figure 5 is a flow schematic diagram of another abnormality detection method disclosed by an embodiment of the present application;
[0046] Figure 6 is a flow schematic diagram of another abnormality detection method disclosed by an embodiment of the present application;
[0047] Figure 7 is a flow schematic diagram of another abnormality detection method disclosed by an embodiment of the present application;
[0048] Figure 8 is a structural schematic diagram of an abnormality detection device disclosed by an embodiment of the present application;
[0049] Figure 9 is a structural schematic diagram of a vehicle disclosed by an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the embodiments of the present application more clear, the following will further describe the specific technical solutions of the present application in combination with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but not to limit the scope of the present application.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for describing the embodiments of the present application only and not intended to limit the present application.
[0052] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets as each other and as all possible embodiments, and can be combined with each other where appropriate without conflict.
[0053] It should be noted that the terms "first", "second", "third" involved in the embodiments of the present application are used to distinguish similar or different objects, and do not represent a specific order of the objects. Understandably, "first", "second", "third" can be interchanged in a specific order or sequence as appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0054] In the current vehicle control technology, the control system of the vehicle usually includes a controller ECU. The ECU is an electronic control unit used to control the electrical system, electronic system, etc. in the vehicle system, and various functions of the vehicle can be controlled and implemented by the ECU. At the same time, with the development of vehicle intelligence, the functions on the vehicle are also increasing. Since each function needs to be controlled and implemented by the ECU, the number of ECUs on the vehicle is also increasing, and the working conditions faced by each ECU are also becoming more and more complex.
[0055] It is found in practice that the ECU may have an abnormal power failure during operation. The abnormal power failure can be understood as the power supply of the ECU being abnormally cut off during the operation of the ECU. If the ECU has an abnormal power failure, the vehicle function controlled by the ECU will be abnormal, for example, the ECU has an abnormal power failure, resulting in loss of initialization state of the window function, memory error of the air conditioning control system air outlet position, etc. Even after the ECU is powered again, the air outlet position may still be abnormally adjusted, and must be manually initialized to recover to normal. Therefore, it is necessary to detect the abnormal power failure of the ECU to take corresponding measures.
[0056] Therefore, how to detect the abnormal power failure of the ECU becomes a technical problem to be solved.
[0057] Therefore, the embodiments of the present application provide an abnormality detection method and device, a vehicle and a storage medium. The method is applied to a vehicle, and the vehicle includes a controller ECU. The method includes: obtaining the power-on times and the sleep times of the ECU. The power-on times are the cumulative number of times that the ECU is in an awake state, and the sleep times are the cumulative number of times that the ECU is in a sleep state. According to the power-on times and the sleep times, the running state of the ECU after the last time in the awake state is determined. The running state includes abnormal power failure or no abnormal power failure. The embodiments of the present application not only can detect the abnormal power failure of the ECU in time, but also improve the reliability of the ECU abnormal power failure detection, so as to reduce the influence of the ECU abnormal power failure on the normal operation of the vehicle function.
[0058] In order to make the purpose, technical solutions of the present application more clear and intuitive, the abnormality detection method disclosed by the present application is described below in combination with the drawings.
[0059] Please refer to Figure 1 , Figure 1 is a structural schematic diagram of a vehicle disclosed by an embodiment of the present application. As shown in Figure 1 , the vehicle includes a controller ECU, and the number of ECUs included in the vehicle can be one or more, which is not limited.
[0060] As shown in Figure 1 , the vehicle also includes a non-volatile memory (NVM), which means that the data stored in the NVM will not disappear even after the power of the vehicle is turned off, and is mainly used for storing important data that cannot be lost after power failure. Optionally, the NVM can be a universal flash storage (UFS), a read-only memory (ROM), a programmable read-only memory (PROM), a flash memory, etc.
[0061] It should be noted that the vehicle also includes volatile storage such as random access memory (RAM), dynamic random access memory (DRAM), cache memory, etc., and the data stored in the volatile storage will be lost after the power of the vehicle is turned off, but the read-write speed thereof is extremely fast, and the volatile storage is mainly used for storing temporary data that is relatively unimportant for the vehicle. The type of the storage other than the NVM in the vehicle is not limited in the present application.
[0062] Please refer to Figure 2 , Figure 2 is another structural schematic diagram of a vehicle disclosed by an embodiment of the present application. As shown in Figure 2 , the vehicle includes an ECU and an NVM, and the ECU includes a micro control unit (MCU). The MCU is a kind of microcomputer that integrates a central processing unit, a memory, a timer, a counter, various input and output interfaces, etc. on a chip of integrated circuit, and can be understood as the core hardware basis for the ECU to realize control functions.
[0063] It should be noted that Figures 1 to 2The structure of the vehicle shown in the figure does not constitute a specific limitation of the vehicle. The components of the vehicle can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware. That is, the vehicle disclosed in the embodiments of the present application can also include Figures 1 to 2 other components not shown in the figure.
[0064] Based on the above introduction of the vehicle, the present application provides an abnormality detection method, which can detect the abnormal power-off of the ECU.
[0065] The abnormality detection method disclosed in the present application will be described in detail below with the vehicle as an example. Please refer to Figure 3 , Figure 3 is a flowchart of an abnormality detection method disclosed in the embodiments of the present application. As shown in the method Figure 3 may include the following steps:
[0066] Step 301, the vehicle obtains the power-on times and the sleep times of the ECU. The power-on times are the cumulative times of the ECU in the wake-up state, and the sleep times are the cumulative times of the ECU in the sleep state.
[0067] In the embodiments of the present application, the ECU in the running process can include a wake-up state and a sleep state. The wake-up state is used to indicate the running state of the ECU being awakened to enter the normal working phase, and when the ECU is in the wake-up state, the preset task can be executed to realize the vehicle function. The sleep state is used to indicate the running state of the ECU entering the low-power consumption phase after completing the preset task. If the ECU is awakened and no abnormal power-off occurs, the ECU can normally enter the sleep state, and if the abnormal power-off occurs, the ECU cannot normally enter the sleep state. It should be understood that the power supply to the ECU does not need to be cut off in the sleep state, only the voltage of the ECU needs to be reduced, which not only saves the power of the vehicle, but also does not need to frequently perform the power-off operation on the ECU.
[0068] It should be noted that the preset task can be set by the person skilled in the art according to the number of ECUs and the various functional modules in the vehicle control system, for example, the ECU can control the vehicle window module to realize the closing or opening of the vehicle, which will not be described herein.
[0069] In some embodiments, the vehicle further comprises a power supply unit configured to output a power supply voltage to the ECU, so that the ECU can normally work in the wake-up state. The voltage of the ECU in the wake-up state is greater than or equal to a preset power supply voltage, the voltage of the ECU in the sleep state is less than the preset power supply voltage, and the preset power supply voltage is a voltage supporting the ECU to normally work in the wake-up state. It should be noted that the preset power supply voltage can be set by those skilled in the art according to actual needs, for example, 3.3V, 5V, etc.
[0070] In the embodiments of the present application, when the ECU is woken up each time and is in the wake-up state, a counting operation is performed on the power-on times of the ECU to obtain the cumulative times of the ECU in the wake-up state, i.e., the power-on times. When the ECU completes a preset task each time and is about to enter or has entered the sleep state, a counting operation is performed on the sleep times of the ECU to obtain the cumulative times of the ECU in the sleep state, i.e., the sleep times. For example, assuming that the ECU is in the wake-up state for 3 times, the power-on times are 3, and assuming that the ECU is in the sleep state for 3 times, the sleep times are 3, i.e., the power-on times and the sleep times in the embodiments of the present application refer to the cumulative times.
[0071] In some embodiments, the vehicle can obtain the power-on times and the sleep times of the ECU at preset time intervals. That is, the power-on times and the sleep times of the ECU can be periodically obtained at certain preset time intervals. It should be understood that since the power-on times and the sleep times of the ECU are periodically obtained, the ECU can be in the wake-up stage or in the sleep stage when the power-on times and the sleep times of the ECU are obtained each time.
[0072] Optionally, the NVM is configured to store the power-on times and the sleep times, and the vehicle obtains the power-on times and the sleep times of the ECU, including: the vehicle obtains the power-on times and the sleep times of the ECU from the NVM. For example, the NVM stores the values of the power-on times (changed_counter) and the sleep times (sleep_counter), and assuming that the changed_counter=3 and the sleep_counter=3 are obtained from the NVM, i.e., the power-on times are 3 and the sleep times are 3.
[0073] In step 302, the vehicle determines the running state of the ECU after the ECU is in the wake-up state last time according to the power-on times and the sleep times, and the running state includes abnormal power-off or non-abnormal power-off.
[0074] In the embodiment of the present application, the vehicle can compare the obtained power-on times and sleep times to determine the running state of the ECU after the ECU was last in the wake-up state. That is, since the power-on times are the cumulative number of times that the ECU was in the wake-up state, and the sleep times are the cumulative number of times that the ECU was in the sleep state, the running state of the ECU after the ECU was last in the wake-up state can be detected.
[0075] Next, an embodiment of determining the running state of the ECU after the ECU was last in the wake-up state according to the power-on times and the sleep times is described.
[0076] In case 1, the vehicle determines the running state of the ECU after the ECU was last in the wake-up state according to the power-on times and the sleep times, including: in the case that the power-on times are equal to the sleep times, the vehicle determines that the running state of the ECU after the ECU was last in the wake-up state is normal power-off. It should be noted that normal power-off is used to indicate that the ECU was last in the wake-up state and completed the preset task, and then normally switched to the sleep state.
[0077] It should be understood that when the power-on times are equal to the sleep times, it indicates that the ECU was last woken up and normally switched to the sleep state after completing the preset task, i.e., the ECU did not have abnormal power-off after being last in the wake-up state, so it can be determined that the running state of the ECU after the ECU was last in the wake-up state is normal power-off. For example, if the power-on times changed_counter1 = 3 and the sleep times sleep_counter1 = 3, it indicates that the power-on times are equal to the sleep times, so it is determined that the ECU did not have abnormal power-off after being last in the wake-up state.
[0078] In case 2, the vehicle determines the running state of the ECU after the ECU was last in the wake-up state according to the power-on times and the sleep times, including: in the case that the power-on times are not equal to the sleep times, the vehicle determines that the running state of the ECU after the ECU was last in the wake-up state is abnormal power-off. It can be understood that when the power-on times are not equal to the sleep times, it indicates that the ECU was last woken up and did not normally switch to the sleep state, i.e., the ECU had abnormal power-off after being last in the wake-up state, so it can be determined that the running state of the ECU after the ECU was last in the wake-up state is abnormal power-off. For example, if the power-on times changed_counter1 = 3 and the sleep times sleep_counter1 = 2, it indicates that the power-on times are greater than the sleep times (i.e., not equal), so it is determined that the ECU had abnormal power-off after being last in the wake-up state.
[0079] In the above two cases, if the number of power-on times and the number of sleep times are equal, it is determined that the running state of the ECU after the ECU is in the wake-up state last time is not abnormal power-off, that is, the ECU does not have abnormal power-off after the ECU is in the wake-up state last time. On the contrary, if the number of power-on times and the number of sleep times are not equal, it is determined that the running state of the ECU after the ECU is in the wake-up state last time is abnormal power-off, that is, the ECU has abnormal power-off after the ECU is in the wake-up state last time. In this way, without performing a complex calculation process, the abnormal power-off of the ECU can be detected, the detection efficiency of the abnormal power-off of the ECU is improved, and the energy consumption of the vehicle is reduced to some extent.
[0080] It can be seen that by using the number of power-on times and the number of sleep times accumulated when the ECU is in the wake-up state and the sleep state, the running state of the ECU after the ECU is in the wake-up state last time is determined, so that whether the ECU has abnormal power-off after the ECU is in the wake-up state last time can be detected. That is, since the running state of the ECU after the ECU is in the wake-up state last time is detected, the abnormal power-off of the ECU can be detected in time, and the reliability of detecting the abnormal power-off of the ECU is improved by using the quantifiable number of power-on times and the number of sleep times, so that the influence of the abnormal power-off of the ECU on the normal running of the vehicle is reduced.
[0081] In some embodiments, the vehicle can also perform counting operations on the number of power-on times and the number of sleep times. The number of power-on times and the number of sleep times will be described below. Figure 4 The embodiment will be described below. Please refer to Figure 4 , Figure 4 is a flowchart of another abnormality detection method disclosed in the embodiments of the present application. As shown in the method shown in Figure 4 may include the following steps:
[0082] In step 401, the vehicle obtains the number of power-on times and the number of sleep times of the ECU when the ECU is in the wake-up state. The number of power-on times is the cumulative number of times that the ECU is in the wake-up state, and the number of sleep times is the cumulative number of times that the ECU is in the sleep state.
[0083] In some embodiments, the vehicle can also switch the ECU from the sleep state to the wake-up state in response to the wake-up trigger event of the ECU. That is, when the ECU is in the sleep state, if the wake-up trigger event of the ECU is received, the ECU is switched from the sleep state to the wake-up state in response to the wake-up trigger event, that is, the ECU is woken up.
[0084] It can be understood that when the ECU is woken up and in the wake-up state, the power supply unit outputs voltage to the ECU according to the preset power supply voltage, so that the ECU can work normally in the wake-up state.
[0085] Optionally, the vehicle obtains the power-on times and the sleep times of the ECU in the case that the ECU is in the wake-up state, comprising: the vehicle obtains the power-on times and the sleep times of the ECU from the NVM in the case that the ECU is in the wake-up state.
[0086] In the embodiment of step 401, the power-on times and the sleep times of the ECU are obtained in the case that the ECU is in the wake-up state, that is, the abnormal power-off condition of the ECU is detected only after the ECU is woken up. In this way, in the scenario that the ECU is in the wake-up state this time, the detection result of whether the ECU has an abnormal power-off last time based on the power-on times and the sleep times can be combined in time, which can effectively avoid the adverse effects on the working process of the ECU after the ECU is in the wake-up state this time.
[0087] Other embodiments of step 401 can correspond to the content in the foregoing step 301, which will not be described here.
[0088] Step 402, the vehicle determines the running state of the ECU after the ECU is in the wake-up state last time according to the power-on times and the sleep times, and the running state comprises abnormal power-off or non-abnormal power-off.
[0089] Embodiments of step 402 can correspond to the content in the foregoing step 302, which will not be described here.
[0090] Step 403, the vehicle performs a counting operation on the power-on times to obtain counted power-on times, and the counted power-on times are the sum of the sleep times and a preset step length.
[0091] In the embodiments of the present application, the vehicle can also perform a counting operation on the power-on times after the ECU is in the wake-up state this time, which can be understood as recording the power-on condition of the ECU after the ECU is in the wake-up state this time. That is, the vehicle can update the accumulated power-on times of the ECU in time after the ECU is in the wake-up state, that is, the accumulated times of the ECU in the wake-up state are updated in time.
[0092] In some embodiments, the vehicle can perform a counting operation on the power-on times to obtain counted power-on times in the case that the ECU is in the wake-up state and a preset condition is met. The preset condition is used to indicate the triggering condition of the ECU performing a certain preset task, that is, if the preset task triggering condition is met, the ECU will perform the preset task after power-on. It should be noted that the preset task can be receiving a message for window control of a certain controller.
[0093] In the embodiment of the present application, if the ECU has an abnormal power-off after being in the wake-up state last time, the accumulated sleep count is inaccurate. Then, after the ECU is in the wake-up state, the vehicle can perform counting operation on the power-on count according to the preset power-on counting rule, the preset power-on counting rule is to take the sum of the sleep count and the preset step length as the counted power-on count, so that the counted power-on count is the sum of the sleep count and the preset step length. When detecting whether the ECU has an abnormal power-off after being in the wake-up state this time, even if the ECU has an abnormal power-off after being in the wake-up state last time, the ECU can still be detected whether it has an abnormal power-off after being in the wake-up state this time based on the counted power-on count, thereby ensuring the reliability and stability of detecting whether the ECU has an abnormal power-off each time.
[0094] It should be noted that the preset step length is used to measure the unit count of the ECU in the wake-up state, and can also be used to measure the unit count of performing counting operation on the power-on count once. It should be noted that the preset step length can be set by those skilled in the art according to the demand, such as the preset step length is 1, 2 and the like.
[0095] In the embodiment of the present application, performing counting operation on the power-on count means performing counting operation on the power-on count once, adding the obtained sleep count to the preset step length to obtain the counted power-on count, that is, the value of the counted power-on count is equal to the sleep count plus the preset step length.
[0096] For example, if the preset step length is 1, the power-on count changed_counter1=3, and the sleep count sleep_counter1=3, which indicates that the ECU has no abnormal power-off after being in the wake-up state last time, then the counted power-on count changed_counter2=sleep_counter1+1=4 this time.
[0097] For example, if the preset step length is 1, the power-on count changed_counter1=3, and the sleep count sleep_counter1=2, which indicates that the ECU has an abnormal power-off after being in the wake-up state last time, then the counted power-on count changed_counter2=sleep_counter1+1=3 this time.
[0098] Optionally, after performing the counting operation on the power-on times to obtain the counted power-on times, the vehicle can further write the counted power-on times into the NVM, so as to facilitate obtaining the accumulated number of times that the ECU is in the wake-up state from the NVM next time after the ECU is in the wake-up state. For example, if the counted power-on times this time changed_counter2=3, the power-on times changed_counter2 are stored into the NVM, and the changed_counter1 in the NVM is replaced by the changed_counter2.
[0099] In step 404, the vehicle performs a counting operation on the sleep times in a case where the ECU switches from the wake-up state to the sleep state, to obtain counted sleep times, which are the sum of the sleep times and a preset step length.
[0100] In the embodiment of the application, in a case where the ECU switches from the wake-up state to the sleep state this time, it indicates that the ECU has not abnormally powered off after being woken up this time, so the vehicle can perform a counting operation on the sleep times, which can be understood as recording the sleep state of the ECU this time. That is, the vehicle can update the accumulated sleep times of the ECU in a case where the ECU has not abnormally powered off after being in the wake-up state this time.
[0101] It should be noted that in a case where the ECU switches from the wake-up state to the sleep state, the ECU can have switched to the sleep state, or the ECU can have completed a preset task to enter the sleep state.
[0102] In the embodiment of the application, the vehicle can perform a counting operation on the sleep times according to a preset sleep counting rule, the preset sleep counting rule being that the sum of the sleep times and a preset step length is taken as the counted sleep times, so that the counted sleep times are the sum of the sleep times and the preset step length. Taking the sum of the sleep times and the preset step length as the counted sleep times not only simplifies the complexity of performing the counting operation on the sleep times, but also still enables detection of whether the ECU has abnormally powered off after being in the wake-up state this time based on the accumulated sleep times of the ECU in the sleep state, thereby also ensuring the reliability and stability of detection of whether the ECU has abnormally powered off each time.
[0103] It can be understood that, regardless of whether the ECU has abnormally powered off after being in the wake-up state last time, recording the sleep state of the ECU this time is not affected by whether the ECU has abnormally powered off last time, so the sum of the sleep times and the preset step length is taken as the counted sleep times.
[0104] It should be noted that the preset step length is used to measure the unit number of times that the ECU is in the sleep state, and can also be used to measure the unit number of times that the counting operation is performed on the sleep number. It should be noted that the preset step length can be set by a person skilled in the art according to requirements, such as 1, 2, or the like.
[0105] It should be noted that the preset step length in the counting operation performed on the power-on number is equal to the preset step length in the counting operation performed on the sleep number.
[0106] In the embodiment of the present application, performing the counting operation on the sleep number means performing the counting operation on the sleep number once, and adding the preset step length to the obtained sleep number to obtain the counted sleep number, that is, the value of the counted sleep number is equal to the sleep number plus the preset step length.
[0107] For example, if the preset step length is 1, the power-on number changed_counter1 is 3, and the sleep number sleep_counter1 is 2, it indicates that the ECU has an abnormal power-off after being in the wake-up state last time, then the counted power-on number changed_counter2 this time is sleep_counter1+1=3, and the counted sleep number sleep_counter2 this time is sleep_counter1+1=3, then when the ECU is in the wake-up state next time, the abnormal power-off of the ECU after being in the wake-up state this time is detected, and the comparison result is changed_counter2=sleep_counter2=3, that is, the abnormal power-off of the ECU after being in the wake-up state this time can be accurately detected.
[0108] In the embodiment of the present application, if the ECU has an abnormal power-off after being in the wake-up state, the counting operation will not be performed on the sleep number. For example, if the preset step length is 1, the power-on number changed_counter1 is 3, and the sleep number sleep_counter1 is 3, the counted power-on number changed_counter2 this time is sleep_counter1+1=4, if the ECU has an abnormal power-off after being in the wake-up state this time, the ECU cannot normally enter the sleep state, then the counting operation will not be performed on the sleep number, and the sleep number is still sleep_counter1=3, then when the ECU is in the wake-up state next time, the abnormal power-off of the ECU after being in the wake-up state this time is detected, the obtained power-on number changed_counter2 is 4, and the sleep number sleep_counter1 is 3, the comparison result is changed_counter2 and sleep_counter1 are not equal, that is, the abnormal power-off of the ECU after being in the wake-up state this time can be accurately detected.
[0109] Optionally, after performing the counting operation on the sleep count to obtain the counted sleep count, the vehicle can also write the counted sleep count into the NVM to facilitate obtaining the cumulative sleep count of the ECU in the sleep state from the NVM next time after the ECU is in the wake-up state. For example, if the counted sleep count sleep_counter2 of this time is 3, the sleep count sleep_counter2 is stored into the NVM, and the sleep count sleep_counter1 in the NVM is replaced by the sleep count sleep_counter2.
[0110] Optionally, after performing the counting operation on the sleep count to obtain the counted sleep count, if the ECU is not in the sleep state, the vehicle can also control the ECU to be in the sleep state.
[0111] It can be seen that, by implementing the embodiments of the present application, the abnormal power-off condition of the ECU can be detected in time, and the reliability of detecting the abnormal power-off condition of the ECU is improved by the quantifiable power-on count and sleep count, so that the influence of the abnormal power-off of the ECU on the normal operation of the vehicle can be reduced. The cumulative power-on count of the ECU can be updated in time after the ECU is in the wake-up state, and the sum of the cumulative sleep count of the ECU in the sleep state and the preset step length is used as the counted power-on count, so that even if the ECU has abnormal power-off after being in the wake-up state last time, the abnormal power-off of the ECU after being in the wake-up state this time can still be detected based on the counted power-on count, thereby ensuring the reliability and stability of detecting the abnormal power-off of the ECU each time. The cumulative sleep count of the ECU can be updated in time after the ECU has not had abnormal power-off this time in the wake-up state, and the sum of the cumulative sleep count of the ECU in the sleep state and the preset step length is used as the counted sleep count, thereby simplifying the complexity of performing the counting operation on the sleep count.
[0112] In some embodiments, the vehicle can also perform the counting operation on the power-on count and the sleep count according to another preset power-on counting and preset sleep counting rule. The another preset power-on counting and preset sleep counting rule will be introduced below in combination with Figure 5 the embodiment. Please refer to Figure 5 , Figure 5 which is a flowchart of another abnormality detection method disclosed by the embodiments of the present application.
[0113] As shown in the method of Figure 5 may include the following steps:
[0114] In step 501, the vehicle obtains the power-on times and the sleep times of the ECU when the ECU is in the wake-up state. The power-on times are the cumulative times when the ECU is in the wake-up state, and the sleep times are the cumulative times when the ECU is in the sleep state.
[0115] In step 502, the vehicle determines the running state of the ECU after the ECU is in the wake-up state last time according to the power-on times and the sleep times. The running state includes abnormal power-off or non-abnormal power-off.
[0116] The implementation of steps 501 to 502 can correspond to the content in the foregoing steps 301 to 302 and steps 401 to 402, which will not be described here.
[0117] In step 503, the vehicle performs a counting operation on the power-on times to obtain the counted power-on times. The counted power-on times are the sum of the power-on times and a preset step length.
[0118] In the embodiment of the application, the vehicle can also perform a counting operation on the power-on times after the ECU is in the wake-up state this time. That is, the cumulative power-on times of the ECU can be updated in time after the ECU is in the wake-up state, that is, the cumulative times when the ECU is in the wake-up state are updated in time.
[0119] In the embodiment of the application, the vehicle can perform a counting operation on the power-on times according to a preset power-on counting rule. The preset power-on counting rule is to take the sum of the power-on times and a preset step length as the counted power-on times, so that the counted power-on times are the sum of the power-on times and the preset step length. This way of taking the sum of the cumulative power-on times of the ECU in the wake-up state and the preset step length as the counted power-on times not only simplifies the complexity of performing a counting operation on the power-on times, but also still enables the cumulative power-on times of the ECU in the wake-up state to be used to detect whether abnormal power-off occurs after the ECU is in the wake-up state this time, thereby guaranteeing the reliability and stability of detecting whether abnormal power-off occurs to the ECU each time.
[0120] It can be understood that whether the ECU has abnormal power-off after being in the wake-up state last time or not, the wake-up state of the ECU this time is recorded regardless of whether the ECU has abnormal power-off last time or not. Therefore, the sum of the power-on times and the preset step length is taken as the counted power-on times.
[0121] In the embodiment of the application, performing a counting operation on the power-on times means performing a counting operation on the power-on times once. The counted power-on times are obtained by adding the preset step length to the power-on times, that is, the value of the counted power-on times is equal to the power-on times plus the preset step length.
[0122] For example, if the preset step length is 1, the power-on times changed_counter1 = 3, and the sleep times sleep_counter1 = 2, it indicates that the ECU has experienced abnormal power-off after being in the wake-up state last time, and then the power-on times changed_counter2 = changed_counter1 + 1 = 4 after the current counting.
[0123] In step 504, the vehicle performs counting operation on the sleep times when the ECU switches from the wake-up state to the sleep state, and obtains the counted sleep times, which is the sum of the power-on times and the preset step length.
[0124] In the embodiment of the present application, when the ECU switches from the wake-up state to the sleep state this time, it indicates that the ECU has not experienced abnormal power-off after being woken up this time, so the vehicle can perform counting operation on the sleep times, which can be understood as recording the sleep state of the ECU this time. That is, the vehicle can update the accumulated sleep times of the ECU in time when the ECU has not experienced abnormal power-off after being woken up this time.
[0125] In the embodiment of the present application, if the ECU has experienced abnormal power-off after being in the wake-up state last time, it will lead to inaccurate accumulated sleep times. Then, the vehicle can perform counting operation on the sleep times according to the preset sleep counting rule, and the preset sleep counting rule is to take the sum of the power-on times and the preset step length as the counted sleep times, so that the counted sleep times is the sum of the power-on times and the preset step length. When detecting whether the ECU has experienced abnormal power-off after being in the wake-up state this time, even if the ECU has experienced abnormal power-off after being in the wake-up state last time, the counted sleep times can still be used to detect whether the ECU has experienced abnormal power-off after being in the wake-up state this time, thereby ensuring the reliability and stability of detecting whether the ECU has experienced abnormal power-off each time.
[0126] In the embodiment of the present application, performing counting operation on the sleep times means performing counting operation on the sleep times once, and the counted sleep times is obtained by adding the preset step length to the power-on times, that is, the value of the counted sleep times is equal to the power-on times plus the preset step length.
[0127] For example, if the preset step length is 1, the power-on times changed_counter1 = 3, and the sleep times sleep_counter1 = 2, it indicates that the ECU has experienced abnormal power-off after being in the wake-up state last time. The power-on times changed_counter2 = changed_counter1 + 1 = 4 after counting this time, and if the ECU does not experience abnormal power-off after being in the wake-up state this time, the ECU can enter the sleep state normally, and the counting operation is performed on the sleep times. The sleep times sleep_counter2 = changed_counter1 + 1 = 4 after counting this time. Then, when detecting whether the ECU experiences abnormal power-off after being in the wake-up state this time next time, the obtained power-on times changed_counter2 = 4 and sleep times sleep_counter2 = 4, and the comparison result changed_counter2 = sleep_counter2 = 4, that is, the ECU does not experience abnormal power-off after being in the wake-up state this time can be accurately detected.
[0128] Other embodiments of steps 503 to 504 can correspond to the foregoing content in steps 403 to 404, which will not be described herein again.
[0129] It can be seen that the embodiments of the present application can not only detect the abnormal power-off of the ECU in time, but also improve the reliability of detecting the abnormal power-off of the ECU by quantifiable power-on times and sleep times, so as to reduce the influence of abnormal power-off of the ECU on the normal operation of the vehicle. The power-on times of the ECU accumulated after being in the wake-up state can be updated in time. The sum of the power-on times of the ECU accumulated after being in the wake-up state and the preset step length is used as the counted power-on times, which simplifies the complexity of performing the counting operation on the power-on times. The sleep times of the ECU accumulated after being in the wake-up state can be updated in time in the case that the ECU does not experience abnormal power-off after being in the wake-up state this time. The sum of the power-on times of the ECU accumulated after being in the wake-up state and the preset step length is used as the counted sleep times. Even if the ECU experiences abnormal power-off after being in the wake-up state last time, the abnormal power-off of the ECU after being in the wake-up state this time can still be detected based on the counted sleep times, so as to ensure the reliability and stability of detecting the abnormal power-off of the ECU each time.
[0130] In some embodiments, the power-on times and the sleep times can be reset in the case that the ECU experiences abnormal power-off after being in the wake-up state last time. The following will be described in combination with Figure 6 the embodiment. Please refer to Figure 6 , Figure 6is a flowchart of another abnormality detection method disclosed in embodiments of the present application. As shown in Figure 6 The method shown can include the following steps:
[0131] Step 601, the vehicle acquires the power-on times and the sleep times of the ECU, the power-on times being the cumulative times that the ECU is in the wake-up state, and the sleep times being the cumulative times that the ECU is in the sleep state.
[0132] Step 602, the vehicle determines the running state of the ECU after the ECU is in the wake-up state last time according to the power-on times and the sleep times, the running state including abnormal power-off or non-abnormal power-off.
[0133] The implementation of steps 601-602 can correspond to the content in the aforementioned steps 301-302, which will not be repeated here.
[0134] Step 603, in the case that the running state of the ECU after the ECU is in the wake-up state last time is abnormal power-off, the vehicle resets the power-on times to a preset power-on times and resets the sleep times to a preset sleep times, the preset power-on times being equal to the preset sleep times.
[0135] In embodiments of the present application, when it is detected that the running state of the ECU after the ECU is in the wake-up state last time is abnormal power-off, the power-on times can be reset according to the preset power-on times, and the sleep times can be reset according to the preset sleep times. That is, the cumulative times that the ECU is in the wake-up state and the cumulative times that the ECU is in the sleep state are reset to re-count according to the preset power-on times and the preset sleep times.
[0136] It should be noted that the preset power-on times and the preset sleep times can be set by those skilled in the art according to requirements, such as the preset power-on times and the preset sleep times being both 0.
[0137] For example, assuming that the preset power-on times = 0 and the preset sleep times = 0, if the power-on times changed_counter1 = 3 and the sleep times sleep_counter1 = 2, it indicates that the ECU has abnormal power-off after being in the wake-up state last time, then the reset power-on times changed_counter1 = 0, and the reset sleep times sleep_counter1 = 0.
[0138] In some embodiments, the vehicle initializes the functional module controlled by the ECU in the last wake-up state in the case that the running state of the ECU after the last wake-up state is abnormal power-off. It can be understood that, in order to avoid a great impact on the normal running of the vehicle function due to the abnormal power-off of the ECU, the functional module controlled by the ECU in the last wake-up state is initialized in the case that the abnormal power-off occurs after the last wake-up state of the ECU is detected, thereby reducing the degree of impact on the normal running of the vehicle function due to the abnormal power-off of the ECU. It should be noted that the application does not limit the way of initialization, and those skilled in the art can customize the settings according to the requirements.
[0139] It can be seen that, by implementing the embodiments of the application, the abnormal power-off of the ECU can be detected in time, and the reliability of detecting the abnormal power-off of the ECU is improved by the quantifiable power-on times and sleep times, thereby the degree of impact on the normal running of the vehicle function due to the abnormal power-off of the ECU can be reduced. In the case that the abnormal power-off occurs after the last wake-up state of the ECU is detected, the power-on times and sleep times are reset, that is, the subsequent counting operation and detection process are continued based on the reset preset power-on times and preset sleep times, thereby avoiding the adverse effect of the inaccurate accumulated sleep times on the detection result due to the abnormal power-off of the ECU after the last wake-up state, and the accuracy and reliability of detecting the abnormal power-off of the ECU each time are ensured.
[0140] According to the description of the foregoing embodiments, it can be known that the MCU is the core hardware basis for the ECU to realize the control function, and therefore, in some embodiments, the MCU can also be used to detect whether the ECU has abnormal power-off, that is, the MCU executes the steps included in the abnormal detection method.
[0141] Hereinafter, the MCU is taken as an example, and the abnormal detection method is introduced in combination with the flowchart shown in FIG. 1. Figure 7 An abnormal detection method disclosed by the application is introduced. Please refer to Figure 7 , Figure 7 is a flowchart of another abnormal detection method disclosed by the embodiments of the application.
[0142] As shown in the method shown in FIG. 1, the method can include the following steps: Figure 7
[0143] Step 701, the MCU reads the power-on times and sleep times of the ECU from the NVM in the case that the ECU is in the wake-up state.
[0144] Step 702, the MCU judges whether the power-on times and sleep times are equal. If yes, step 703 is executed; if not, step 704 is executed.
[0145] Step 703, the MCU determines that the running state of the ECU after the last time in the wake-up state is an unexceptional power-off.
[0146] Step 704, the MCU determines that the running state of the ECU after the last time in the wake-up state is an exceptional power-off.
[0147] Step 705, the MCU performs a counting operation on the power-on times according to a preset power-on counting rule, to obtain the counted power-on times.
[0148] In some embodiments, the preset power-on counting rule is to take the sum of the sleep times and a preset step length as the counted power-on times, or to take the sum of the power-on times and a preset step length as the counted power-on times.
[0149] Step 706, the MCU writes the counted power-on times into the NVM.
[0150] Step 707, the MCU determines whether the ECU has completed a preset task. If yes, step 708 is performed; if no, step 707 is continuously performed.
[0151] It can be understood that the ECU completing the preset task means that the ECU will switch from the wake-up state to the sleep state.
[0152] Step 708, the MCU performs a counting operation on the sleep times according to a preset sleep counting rule, to obtain the counted sleep times.
[0153] In some embodiments, the preset sleep counting rule is to take the sum of the sleep times and a preset step length as the counted sleep times, or to take the sum of the power-on times and a preset step length as the counted sleep times.
[0154] It should be noted that, in the case where the preset power-on counting rule is to take the sum of the sleep times and a preset step length as the counted power-on times, the preset sleep counting rule is to take the sum of the sleep times and a preset step length as the counted sleep times; in the case where the preset power-on counting rule is to take the sum of the power-on times and a preset step length as the counted power-on times, the sum of the power-on times and a preset step length is taken as the counted sleep times.
[0155] Step 709, the MCU writes the counted sleep times into the NVM.
[0156] Step 710, the MCU controls the ECU to be in the sleep state.
[0157] The embodiments of steps 701 to 710 can correspond to the content in the foregoing embodiments, which will not be repeated here.
[0158] It can be seen that the embodiment of the application can detect the abnormal power-off of the ECU in time, and the reliability of detecting the abnormal power-off of the ECU is improved by the quantifiable power-on times and sleep times, so that the influence of the abnormal power-off of the ECU on the normal operation of the vehicle function can be reduced. The power-on times of the ECU accumulated in the wake-up state can be updated in time, and the sleep times of the ECU accumulated in the wake-up state can be updated in time when the ECU does not have abnormal power-off in the wake-up state, and whether the ECU has abnormal power-off after each wake-up state is detected based on the counted power-on times and sleep times, so that the reliability and stability of detecting whether the ECU has abnormal power-off each time are ensured.
[0159] It should be understood that although each step in each flowchart above is displayed in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps has no strict order limitation, and these steps can be executed in other orders. Moreover, at least part of the steps in each flowchart above can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or sub-steps or stages of other steps. In addition, the above-mentioned multiple embodiments can be independently implemented, or can be combined with each other, which is not limited herein.
[0160] Based on the foregoing embodiments, an abnormality detection device is provided. The device is applied to the vehicle in the foregoing embodiments, and the vehicle includes a controller ECU. The device includes modules and units included in the modules, and can be implemented by a processor. Of course, it can also be implemented by a specific logic circuit. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA).
[0161] Please refer to Figure 8 , Figure 8 is a structural schematic diagram of an abnormality detection device disclosed by the embodiments of the application, as Figure 8 shown, the device includes an acquisition module 801 and a determination module 802.
[0162] The acquisition module 801 is configured to acquire the power-on times and sleep times of the ECU. The power-on times are the cumulative times of the ECU in the wake-up state, and the sleep times are the cumulative times of the ECU in the sleep state.
[0163] The determining module 802 is configured to determine the running state of the ECU after the ECU is in the wake-up state last time according to the power-on times and the sleep times, and the running state includes abnormal power-off or non-abnormal power-off.
[0164] In some embodiments, the determining module 802 is specifically configured to:
[0165] In a case where the power-on times are equal to the sleep times, the running state of the ECU after the ECU is in the wake-up state last time is determined as non-abnormal power-off; or,
[0166] In a case where the power-on times are not equal to the sleep times, the running state of the ECU after the ECU is in the wake-up state last time is determined as abnormal power-off.
[0167] In some embodiments, the obtaining module 801 is further configured to obtain the power-on times and the sleep times of the ECU in a case where the ECU is in the wake-up state.
[0168] In some embodiments, the abnormality detection apparatus further includes a counting module.
[0169] The counting module is configured to perform counting operation on the power-on times to obtain counted power-on times after the power-on times and the sleep times of the ECU are obtained in a case where the ECU is in the wake-up state, and the counted power-on times are the sum of the sleep times and a preset step length.
[0170] In some embodiments, the counting module is further configured to perform counting operation on the sleep times to obtain counted sleep times in a case where the ECU switches from the wake-up state to the sleep state, and the counted sleep times are the sum of the sleep times and a preset step length.
[0171] In some embodiments, the counting module is further configured to perform counting operation on the power-on times to obtain counted power-on times after the power-on times and the sleep times of the ECU are obtained in a case where the ECU is in the wake-up state, and the counted power-on times are the sum of the power-on times and a preset step length.
[0172] In some embodiments, the counting module is further configured to perform counting operation on the sleep times to obtain counted sleep times in a case where the ECU switches from the wake-up state to the sleep state, and the counted sleep times are the sum of the power-on times and a preset step length.
[0173] In some embodiments, the abnormality detection apparatus further includes a resetting module.
[0174] The resetting module is configured to reset the power-on times to a preset power-on times and reset the sleep times to a preset sleep times in a case where the running state of the ECU after the ECU is in the wake-up state last time is abnormal power-off, and the preset power-on times are equal to the preset sleep times.
[0175] In some embodiments, the abnormality detection apparatus further comprises a processing module;
[0176] The processing module is configured to initialize the functional module controlled by the ECU in the last wake-up state in the case that the running state of the ECU after the last wake-up state is abnormal power-off.
[0177] It should be noted that the division of the modules of the abnormality detection apparatus shown in the embodiments of the present application is illustrative, and is merely a logical functional division. In actual implementation, there can be another division manner.
[0178] The vehicle provided in the embodiments of the present application, please refer to Figure 9 , Figure 9 is a structural schematic diagram of a vehicle disclosed in the embodiments of the present application. As shown in Figure 9 , the vehicle comprises:
[0179] a memory 901 storing executable program codes;
[0180] a processor 902 coupled with the memory 901;
[0181] The processor 902 invokes the executable program codes stored in the memory 901 to execute any one of the abnormality detection methods in the above method embodiments.
[0182] The embodiments of the present application provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement part or all steps of any one of the abnormality detection methods provided in the above embodiments.
[0183] The embodiments of the present application further provide a computer program product comprising a computer program. The computer program is executed by a processor to implement part or all steps of any one of the abnormality detection methods provided in the above embodiments.
[0184] Those skilled in the art can understand that Figure 9 the structure shown in the above embodiments is merely a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the vehicle to which the scheme of the present application is applied. The specific vehicle can comprise more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0185] It should be noted that the descriptions of the above apparatus, vehicle, computer readable storage medium and computer program product embodiments are similar to the descriptions of the above method embodiments, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the apparatus, vehicle, computer readable storage medium and computer program product embodiments of the present application, please refer to the description of the method embodiments of the present application.
[0186] It should be understood that every feature, structure, or characteristic described herein is within a preferred embodiment of the present application. It should be noted that the foregoing embodiments are merely exemplary, and that every embodiment can not necessarily include all of the features that are described. Therefore, various embodiments can omit, substitute, or add various procedures or components as appropriate. For instance, it should be recognized that the methodologies described might comprise a process running on a processor, and as such, different steps of the methodologies can be performed by different operational components of the processor in a manner well understood in the art. Likewise, computer system elements will typically include a storage of machine readable instructions (e.g., memory devices, optical disks, etc.), which might comprise various combinations of hardware and software code. It should be noted that the terms "comprises", "comprising", or other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element. It should be noted that the terms "comprises", "comprising", or other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0187] The term "and / or", used herein only means an association between associated objects, which means that there can be three relationships, for example, object A and / or object B, which means that there are three cases: object A exists alone, object A and object B exist together, and object B exists alone.
[0188] It should be noted that the terms "comprises", "comprising", or other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0189] In several embodiments provided in the present application, it should be understood that the disclosed method, device and vehicle can be implemented in other ways. The above-described embodiments are only illustrative. For example, the division of the above modules is only a logical function division. In actual implementation, another division mode can be adopted, such as combination of multiple modules or components, or integration into another system, or omission or non-execution of some features. In addition, the coupling or direct coupling or communication connection between the displayed or discussed components can be indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0190] Those skilled in the art can understand that all or part of the steps of the foregoing method embodiments can be completed by relevant hardware of program instructions, and the foregoing program can be stored in a computer readable storage medium. When the program is executed, the program executes the steps of the foregoing method embodiments. The foregoing storage medium includes a mobile storage device, a read only memory (ROM), a magnetic disc or an optical disc, and various media that can store program codes.
[0191] The methods disclosed in the several method embodiments provided by the present application can be combined arbitrarily to obtain new method embodiments without conflict.
[0192] The features disclosed in the several device embodiments provided by the present application can be combined arbitrarily to obtain new device embodiments without conflict.
[0193] The above is only an implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An anomaly detection method, characterized in that, Applied to a vehicle, the vehicle including a controller ECU, the method includes: The number of times the ECU is powered on and the number of times it is in sleep mode are obtained. The number of times the ECU is powered on is the cumulative number of times the ECU is in wake-up state, and the number of times it is in sleep mode is the cumulative number of times the ECU is in sleep mode. Based on the number of power-on cycles and the number of sleep cycles, the operating state of the ECU after its most recent wake-up state is determined, and the operating state includes abnormal power-off or no abnormal power-off.
2. The method according to claim 1, characterized in that, Determining the operating state of the ECU after its most recent wake-up state based on the number of power-on cycles and the number of sleep cycles includes: If the number of power-on cycles equals the number of sleep cycles, the operating state of the ECU after its most recent wake-up state is determined to be the state without abnormal power failure; or, If the number of power-on cycles is not equal to the number of sleep cycles, the operating state of the ECU after its most recent wake-up state is determined to be the abnormal power-off.
3. The method according to claim 1 or 2, characterized in that, The process of obtaining the number of power-on times and sleep times of the ECU includes: When the ECU is in the wake-up state, the number of times the ECU is powered on and the number of times it goes into sleep mode are obtained.
4. The method according to claim 3, characterized in that, When the ECU is in the wake-up state, after obtaining the number of power-on times and sleep times of the ECU, the method further includes: A counting operation is performed on the number of power-on cycles to obtain the counted number of power-on cycles, which is the sum of the number of sleep cycles and a preset step size.
5. The method according to claim 4, characterized in that, The method further includes: When the ECU switches from the wake-up state to the sleep state, a counting operation is performed on the number of sleep cycles to obtain the counted number of sleep cycles. The counted number of sleep cycles is the sum of the number of sleep cycles and the preset step size.
6. The method according to claim 3, characterized in that, When the ECU is in the wake-up state, after obtaining the number of power-on times and sleep times of the ECU, the method further includes: A counting operation is performed on the number of power-on cycles to obtain the counted number of power-on cycles, which is the sum of the number of power-on cycles and a preset step size.
7. The method according to claim 6, characterized in that, The method further includes: When the ECU switches from the wake-up state to the sleep state, a counting operation is performed on the number of sleep cycles to obtain the counted number of sleep cycles. The counted number of sleep cycles is the sum of the number of power-on cycles and the preset step size.
8. The method according to claim 1 or 2, characterized in that, The method further includes: If the ECU's operating state after its most recent wake-up state is an abnormal power failure, the power-on count is reset to a preset power-on count and the hibernation count is reset to a preset hibernation count, where the preset power-on count is equal to the preset hibernation count.
9. The method according to claim 1 or 2, characterized in that, The method further includes: If the operating state of the ECU after its most recent wake-up state is an abnormal power failure, the functional modules controlled by the ECU during its most recent wake-up state will be initialized.
10. An anomaly detection device, characterized in that, Applied to a vehicle, the vehicle including a controller ECU, the device includes: The acquisition module is used to acquire the number of times the ECU is powered on and the number of times it is in sleep mode. The number of times the ECU is powered on is the cumulative number of times the ECU is in wake-up mode, and the number of times it is in sleep mode is the cumulative number of times the ECU is in sleep mode. The determination module is used to determine the operating state of the ECU after the most recent wake-up state based on the number of power-on times and the number of sleep times, wherein the operating state includes abnormal power-off or no abnormal power-off.
11. A vehicle comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 9.
13. A computer program product, characterized in that, It includes a computer program, and when the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 9.