Upgrading method and device of boot loader, electronic equipment and storage medium

By using preset areas or flash free areas in the on-board controller to flash and upgrade the boot loader, the problems of high resource occupation and cost in traditional methods are solved, and efficient and safe boot loader and application upgrades are achieved. .

CN119025146APending Publication Date: 2024-11-26CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411107945.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The traditional bootloader upgrade method requires additional software and hardware or upgrade program storage space, resulting in increased resource usage and cost, making it difficult to efficiently complete the upgrade of bootloader and specified applications.

Method used

By obtaining the updated boot loader from the preset area, performing a flash operation, and upgrading the specified application based on the successful flash boot loader. If the flash fails, restore the historical program and use the flash free area to store the update bootloader to avoid additional hardware burden.

Benefits of technology

It realizes the rapid and secure upgrade of boot loaders and designated applications under existing resource conditions, reduces the hardware and storage space requirements, and improves upgrade efficiency and system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025146A_ABST
    Figure CN119025146A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of vehicles, and discloses a boot loader upgrading method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining an updated boot loader from a preset area, and carrying out a flashing operation on a current boot loader based on the updated boot loader; wherein the preset area is an address area of a specified application program in the vehicle-mounted controller or a flash memory free area in the vehicle-mounted controller; and if the flashing is successful, upgrading the specified application program according to the successfully-flashed boot loader. According to the application, the updated boot loader is stored in the resource idle area in the existing scene, so that the boot loader and the specified application can be upgraded without adding extra software and hardware burdens.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and in particular to a method, device, electronic device and storage medium for upgrading a boot loader. Background Art

[0002] With the development of automobile electronics and intelligence, the software upgrade of vehicle controllers (ECU, Electronic Control Unit) has become increasingly important. As the first program to run when the ECU starts, the bootloader is responsible for initializing hardware devices and loading the operating system kernel. Traditional bootloader upgrade methods have limitations and require additional upgrade hardware or additional upgrade program storage space to successfully complete the upgrade of the bootloader and specified applications. Summary of the invention

[0003] In view of the above problems, the present application provides a method, device, electronic device and storage medium for upgrading a boot loader, which optimizes the resources required for the upgrade without the need for additional software and hardware to ensure the completion of the upgrade of the boot loader and specified applications.

[0004] According to one aspect of the present application, a method for upgrading a boot loader is provided, the method comprising: obtaining an updated boot loader from a preset area, and flashing the current boot loader based on the updated boot loader; wherein the preset area is an address area of ​​a specified application in a vehicle controller, or a free area of ​​a flash memory in the vehicle controller; if the flashing is successful, the specified application is upgraded according to the successfully flashed boot loader.

[0005] In an optional manner, the upgrade method also includes: controlling the original boot loader to flash the upgrade program to the address area of ​​the specified application in the vehicle controller, so that the upgrade program updates the original boot loader and flashes the updated boot loader to the space corresponding to the address area; or controlling the original boot loader to flash the updated boot loader to the free area of ​​the flash memory in the vehicle controller.

[0006] In an optional manner, the upgrade method also includes: detecting whether the updated boot loader is compatible with the designated application, and whether the memory free area of ​​the vehicle controller is larger than the preset memory free area; if both are yes, executing the step of controlling the original boot loader to flash the upgrade program to the address area of ​​the designated application in the vehicle controller; if either is no, executing the step of controlling the original boot loader to flash the updated boot loader to the flash memory free area in the vehicle controller.

[0007] In an optional manner, the upgrade method also includes: if the safety performance requirement of the on-board controller is greater than the preset safety performance requirement, or the real-time operation performance requirement of the on-board controller is greater than the preset real-time operation performance requirement, then executing the step of controlling the original boot loader to flash the updated boot loader to the free area of ​​the flash memory in the on-board controller.

[0008] In an optional manner, the upgrade method also includes: calculating a hash value corresponding to the acquired new version of the boot loader based on a preset function, and matching the hash value with the original hash value; wherein the original hash value is a parameter calculated for the original new version of the boot loader; if the match is successful, the new version of the boot loader is flashed into the preset area as an updated boot loader.

