A method and apparatus for detecting vehicle electronic controllers during startup.
After powering on the vehicle electronic controller, different detection modes are used to detect according to the memory space of the firmware, the problems of extended startup time and safety risks of traditional vehicle electronic controllers are solved, and fast and safe ECU startup and software are achieved. Integrity guarantee.
Patent Information
- Application Number
- CN202210855625.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-20
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-07-20
AI Technical Summary
During the verification process at startup, traditional vehicle electronic controllers lead to an extended startup time, affecting the user experience, and there is a risk of hackers maliciously upgrading the ECU through the network.
After powering on the vehicle electronic controller, the current firmware is obtained by using the boot loader to verify and use different detection modes to detect according to the firmware's memory space, including full verification, area block sampling and key data segment verification. Make sure that each firmware passes the detection before starting the ECU.
It effectively shortens the startup time of the ECU, avoids the problem of too long startup time, and ensures the integrity and legality of the ECU software, improving the performance and user experience of the entire vehicle.
Smart Images

Figure CN115328077B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle electronic controllers, and in particular to a detection method and device for a vehicle electronic controller during a startup phase. Background Art
[0002] In the traditional automotive electronic and electrical architecture, there are few links between the vehicle and external electrical devices, and the electronic controller ECU (Electronic Control Unit) in the car is relatively independent. With the rapid development of Internet of Vehicles technology and new electronic and electrical architecture, the communication between vehicles and external electrical devices is becoming more and more frequent. At the same time, with the widespread application of over-the-air technology OTA (Over-the-Air Technology) in the automotive field, the vehicle's ECU can be updated and upgraded through OTA to give the vehicle more functions and user experience, effectively improving the competitiveness of car companies. These new changes bring new problems to the ECU of traditional cars, such as hackers may directly access the ECU in the car through the network, and even maliciously upgrade the ECU in the car through OTA.
[0003] To solve these problems, the vehicle ECU currently uses a hardware security module verification method when it starts. However, during the verification process when the vehicle ECU starts, the startup time of the vehicle ECU is crucial to the user experience. Since a large number of applications are integrated into the vehicle ECU, if all applications of the vehicle ECU are verified during the verification process when the vehicle ECU starts, the verification startup time of the vehicle ECU will be delayed, and the vehicle computer may freeze. Summary of the invention
[0004] The embodiments of the present application solve the technical problem of delayed startup time of verification of vehicle electronic controllers in the prior art by providing a detection method and device for vehicle electronic controllers during the startup phase, implement different detection strategies for different firmware in the vehicle electronic controller, and effectively solve the problem of long safe startup time of different electronic controllers. It not only ensures information security issues such as the integrity and legality of ECU software with different cores, but also meets the performance of the entire vehicle and a good user experience, and helps to improve the overall competitiveness of automobile companies and other technical effects.
[0005] In a first aspect, an embodiment of the present invention provides a method for detecting a vehicle electronic controller during a startup phase, comprising:
[0006] After the electronic controller of the vehicle is powered on and the boot loader of the electronic controller passes verification, obtaining the current firmware of the electronic controller;
[0007] If the current firmware is the MCU firmware of the microcontroller unit MCU of the electronic controller, detecting the current firmware through the MCU detection mode of the MCU;
[0008] After the current firmware is detected, the next firmware is used as a new current firmware, and the new current firmware is detected until each firmware of the electronic controller passes the detection, and then the electronic controller is controlled to run.
[0009] Preferably, detecting the current firmware through an MCU detection mode of the MCU includes:
[0010] Acquire the memory space of the current firmware;
[0011] If the memory space of the current firmware is not greater than the first preset MCU memory space threshold, verifying the firmware content of the current firmware within the first preset MCU time length;
[0012] If the memory space of the current firmware is greater than the first preset MCU memory space threshold, and the memory space of the current firmware is not greater than the second preset MCU memory space threshold, then within the second preset MCU duration, a specified area block in the current firmware is sampled, wherein the second preset MCU memory space threshold is greater than the first preset MCU memory space threshold, and the memory space of the specified area block is not less than the preset area block memory threshold;
[0013] If the memory space of the current firmware is greater than the second preset MCU memory space threshold, and the memory space of the current firmware is not greater than the third preset MCU memory space threshold, then within the third preset MCU time length, the critical data segments of the current firmware are verified, and the non-critical data segments of the current firmware are randomly checked, wherein the third preset MCU memory space threshold is greater than the second preset MCU memory space threshold.
[0014] Preferably, after obtaining the memory space of the current firmware, the method further includes:
[0015] If the memory space of the current firmware is greater than the third preset MCU memory space threshold, then within a fourth preset MCU duration, key data blocks in the current firmware are randomly sampled.
[0016] Preferably, after obtaining the current firmware of the electronic controller, the method further includes:
[0017] If the current firmware is the MPU firmware of the microprocessor MPU of the electronic controller, the current firmware is detected through the MPU detection mode of the MPU.
[0018] Preferably, detecting the current firmware through the MPU detection mode of the MPU includes:
[0019] Acquire the memory space of the current firmware;
[0020] If the memory space of the current firmware is not greater than the first preset MPU memory space threshold, then within the first preset MPU duration, the area blocks of the current firmware on multiple zone disks of the MPU are randomly checked, wherein the number of area blocks on each zone disk is not less than the preset zone disk area block number threshold.
[0021] Preferably, after acquiring the memory space of the current firmware, the method further includes:
[0022] If the memory space of the current firmware is greater than the first preset MPU memory space threshold, and the memory space of the current firmware is not greater than the second preset MPU memory space threshold, then within the second preset MPU time length, randomly check the data segments of multiple area blocks of the current firmware, wherein the number of area blocks of the current firmware is greater than the first preset area block number threshold, the number of data segments of each area block is not less than the first preset data segment number threshold, and the second preset MPU memory space threshold is greater than the first preset MPU memory space threshold.
[0023] Preferably, after obtaining the memory space of the current firmware, the method further includes:
[0024] If the memory space of the current firmware is greater than the second preset MPU memory space threshold, then within the third preset MPU time length, the data segments of multiple area blocks of the current firmware are randomly checked, wherein the number of area blocks of the current firmware is greater than the second preset area block number threshold, and the number of data segments of each area block is not less than the second preset data segment number threshold.
[0025] Based on the same inventive concept, in a second aspect, the present invention further provides a detection device for a vehicle electronic controller in a startup phase, comprising:
[0026] An acquisition module, used for acquiring the current firmware of the electronic controller after the electronic controller of the vehicle is powered on and the boot loader of the electronic controller passes verification;
[0027] A judgment module, configured to detect the current firmware through an MCU detection mode of the MCU if the current firmware is the MCU firmware of the microcontroller unit MCU of the electronic controller;
[0028] The control module is used to, after detecting the current firmware, take the next firmware as the new current firmware, detect the new current firmware, and control the operation of the electronic controller after each firmware of the electronic controller passes the detection.
[0029] Based on the same inventive concept, in a third aspect, the present invention provides an electronic controller, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of a detection method for a vehicle electronic controller during a startup phase are implemented.
[0030] Based on the same inventive concept, in a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of a detection method for a vehicle electronic controller during a startup phase are implemented.
[0031] One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:
[0032] In an embodiment of the present invention, after the electronic controller of the vehicle is powered on and the bootloader of the electronic controller passes the verification, the current firmware of the electronic controller is first obtained, and then the current firmware of the electronic controller is judged. If the current firmware is the MCU firmware of the microcontroller unit MCU of the electronic controller, the current firmware is detected through the MCU detection mode of the MCU.
[0033] Here, after identifying that the current firmware is the MCU firmware, the specific method of detecting the current firmware through the MCU detection mode is to perform a specific detection method on the current firmware according to the memory space of the current firmware and the startup time requirement of the vehicle network communication. For example, if the memory space of the current firmware is less than 200KB, all firmware contents of the current firmware are detected within 100ms; if the memory space of the current firmware is greater than 10MB, random sampling is performed on the area blocks of the current firmware within 150ms. Therefore, by performing a specific detection method on the current firmware according to the memory space of the current firmware and the startup time of the vehicle network communication, the situation of excessive startup time during the ECU safety startup phase can be effectively avoided, which not only ensures the integrity and legitimacy of the program software in different core ECUs, but also improves the performance of the vehicle and the user experience.
[0034] After detecting the current firmware, the next firmware is used as the new current firmware, and the new current firmware is detected. After each firmware of the electronic controller passes the detection, the electronic controller is controlled to run, so as to efficiently and quickly realize the normal operation of the ECU. While ensuring the safe startup of the electronic controller, the firmware of the electronic controller is quickly verified, the performance of the whole vehicle and the user experience are improved, which helps to improve the overall competitiveness of the automobile enterprise. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Also, throughout the accompanying drawings, the same reference figures are used to represent the same components. In the drawings:
[0036] Figure 1 A schematic flow chart showing the steps of a detection method of a vehicle electronic controller in a startup phase in an embodiment of the present invention is shown;
[0037] Figure 2 A module schematic diagram of a detection device for a vehicle electronic controller in a startup phase in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0038] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0039] Embodiment 1
[0040] The first embodiment of the present invention provides a method for detecting a vehicle electronic controller during the startup phase, such as Figure 1 As shown, including:
[0041] S101, after the electronic controller of the vehicle is powered on and the boot loader of the electronic controller passes verification, obtaining the current firmware of the electronic controller;
[0042] S102, if the current firmware is the MCU firmware of the microcontroller unit MCU of the electronic controller, detecting the current firmware through the MCU detection mode of the MCU;
[0043] S103, after detecting the current firmware, taking the next firmware as a new current firmware, detecting the new current firmware, until each firmware of the electronic controller passes the detection, and then controlling the electronic controller to run.
[0044] The detection method of the vehicle electronic controller in the startup phase of the present embodiment is applied to the vehicle electronic controller (Electronic Control Unit, ECU), and is specifically implemented in the process from powering on the ECU to completion of startup.
[0045] Next, combine Figure 1 The specific implementation steps of the detection method of the vehicle electronic controller in the startup phase provided by this embodiment are described in detail:
[0046] First, step S101 is executed to obtain the current firmware of the electronic controller after the electronic controller of the vehicle is powered on and the boot loader of the electronic controller passes verification.
[0047] Specifically, after the vehicle's ECU is powered on, the ECU's hardware security module HSM (Hardware Security Module) will start first. After the HSM starts, the HSM performs integrity and legality checks on the bootloader (BootLoader). After the BootLoader passes the check, it obtains the current firmware of the electronic controller.
[0048] Next, step S102 is executed. If the current firmware is the MCU firmware of the microcontroller unit MCU of the electronic controller, the current firmware is detected through the MCU detection mode of the MCU.
[0049] Specifically, if the current firmware is the MCU firmware of the ECU's microcontroller unit MCU (Microcontroller Unit), the current firmware is detected through the MCU detection mode of the MCU. The specific process of detecting the current firmware through the MCU detection mode of the MCU is: first obtain the memory space of the current firmware. Then determine the memory space of the current firmware.
[0050] If the memory space of the current firmware is not greater than the first preset MCU memory space threshold, the firmware content of the current firmware is verified within the first preset MCU duration. The first preset MCU memory space threshold and the first preset MCU duration are both set according to actual needs. Usually, the first preset MCU memory space threshold is 200KB, and the first preset MCU duration is 100 milliseconds (ms).
[0051] For example, if the memory space of the current firmware is not greater than 200 KB, indicating that the current firmware is a firmware below 200 KB, then all firmware contents of the current firmware are verified within 100 ms.
[0052] If the memory space of the current firmware is greater than the first preset MCU memory space threshold, and the memory space of the current firmware is not greater than the second preset MCU memory space threshold, then within the second preset MCU time length, a specified area block in the current firmware is randomly inspected, wherein the second preset MCU memory space threshold is greater than the first preset MCU memory space threshold, and the memory space of the specified area block is not less than the preset area block memory threshold.
[0053] It should be noted that the second preset MCU memory space threshold, the second preset MCU duration and the preset area block memory threshold can be set according to actual needs. Typically, the second preset MCU memory space threshold is 1MB, the second preset MCU duration is 100ms, and the preset area block memory threshold is 128KB.
[0054] Specifically, for firmware whose memory space is between the first preset MCU memory space threshold and the second preset MCU memory space threshold, the firmware is divided into multiple area blocks. Therefore, if the memory space of the current firmware is greater than the first preset MCU memory space threshold of 200KB, and the memory space of the current firmware is not greater than the second preset MCU memory space threshold of 1MB, then within 100ms, a region block of not less than 128KB of the current firmware is randomly checked, that is, a designated region block of the current firmware is randomly checked.
[0055] For example, assume that the current firmware has 4 area blocks, which are respectively recorded as area block X1, area block X2, area block X3 and area block X4. The memory space of X1 is 128KB, the memory space of X2 is 148KB, the memory space of X3 is 100KB, and the memory space of X4 is 150KB. Within the second preset MCU time length of 100ms, X1 and / or X2 and / or X4 are randomly sampled.
[0056] If the memory space of the current firmware is greater than the second preset MCU memory space threshold, and the memory space of the current firmware is not greater than the third preset MCU memory space threshold, then within the third preset MCU time length, the critical data segments of the current firmware are verified, and the non-critical data segments of the current firmware are randomly checked, wherein the third preset MCU memory space threshold is greater than the second preset MCU memory space threshold.
[0057] It should be noted that the third preset MCU memory space threshold and the third preset MCU duration can be set according to actual needs. Typically, the third preset MCU memory space threshold is 10MB, and the third preset MCU duration is 150ms.
[0058] Specifically, for the firmware whose memory space is between the second preset MCU memory space threshold and the third preset MCU memory space threshold, the firmware is divided into N data segments, and the N data segments are divided into M key data segments and NM non-key data segments, where N and M are both positive integers greater than 1. Among them, the key data segment refers to a segment into which the key data or important data of the current firmware is encapsulated, and the non-key data segment refers to a segment into which the data other than the key data or important data of the current firmware is encapsulated.
[0059] Therefore, if the memory space of the current firmware is larger than the second preset MCU memory space threshold of 1MB, and the memory space of the current firmware is not larger than the third preset MCU memory space threshold of 10MB, then within the third preset MCU time length of 150ms, the critical data segments of the current firmware must be verified and the non-critical data segments of the current firmware must be sampled, or there is no need to detect the non-critical segment data of the current firmware.
[0060] If the memory space of the current firmware is greater than the third preset MCU memory space threshold, the key data blocks in the current firmware are randomly sampled within the fourth preset MCU duration, wherein the fourth preset MCU duration is set according to actual needs, and is usually set to 150ms.
[0061] Specifically, for firmware whose memory space is greater than the third preset MCU memory space threshold, the critical data or important data of the firmware is divided into multiple area blocks, i.e., multiple critical data blocks. Multiple critical data blocks refer to multiple area blocks into which the critical data or important data of the firmware is encapsulated. If the memory space of the current firmware is greater than the third preset MCU memory space threshold of 10MB, the critical data blocks of the current firmware are randomly sampled within the fourth preset MCU duration of 150ms.
[0062] In this embodiment, after identifying that the current firmware is the MCU firmware, the current firmware is detected through the MCU detection mode. And, according to the memory space of the current firmware, under the startup time requirement of the vehicle network communication, a specific detection method is performed on the current firmware. For example, if the memory space of the current firmware is less than 200KB, all firmware contents of the current firmware are detected within 100ms; if the memory space of the current firmware is greater than 10MB, random sampling is performed on the area blocks of the current firmware within 150ms. Therefore, by performing a specific detection method on the current firmware according to the memory space of the current firmware and the startup time of the vehicle network communication, the situation of excessive startup time during the ECU safety startup phase is effectively avoided, which not only ensures the integrity and legitimacy of the program software in different core ECUs, but also improves the performance of the vehicle and the user experience.
[0063] After acquiring the current firmware of the electronic controller, if the current firmware is the MPU firmware of the microprocessor MPU of the electronic controller, the current firmware is detected through the MPU detection mode of the MPU.
[0064] Specifically, if the current firmware is the MPU firmware of the microprocessor MPU (Microprocessor Unit) of the ECU, the current firmware is detected through the MPU detection mode of the MPU. The specific process of detecting the current firmware through the MPU detection mode of the MPU is: first obtain the memory space of the current firmware. Then determine the memory space of the current firmware.
[0065] If the memory space of the current firmware is not greater than the first preset MPU memory space threshold, then within the first preset MPU duration, the region blocks of the current firmware on multiple zone disks of the MPU are randomly checked, wherein the number of region blocks on each zone disk is not less than the preset zone disk region block number threshold. The first preset MPU memory space threshold, the first preset MPU duration, and the preset zone disk region block number threshold can all be set according to actual needs. Usually, the first preset MPU memory space threshold is 50MB, the first preset MPU duration is 2 seconds (s), and the preset zone disk region block number threshold is 3.
[0066] Specifically, for firmware whose memory space is not greater than the first preset MPU memory space threshold, the firmware is divided into multiple area blocks, which are respectively stored on multiple area disks of the MPU, and the number of area blocks in each of the multiple area disks of the MPU must be no less than the preset area disk area block number threshold of 3. For example, for firmware whose memory space is not greater than the first preset MPU memory space threshold of 50MB, the firmware is divided into 15 area blocks, which are respectively stored in area disk A, area disk B, and area disk C of the MPU. The number of area blocks stored in area disk A is 3, the number of area blocks stored in area disk B is 5, and the number of area blocks stored in area disk C is 7, that is, the number of area blocks stored in each area disk in ABC is at least 3.
[0067] The process of detecting the current firmware whose memory space is not greater than the first preset MPU memory space threshold of 50MB is to randomly check the regional blocks of the current firmware in multiple zone disks of the MPU within the first preset MPU duration of 2s. For example, for the firmware whose memory space is not greater than the first preset MPU memory space threshold of 50MB, the firmware is divided into 15 regional blocks, and the 15 regional blocks are respectively stored in the zone disk A, zone disk B and zone disk C of the MPU. The number of regional blocks stored in zone disk A is 3, the number of regional blocks stored in zone disk B is 5, and the number of regional blocks stored in zone disk C is 7. Within 2s, randomly check the regional blocks in zone disk A and zone disk B, and also randomly check at least 3 regional blocks in zone disk A, that is, all 3 regional blocks in zone disk A are detected. Randomly check at least 3 regional blocks in zone disk B, that is, randomly check at least 3 of the 5 regional blocks in zone disk B.
[0068] If the memory space of the current firmware is greater than the first preset MPU memory space threshold, and the memory space of the current firmware is not greater than the second preset MPU memory space threshold, then within the second preset MPU time length, randomly check the data segments of multiple area blocks of the current firmware, wherein the number of area blocks of the current firmware is greater than the first preset area block number threshold, the number of data segments of each area block is not less than the first preset data segment number threshold, and the second preset MPU memory space threshold is greater than the first preset MPU memory space threshold.
[0069] It should be noted that the second preset MPU memory space threshold, the second preset MPU duration, the first preset quantity threshold and the first preset data segment quantity threshold can all be set according to actual needs. Usually, the second preset MPU memory space threshold is 100MB, the second preset MPU duration is 6s, the first preset quantity threshold is 1, and the first preset data segment quantity threshold is 5.
[0070] Specifically, for firmware whose memory space is between the first preset MPU memory space threshold and the second preset MPU memory space threshold, the firmware is divided into a plurality of area blocks whose number is greater than 1, and each area block is divided into data segments whose number is at least 5. Therefore, if the memory space of the current firmware is greater than the first preset MPU memory space threshold of 50MB, and the memory space of the current firmware is not greater than the second preset MPU memory space threshold of 100MB, then within the second preset MPU time length of 6s, the data segments of the plurality of area blocks of the current firmware are randomly sampled.
[0071] The specific process of randomly sampling the data segments of multiple area blocks of the current firmware is as follows: assuming that the current firmware is divided into 5 area blocks, which are respectively recorded as area block Q1, area block Q2, area block Q3, area block Q4 and area block Q5, Q1 has 6 data segments, Q2 has 8 data segments, Q3 has 5 data segments, Q4 has 7 data segments, and Q5 has 5 data segments. Within 6 seconds, Q2, Q3 and Q5 of the current firmware are sampled, and at least 5 data segments are sampled in Q2, at least 5 data segments are sampled in Q3, and at least 5 data segments are sampled in Q5.
[0072] If the memory space of the current firmware is greater than the second preset MPU memory space threshold, then within the third preset MPU time length, the data segments of multiple area blocks of the current firmware are randomly checked, wherein the number of area blocks of the current firmware is greater than the second preset area block number threshold, and the number of data segments of each area block is not less than the second preset data segment number threshold.
[0073] It should be explained that the third preset MPU duration, the second preset area block number threshold and the second preset data segment number threshold can be set according to actual needs. Usually, the third preset MPU duration is 10s, the second preset area block number threshold is 2, and the second preset data segment number threshold is 5.
[0074] Specifically, for firmware whose memory space is greater than the second preset MPU memory space threshold, the firmware is divided into a plurality of area blocks greater than 2, and each area block is divided into at least 5 data segments. Therefore, if the memory space of the current firmware is greater than the second preset MPU memory space threshold of 100MB, the data segments of the plurality of area blocks of the current firmware are randomly sampled within the third preset MPU time length of 10s. The specific process of randomly sampling the data segments of the plurality of area blocks of the current firmware is consistent with the process of sampling the firmware whose memory space is between the first preset MPU memory space threshold and the second preset MPU memory space threshold, and will not be repeated here.
[0075] In this embodiment, after identifying that the current firmware is the MPU firmware, the current firmware is detected through the MPU detection mode. And, according to the memory space of the current firmware, under the startup time requirement of the vehicle network communication, a specific detection method is performed on the current firmware. For example, if the memory space of the current firmware is less than 50MB, then within 2s, the area blocks of the current firmware on multiple area disks of the MPU are randomly sampled; if the memory space of the current firmware is greater than 100MB, then within 10s, the data segments of the area blocks of the current firmware are randomly sampled. Therefore, by performing a specific detection method on the current firmware according to the memory space of the current firmware and the startup time of the vehicle network communication, the situation of excessive startup time in the ECU safety startup phase is effectively avoided, which not only ensures the integrity and legitimacy of the program software in different core ECUs, but also improves the performance of the vehicle and the user experience.
[0076] After the current firmware is detected, step S103 is executed to use the next firmware as a new current firmware and detect the new current firmware until each firmware of the electronic controller passes the detection, and then the electronic controller is controlled to run.
[0077] Specifically, after detecting the current firmware, the next firmware is used as the new current firmware and the new current firmware is detected, and so on, until each firmware of the ECU is detected, and the normal operation of the electronic controller ECU is controlled to achieve the normal operation of the ECU efficiently and quickly, which not only ensures the integrity and legality of ECU software with different cores and other information security issues, but also meets the performance of the whole vehicle and a good user experience, which helps to improve the overall competitiveness of automobile companies.
[0078] Embodiment 2
[0079] Based on the same inventive concept, the second embodiment of the present invention also provides a detection device for a vehicle electronic controller during the startup phase, such as Figure 2 As shown, including:
[0080] The acquisition module 201 is used to acquire the current firmware of the electronic controller after the electronic controller of the vehicle is powered on and the boot loader of the electronic controller passes the verification;
[0081] The judging module 202 is configured to detect the current firmware through an MCU detection mode of the MCU if the current firmware is the MCU firmware of the microcontroller unit MCU of the electronic controller;
[0082] The control module 203 is used to, after detecting the current firmware, take the next firmware as a new current firmware, detect the new current firmware, and control the electronic controller to run after each firmware of the electronic controller passes the detection.
[0083] As an optional embodiment, detecting the current firmware through an MCU detection mode of the MCU includes:
[0084] Acquire the memory space of the current firmware;
[0085] If the memory space of the current firmware is not greater than the first preset MCU memory space threshold, verifying the firmware content of the current firmware within the first preset MCU time length;
[0086] If the memory space of the current firmware is greater than the first preset MCU memory space threshold, and the memory space of the current firmware is not greater than the second preset MCU memory space threshold, then within the second preset MCU duration, a specified area block in the current firmware is sampled, wherein the second preset MCU memory space threshold is greater than the first preset MCU memory space threshold, and the memory space of the specified area block is not less than the preset area block memory threshold;
[0087] If the memory space of the current firmware is greater than the second preset MCU memory space threshold, and the memory space of the current firmware is not greater than the third preset MCU memory space threshold, then within the third preset MCU time length, the critical data segments of the current firmware are verified, and the non-critical data segments of the current firmware are randomly checked, wherein the third preset MCU memory space threshold is greater than the second preset MCU memory space threshold.
[0088] As an optional embodiment, after obtaining the memory space of the current firmware, the method further includes:
[0089] If the memory space of the current firmware is greater than the third preset MCU memory space threshold, then within a fourth preset MCU duration, key data blocks in the current firmware are randomly sampled.
[0090] As an optional embodiment, the determination module 202 is configured to:
[0091] If the current firmware is the MPU firmware of the microprocessor MPU of the electronic controller, the current firmware is detected through the MPU detection mode of the MPU.
[0092] As an optional embodiment, detecting the current firmware through the MPU detection mode of the MPU includes:
[0093] Acquire the memory space of the current firmware;
[0094] If the memory space of the current firmware is not greater than the first preset MPU memory space threshold, then within the first preset MPU duration, the area blocks of the current firmware on multiple zone disks of the MPU are randomly checked, wherein the number of area blocks on each zone disk is not less than the preset zone disk area block number threshold.
[0095] As an optional embodiment, after obtaining the memory space of the current firmware, the method further includes:
[0096] If the memory space of the current firmware is greater than the first preset MPU memory space threshold, and the memory space of the current firmware is not greater than the second preset MPU memory space threshold, then within the second preset MPU time length, randomly check the data segments of multiple area blocks of the current firmware, wherein the number of area blocks of the current firmware is greater than the first preset area block number threshold, the number of data segments of each area block is not less than the first preset data segment number threshold, and the second preset MPU memory space threshold is greater than the first preset MPU memory space threshold.
[0097] As an optional embodiment, after obtaining the memory space of the current firmware, the method further includes:
[0098] If the memory space of the current firmware is greater than the second preset MPU memory space threshold, then within the third preset MPU time length, the data segments of multiple area blocks of the current firmware are randomly checked, wherein the number of area blocks of the current firmware is greater than the second preset area block number threshold, and the number of data segments of each area block is not less than the second preset data segment number threshold.
[0099] Since the detection device for the vehicle electronic controller at the startup stage introduced in this embodiment is a device used to implement the detection method for the vehicle electronic controller at the startup stage in the first embodiment of this application, based on the detection method for the vehicle electronic controller at the startup stage introduced in the first embodiment of this application, the technical personnel in this field can understand the specific implementation method and various variations of the detection device for the vehicle electronic controller at the startup stage of this embodiment, so how the detection device for the vehicle electronic controller at the startup stage implements the method in the first embodiment of this application is not introduced in detail here. As long as the technical personnel in this field implement the device used by the detection method for the vehicle electronic controller at the startup stage in the first embodiment of this application, it belongs to the scope of protection of this application.
[0100] Embodiment 3
[0101] Based on the same inventive concept, the third embodiment of the present invention also provides an electronic controller, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any one of the above-mentioned detection methods for the vehicle electronic controller during the startup phase are implemented.
[0102] Embodiment 4
[0103] Based on the same inventive concept, the fourth embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any method of the vehicle electronic controller detection method at the startup stage described in the first embodiment above.
[0104] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0105] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0106] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0108] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0109] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for detecting a vehicle electronic controller during the startup phase, characterized in that: include: After the electronic controller of the vehicle is powered on and the boot loader of the electronic controller passes verification, obtaining the current firmware of the electronic controller; If the current firmware is the MCU firmware of the microcontroller unit MCU of the electronic controller, detecting the current firmware through the MCU detection mode of the MCU; After detecting the current firmware, taking the next firmware as a new current firmware, detecting the new current firmware, until each firmware of the electronic controller passes the detection, and then controlling the electronic controller to run; The detecting the current firmware by using the MCU detection mode of the MCU includes: Acquire the memory space of the current firmware; If the memory space of the current firmware is not greater than the first preset MCU memory space threshold, verifying the firmware content of the current firmware within the first preset MCU time length; If the memory space of the current firmware is greater than the first preset MCU memory space threshold, and the memory space of the current firmware is not greater than the second preset MCU memory space threshold, then within the second preset MCU duration, a specified area block in the current firmware is sampled, wherein the second preset MCU memory space threshold is greater than the first preset MCU memory space threshold, and the memory space of the specified area block is not less than the preset area block memory threshold; If the memory space of the current firmware is greater than the second preset MCU memory space threshold, and the memory space of the current firmware is not greater than the third preset MCU memory space threshold, then within the third preset MCU time length, the critical data segments of the current firmware are verified, and the non-critical data segments of the current firmware are randomly checked, wherein the third preset MCU memory space threshold is greater than the second preset MCU memory space threshold.
2. The method according to claim 1, characterized in that After obtaining the memory space of the current firmware, the method further includes: If the memory space of the current firmware is greater than the third preset MCU memory space threshold, then within a fourth preset MCU duration, key data blocks in the current firmware are randomly sampled.
3. The method according to claim 1, characterized in that After obtaining the current firmware of the electronic controller, the method further includes: If the current firmware is the MPU firmware of the microprocessor MPU of the electronic controller, the current firmware is detected through the MPU detection mode of the MPU.
4. The method according to claim 3, characterized in that The detecting the current firmware through the MPU detection mode of the MPU includes: Acquire the memory space of the current firmware; If the memory space of the current firmware is not greater than the first preset MPU memory space threshold, then within the first preset MPU duration, the area blocks of the current firmware on multiple zone disks of the MPU are randomly checked, wherein the number of area blocks on each zone disk is not less than the preset zone disk area block number threshold.
5. The method according to claim 4, characterized in that After obtaining the memory space of the current firmware, the method further includes: If the memory space of the current firmware is greater than the first preset MPU memory space threshold, and the memory space of the current firmware is not greater than the second preset MPU memory space threshold, then within the second preset MPU time length, randomly check the data segments of multiple area blocks of the current firmware, wherein the number of area blocks of the current firmware is greater than the first preset area block number threshold, the number of data segments of each area block is not less than the first preset data segment number threshold, and the second preset MPU memory space threshold is greater than the first preset MPU memory space threshold.
6. The method according to claim 5, characterized in that After obtaining the memory space of the current firmware, the method further includes: If the memory space of the current firmware is greater than the second preset MPU memory space threshold, then within the third preset MPU time length, the data segments of multiple area blocks of the current firmware are randomly checked, wherein the number of area blocks of the current firmware is greater than the second preset area block number threshold, and the number of data segments of each area block is not less than the second preset data segment number threshold.
7. A detection device for a vehicle electronic controller during the startup phase, characterized in that: include: An acquisition module, used for acquiring the current firmware of the electronic controller after the electronic controller of the vehicle is powered on and the boot loader of the electronic controller passes verification; A judgment module, configured to detect the current firmware through an MCU detection mode of the MCU if the current firmware is the MCU firmware of the microcontroller unit MCU of the electronic controller; The detecting the current firmware by using the MCU detection mode of the MCU includes: Acquire the memory space of the current firmware; If the memory space of the current firmware is not greater than the first preset MCU memory space threshold, verifying the firmware content of the current firmware within the first preset MCU time length; If the memory space of the current firmware is greater than the first preset MCU memory space threshold, and the memory space of the current firmware is not greater than the second preset MCU memory space threshold, then within the second preset MCU duration, a specified area block in the current firmware is sampled, wherein the second preset MCU memory space threshold is greater than the first preset MCU memory space threshold, and the memory space of the specified area block is not less than the preset area block memory threshold; If the memory space of the current firmware is greater than the second preset MCU memory space threshold, and the memory space of the current firmware is not greater than the third preset MCU memory space threshold, then within the third preset MCU time length, the critical data segments of the current firmware are verified, and the non-critical data segments of the current firmware are randomly checked, wherein the third preset MCU memory space threshold is greater than the second preset MCU memory space threshold; a control module is used to, after detecting the current firmware, take the next firmware as the new current firmware, detect the new current firmware, and control the operation of the electronic controller after each firmware of the electronic controller passes the detection.
8. An electronic controller comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method steps according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method steps as claimed in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Power-on self-detection method
CN101192181A