[0009] In an optional manner, before upgrading the designated application according to the successfully flashed boot loader, the upgrading method further includes: performing an integrity check on the successfully flashed boot loader, and if the integrity check passes, matching the snapshot data corresponding to the successfully flashed boot loader with the snapshot data corresponding to the updated boot loader; if the match is successful, executing the step of upgrading the designated application according to the successfully flashed boot loader.

[0010] In an optional manner, the flashing operation on the current boot loader based on the updated boot loader further includes: if the flashing fails, restoring the current boot loader to a historical boot loader; wherein the historical boot loader is a historical program stored in a backup area in the flash memory.

[0011] According to another aspect of the present application, a boot loader upgrade device is provided, the upgrade device comprising: a flashing module, used to obtain an updated boot loader from a preset area, and flash the current boot loader based on the updated boot loader; wherein the preset area is an address area of ​​a specified application in a vehicle controller, or a free area of ​​a flash memory in the vehicle controller; and an upgrade module, used to upgrade the specified application according to the successfully flashed boot loader if the flashing is successful.

[0012] According to one aspect of the present application, an electronic device is provided, comprising: a controller; and a memory for storing one or more programs, wherein when the one or more programs are executed by the controller, the above-mentioned upgrading method is executed.

[0013] According to one aspect of the present application, a computer-readable storage medium is also provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the above-mentioned upgrading method.

[0014] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned upgrade method.

[0015] This application stores the updated boot loader in a preset area so that it can be quickly obtained to flash the current boot loader, and upgrade the specified application after the flash is successfully written. The preset area can be the address area where the application is executed, or the free area of ​​the flash memory in the vehicle controller, that is, by storing the updated boot loader in the free area of ​​resources in the existing scene, the boot loader and the specified application can be upgraded without adding additional software and hardware burdens.

[0016] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 It is a flowchart of a boot loader upgrade method shown in an exemplary embodiment of the present application.

[0019] Figure 2 It is a flow chart of updating a boot loader program by using memory space according to a preferred embodiment of the present application.

[0020] Figure 3 It is a flow chart of updating the boot loader program by using flash memory space according to a preferred embodiment of the present application.

[0021] Figure 4 is based on Figure 1 A schematic flow chart of another method for upgrading a boot loader is shown.

[0022] Figure 5 It is a structural schematic diagram of a boot loader upgrade device shown in an exemplary embodiment of the present application.

[0023] Figure 6 It is a structural diagram of a computer system of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0024] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0025] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0026] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0027] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0028] As the first program to run when the ECU starts, the bootloader is responsible for initializing hardware devices and loading the operating system kernel. Existing bootloader upgrade methods have limitations, requiring additional upgrade hardware or additional upgrade program storage space to successfully complete the upgrade of the bootloader and specified applications.

[0029] To this end, one aspect of the present application provides a method for upgrading a boot loader. Figure 1 , Figure 1 1 is a flowchart of a boot loader upgrade method shown in an exemplary embodiment of the present application. The upgrade method at least includes S110 to S120, which are described in detail as follows:

[0030] S110: Obtain an updated boot loader from a preset area, and flash the current boot loader based on the updated boot loader; wherein the preset area is an address area of ​​a specified application in the vehicle controller, or a free area of ​​a flash memory in the vehicle controller.

[0031] The preset area is used to store the updated boot loader. This embodiment optimizes the storage space and can store the updated boot loader in a predetermined area within the application address or in an unused free memory area in the Flash memory, such as a spare Flash space.

[0032] S120: If the flashing is successful, the designated application is upgraded according to the successfully flashed boot loader.

[0033] In some embodiments, after the specified application is upgraded, it is necessary to restart the specified application or restart the vehicle controller for the upgrade to take effect. At the same time, in order to ensure system stability and security, the old version of the boot loader can be deleted or deleted, or a flag bit can be updated to indicate the version of the currently running boot loader.

[0034] In some embodiments, before upgrading the designated application according to the successfully written boot loader, the execution subject performs an integrity check on the successfully written boot loader, and if the integrity check passes, matches the snapshot data corresponding to the successfully written boot loader with the snapshot data corresponding to the updated boot loader. The integrity check includes but is not limited to a data matching check method, a data coincidence check method, a hash value comparison check method, and the like.

[0035] If the match is successful, the specified application is upgraded according to the boot loader that is successfully flashed; if the match fails, the automatic rollback mechanism uses the data in the backup area or the snapshot data to automatically roll back to the original stable version of the data to ensure the normal operation of the vehicle controller. Among them, the snapshot data is stored in a safe location inside the vehicle controller, that is, an independent area of ​​non-volatile storage, and the snapshot data includes but is not limited to the relevant application data in the memory and storage (such as Flash).

[0036] If the flashing fails, the current boot loader is restored to the historical boot loader; wherein the historical boot loader is a historical program stored in the backup area of ​​the flash memory.

[0037] In some embodiments, a dual Flash strategy is implemented: the Flash memory in the vehicle controller is divided into a main area and a backup area, the main area is used to store currently running applications and boot loaders, and the backup area is used to store backup copies of data. In some embodiments, an error message is also given to indicate that the flash write failed.

[0038] This embodiment stores the updated boot loader in a preset area so as to quickly obtain it to perform a flash operation on the current boot loader, and upgrade the specified application after the flash is successfully written. The preset area may be an address area for executing the application, or a free area of ​​flash memory in the vehicle controller, that is, by storing the updated boot loader in a free area of ​​resources in the existing scenario, the boot loader and the specified application can be upgraded without adding additional software and hardware burdens.

[0039] In another exemplary embodiment of the present application, how to flash the updated boot loader into the preset area is described in detail. Figure 1 Based on S110 to S120 shown, the upgrade method further includes S10 or S11, which is described in detail as follows:

[0040] S10: Control the original boot loader to write the upgrade program to the address area of ​​the specified application in the vehicle controller, so that the upgrade program updates the original boot loader and writes the updated boot loader to the space corresponding to the address area.

[0041] Exemplarily, the original BootLoader (original boot loader) flashes the BootStagingZone program (i.e., the upgrade program) to the address area of ​​the specified application in the vehicle controller. The BootStagingZone program takes control. The BootStagingZone program obtains the latest version of the BootLoader from a predetermined secure channel and updates the original BootLoader to obtain the updated BootLoader. The BootStagingZone program flashes the updated BootLoader to the space corresponding to the address area of ​​the specified application in the vehicle controller.

[0042] Please refer to Figure 2 , Figure 2 This is a flow chart of updating the boot loader using memory space according to a preferred embodiment of the present application. The specific description is as follows:

[0043] In the single BootLoader mode, a BootStagingZone program is designed, which is used to flash the BootLoader code. The BootStagingZone program flashes the updated Bootloader in the specified APP (Application) address segment (i.e., memory area). Among them, BootLoader is a boot loader that runs before the operating system kernel runs.

[0044] A special program named BootStagingZone is developed in the APP address segment of the ECU. This program is responsible for updating the BootLoader, including receiving, verifying and flashing new BootLoader code.

[0045] The original BootLoader flashes the BootStagingZone program to the predetermined area within the APP address segment of the ECU. After the BootStagingZone is flashed, the system control is transferred to the BootStagingZone program to perform the update, that is, the control is transferred from the original BootLoader to the BootStagingZone to ensure that the update process starts smoothly. The BootStagingZone program will obtain the latest BootLoader version from a predetermined secure channel. After verifying the integrity and security of the latest BootLoader, BootStagingZone will write it to the preset area of ​​the ECU, that is, the updated BootLoader will be flashed to the preset area. After the updated BootLoader is successfully flashed and verified, BootStagingZone will guide the use of the updated BootLoader to update the specified APP program, that is, to perform an upgrade operation on the specified APP program.

[0046] The essence of the whole process is to use an address area different from the BootLoader to flash a code that can update the BootLoader (i.e., the BootStagingZone program). After updating the BootLoader, the updated BootLoader is used to update the specified APP program.

[0047] S11: Control the original boot loader to flash the updated boot loader to the free area of ​​the flash memory in the vehicle controller.

[0048] Exemplarily, the original BootLoader writes the updated BootLoader to the spare Flash space in the vehicle controller, so that the updated BootLoader can be directly loaded from the spare Flash space and quickly started later.

[0049] Please refer to Figure 3 , Figure 3 This is a flow chart of updating the boot loader using flash memory space according to a preferred embodiment of the present application. The specific description is as follows:

[0050] In the Flash / RAM memory of the ECU, a flash free area is identified as additional storage space. At startup, the ECU first loads and executes the original BootLoader installed in the main storage area. The original BootLoader transfers and stores the new version of the BootLoader to the identified free memory area.

[0051] The ECU loads and starts the updated BootLoader from the free area of ​​the flash memory, and updates the original BootLoader in the main storage area of ​​the ECU. After the update is complete, the updated BootLoader is run, which may involve resetting the ECU or restarting the BootLoader to ensure that the new version takes effect. Finally, in order to ensure system stability and security, the original BootLoader version in the spare area can be deleted or invalidated, or a flag bit can be updated to indicate the currently running BootLoader version.

[0052] This embodiment provides two ways to flash the updated boot loader to a preset area, and controls the original boot loader to perform corresponding operations to flash the updated boot loader to the address area of ​​the specified application in the vehicle controller, or the free area of ​​the flash memory in the vehicle controller. Two completely different flashing methods are provided to facilitate adaptive selection according to the real-time operation of the system.

[0053] Regarding how to select the above two different flashing methods to flash the updated boot loader to the preset area, in another exemplary embodiment of the present application, it is described in detail as follows:

[0054] Detect whether the updated bootloader is compatible with the specified application and whether the memory free area of ​​the vehicle controller is larger than the preset memory free area.

[0055] If both are yes, then the above S10 is executed, that is, the original boot loader is controlled to flash the upgrade program to the address area of ​​the specified application in the vehicle controller. This situation indicates that the free memory area of ​​the vehicle controller is sufficient to accommodate the updated boot loader and the specified application, and the updated boot loader is compatible with the specified application.

[0056] If any one of them is no, then the above S11 is executed, that is, the original boot loader is controlled to flash the updated boot loader to the free area of ​​the flash memory in the vehicle controller. This situation indicates that the free area of ​​the memory of the vehicle controller is not enough to accommodate the updated boot loader and the specified application, and / or the updated boot loader is incompatible with the specified application.

[0057] In another exemplary embodiment, the safety performance requirements or real-time operation performance requirements of the vehicle controller may be considered, that is, detecting whether the safety performance requirements of the vehicle controller are greater than the preset safety performance requirements, or detecting whether the real-time operation performance requirements of the vehicle controller are greater than the preset real-time operation performance requirements.

[0058] If the safety performance requirement of the vehicle controller is greater than the preset safety performance requirement, or the real-time operation performance requirement of the vehicle controller is greater than the preset real-time operation performance requirement, then execute the above S11, that is, control the original boot loader to flash the updated boot loader to the free area of ​​the flash memory in the vehicle controller.

[0059] The method shown in S11 can update the boot loader without interfering with the currently running system, and the security performance requirements in the process are lower than those required by S10. At the same time, the method shown in S11 can be upgraded in the background without interrupting the current system operation. The method shown in S10 may require suspending some system functions during the upgrade, which may affect real-time performance. Therefore, the method shown in S10 is suitable for situations with low security performance requirements or low real-time operation performance requirements.

[0060] In another exemplary embodiment of the present application, the pre-verification step of flashing the updated boot loader to the preset area is described in detail. Figure 4 , Figure 4 is based on Figure 1 FIG. 1 is a flow chart of another method for upgrading a boot loader. Figure 1 Based on the S110 to S120 shown, S410 to S420 are also included, which are described in detail as follows:

[0061] S410: Calculate a hash value corresponding to the acquired new version of the boot loader based on a preset function, and match the hash value with the original hash value; wherein the original hash value is a parameter calculated for the original new version of the boot loader.

[0062] The new version of the boot loader is a program obtained from a predetermined secure channel. In order to avoid errors during transmission, a hash value check is required to ensure the integrity and consistency of the obtained new version of the boot loader.

[0063] A hash value calculation function (such as SHA-256) is used to calculate the hash value of the acquired new version boot loader to obtain a first hash value; at the same time, the preset hash value calculation function is used to calculate the hash value of the original new version boot loader (the source of the data) to obtain a second hash value; if the new version boot loader does not have data loss or error during the transmission process, the first hash value and the second hash value will match successfully, otherwise the match will fail.

[0064] S420: If the match is successful, the new version of the boot loader is flashed into the preset area as the updated boot loader.

[0065] If the match is successful, it indicates that the obtained new version of the boot loader is the expected version, and it can be written into the preset area as the updated boot loader.

[0066] This embodiment provides a verification method to ensure the complete transmission of data. By calculating the hash value corresponding to the corresponding program data and matching the calculated hash value, it can be quickly determined whether data omission or loss occurs during the data transmission process based on the matching result.

[0067] Another aspect of the present application also provides a boot loader upgrade device, such as Figure 5 As shown, Figure 5 1 is a schematic diagram of a structure of a boot loader upgrade device shown in an exemplary embodiment of the present application. The upgrade device 500 includes: a flashing module 510, which is used to obtain an updated boot loader from a preset area, and flash the current boot loader based on the updated boot loader; wherein the preset area is an address area of ​​a specified application in the vehicle controller, or a free area of ​​a flash memory in the vehicle controller; and an upgrade module 530, which is used to upgrade the specified application according to the successfully flashed boot loader if the flashing is successful.

[0068] In another exemplary embodiment, the upgrade device 500 also includes: a first control module, used to control the original boot loader to flash the upgrade program to the address area of ​​the specified application in the vehicle controller, so that the upgrade program updates the original boot loader and enables the upgrade program to flash the updated boot loader to the space corresponding to the address area; or a second control module, used to control the original boot loader to flash the updated boot loader to the free area of ​​the flash memory in the vehicle controller.

[0069] In another exemplary embodiment, the upgrading device 500 further includes: a first detection module, used to detect whether the updated boot loader is compatible with the specified application, and whether the memory free area of ​​the vehicle controller is larger than the preset memory free area; a first detection execution module, used to execute the step of controlling the original boot loader to flash the upgrade program to the address area of ​​the specified application in the vehicle controller if both are yes; a second detection execution module, used to execute the step of controlling the original boot loader to flash the updated boot loader to the flash free area in the vehicle controller if either is no.

[0070] In another exemplary embodiment, the upgrading device 500 also includes: a second detection module, which is used to execute the step of controlling the original boot loader to flash the updated boot loader to the free area of ​​the flash memory in the vehicle controller if the safety performance requirement of the vehicle controller is greater than the preset safety performance requirement, or the real-time operation performance requirement of the vehicle controller is greater than the preset real-time operation performance requirement.

[0071] In another exemplary embodiment, the upgrading device 500 also includes: a calculation module, which is used to calculate the hash value corresponding to the acquired new version of the boot loader based on a preset function, and match the hash value with the original hash value; wherein the original hash value is a parameter calculated for the original new version of the boot loader; a matching module, which is used to flash the new version of the boot loader as an updated boot loader into a preset area if the match is successful.

[0072] In another exemplary embodiment, the upgrading device 500 further includes: a verification module, which is used to perform an integrity check on the successfully flashed boot loader, and if the integrity check passes, matches the snapshot data corresponding to the successfully flashed boot loader with the snapshot data corresponding to the updated boot loader; and a successful matching module, which is used to execute the step of upgrading the specified application according to the successfully flashed boot loader if the match is successful.

[0073] In another exemplary embodiment, the flashing module 510 further includes: a flashing failure unit, configured to restore the current boot loader to a historical boot loader if the flashing fails; wherein the historical boot loader is a historical program stored in a backup area in the flash memory.

[0074] The upgrade device of the present application stores the updated boot loader in a preset area so as to quickly obtain the current boot loader for flashing, and upgrades the specified application after the flashing is successful. The preset area may be the address area for executing the application, or the free area of ​​the flash memory in the vehicle controller, that is, by storing the updated boot loader in the free area of ​​resources in the existing scene, the upgrade operation of the boot loader and the specified application can be performed without adding additional software and hardware burdens.

[0075] It should be noted that the upgrade device provided in the above embodiment and the upgrade method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.

[0076] Another aspect of the present application provides an electronic device, comprising: a controller; and a memory for storing one or more programs, which, when executed by the controller, executes the above-mentioned upgrading method.

[0077] See also Figure 6 , Figure 6 1 is a schematic diagram of the structure of a computer system of an electronic device shown in an exemplary embodiment of the present application, which shows a schematic diagram of the structure of a computer system of an electronic device suitable for implementing an embodiment of the present application.

[0078] It should be noted that Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0079] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603, such as executing the method in the above embodiment. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, ROM 602 and RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0080] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.

[0081] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 609, and / or installed from a removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, various functions defined in the system of the present application are executed.

[0082] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0083] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0084] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0085] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned upgrade method is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0086] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the upgrade method provided in each of the above embodiments.

[0087] According to one aspect of an embodiment of the present application, a computer system is also provided, including a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM), such as executing the method in the above embodiment. In RAM, various programs and data required for system operation are also stored. CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0088] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.

[0089] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A method for upgrading a boot loader, characterized in that: The upgrading method comprises: Obtaining an updated boot loader from a preset area, and flashing the current boot loader based on the updated boot loader; wherein the preset area is an address area of ​​a specified application in the vehicle controller, or a free area of ​​a flash memory in the vehicle controller; If the flashing is successful, the designated application is upgraded according to the successfully flashed boot loader.

2. The upgrading method according to claim 1, characterized in that: The upgrading method further comprises: Controlling the original boot loader to write the upgrade program to the address area of ​​the specified application in the vehicle controller, so that the upgrade program updates the original boot loader and writes the updated boot loader to the space corresponding to the address area; or The original boot loader is controlled to flash the updated boot loader to a free area of ​​the flash memory in the vehicle controller.

3. The upgrading method according to claim 2, characterized in that: The upgrading method further comprises: detecting whether the updated boot loader is compatible with the specified application and whether the memory free area of ​​the vehicle controller is larger than a preset memory free area; If both are yes, then executing the step of controlling the original boot loader to flash the upgrade program to the address area of ​​the designated application in the vehicle controller; If any one of the answers is no, the step of controlling the original boot loader to flash the updated boot loader to the free area of ​​the flash memory in the vehicle controller is executed.

4. The upgrading method according to claim 2, characterized in that: The upgrading method further comprises: If the safety performance requirement of the on-board controller is greater than the preset safety performance requirement, or the real-time operation performance requirement of the on-board controller is greater than the preset real-time operation performance requirement, the step of controlling the original boot loader to flash the updated boot loader to the free area of ​​the flash memory in the on-board controller is executed.

5. The upgrading method according to claim 1, characterized in that: The upgrading method further comprises: Calculating a hash value corresponding to the acquired new version of the boot loader based on a preset function, and matching the hash value with the original hash value; wherein the original hash value is a parameter calculated for the original new version of the boot loader; If the match is successful, the new version of the boot loader is flashed into the preset area as an updated boot loader.

6. The upgrading method according to claim 1, characterized in that: Before upgrading the designated application according to the successfully written boot loader, the upgrading method further includes: Performing an integrity check on the successfully written boot loader, and if the integrity check passes, matching the snapshot data corresponding to the successfully written boot loader with the snapshot data corresponding to the updated boot loader; If the match is successful, the step of upgrading the designated application according to the successfully flashed boot loader is performed.

7. The upgrading method according to any one of claims 1 to 6, characterized in that: The flashing operation on the current boot loader program based on the updated boot loader program further includes: If the flashing fails, the current boot loader is restored to a historical boot loader; wherein the historical boot loader is a historical program stored in a backup area in the flash memory.

8. A boot loader upgrade device, characterized in that: The upgrading device comprises: A flashing module, used for obtaining an updated boot loader from a preset area, and flashing the current boot loader based on the updated boot loader; wherein the preset area is an address area of ​​a specified application in the vehicle controller, or a free area of ​​a flash memory in the vehicle controller; The upgrade module is used to upgrade the specified application according to the successfully flashed boot loader if the flashing is successful.

9. An electronic device, characterized in that: include: Controller; A memory for storing one or more programs, which, when executed by the controller, enables the controller to implement the upgrading method described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the upgrading method according to any one of claims 1 to 7.