CN116820512A - Method, device, equipment and storage medium for updating bootstrap program - Google Patents

Method, device, equipment and storage medium for updating bootstrap program Download PDF

Info

Publication number
CN116820512A
CN116820512A CN202310747452.5A CN202310747452A CN116820512A CN 116820512 A CN116820512 A CN 116820512A CN 202310747452 A CN202310747452 A CN 202310747452A CN 116820512 A CN116820512 A CN 116820512A
Authority
CN
China
Prior art keywords
bootstrap
program
code module
bootstrap program
updated
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310747452.5A
Other languages
Chinese (zh)
Inventor
李富民
陈娜娜
付世杰
徐龙增
张增仁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weichai Power Co Ltd
Weifang Weichai Power Technology Co Ltd
Original Assignee
Weichai Power Co Ltd
Weifang Weichai Power Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Weichai Power Co Ltd, Weifang Weichai Power Technology Co Ltd filed Critical Weichai Power Co Ltd
Priority to CN202310747452.5A priority Critical patent/CN116820512A/en
Publication of CN116820512A publication Critical patent/CN116820512A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a method, a device, equipment and a storage medium for updating a bootstrap program. When the method is executed, a first code module of a first bootstrap program is firstly utilized to judge whether the first bootstrap program is updated or not, if so, the first bootstrap program is jumped to a second bootstrap program; later, a first bootstrap program update file of the first bootstrap program is determined in the second bootstrap program; the first bootstrap program updating file is used for updating the first bootstrap program; and finally, executing the updated first bootstrap program to update the second code module of the first bootstrap program by using the first bootstrap program update file of the first bootstrap program. In this way, the first code module of the first bootstrap program is used as the starting area, and whether the first bootstrap program is updated or not is judged through the first code module of the first bootstrap program, so that the second bootstrap program only updates the second code module of the first bootstrap program, but does not update the starting area, and the possibility of update failure in the process of updating the code of the starting area is reduced.

Description

Method, device, equipment and storage medium for updating bootstrap program
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for updating a boot program.
Background
The electronic control unit (Electronic Control Unit, ECU for short) is also called a "traveling computer", "vehicle-mounted computer", etc. Generally, a bootstrap program (BootLoader) is used to update an application program, but the normal operation of the ECU is seriously affected by a bug existing in the BootLoader program, so the BootLoader program also faces the requirement of updating and upgrading.
In the related art, the upgrade guidance scheme includes a first guidance+a second guidance+an application program mode, wherein both the first guidance and the second guidance can be used as a guidance program of the ECU, and the first guidance can update the second guidance, but there is a case that the first guidance needs to be updated, because the first guidance is in a start-up area, updating the first guidance has a great risk, and for an already packaged electronic control unit, if the first guidance is unexpected in the updating process, the ECU may be down.
Therefore, how to solve the problem that the system cannot operate normally due to the failure of the first boot process update is urgent.
Disclosure of Invention
In view of the above, the present application provides a method, apparatus, device and storage medium for updating a boot program, which aims to prevent the failure of updating the first boot program to a certain extent and ensure the normal operation of the system.
In a first aspect, the present application provides a boot program updating method, where the boot program includes a first boot program and a second boot program, and the method includes:
determining, with a first code module of a first boot program, whether the first boot program needs to be updated, and jumping from the first boot program to a second boot program when the first boot program needs to be updated;
determining a first bootstrap update file of the first bootstrap in the second bootstrap; the first bootstrap update file is used for updating the first bootstrap;
and executing the updated first bootstrap program to update the second code module of the first bootstrap program by using a first bootstrap program update file of the first bootstrap program.
Optionally, the determining, by the first code module of the first bootstrap, whether the first bootstrap needs to be updated, and skipping from the first bootstrap to the second bootstrap when the first bootstrap needs to be updated, includes:
the first code module of the first bootstrap program judges whether the second code module of the first bootstrap program is complete;
if the second code module of the first bootstrap program is complete, jumping from the first code module of the first bootstrap program to the second code module of the first bootstrap program;
determining, by a second code module of a first bootstrap program, whether the first bootstrap program needs to be updated, and jumping from the second code module of the first bootstrap program to a second bootstrap program when the first bootstrap program needs to be updated.
Optionally, the determining, by the second code module of the first bootstrap, whether the first bootstrap needs to be updated includes:
the second code module of the first bootstrap program judges whether the second bootstrap program is complete;
and if the second bootstrap program is complete, detecting a first bootstrap program update identifier through the second bootstrap program to determine whether the first bootstrap program needs to be updated.
Optionally, the determining, by the second bootstrap detecting the first bootstrap update identifier, whether the first bootstrap needs to be updated includes:
judging whether a first bootstrap program update identifier exists in a public buffer area through a second bootstrap program, and determining that the first bootstrap program needs to be updated when the first bootstrap program update identifier exists in the public buffer area.
Optionally, the determining, by the first code module of the first bootstrap, whether the first bootstrap needs to be updated, and skipping from the first bootstrap to the second bootstrap when the first bootstrap needs to be updated, includes:
the first code module of the first bootstrap program judges whether the second code module of the first bootstrap program is complete;
if the second code module of the first bootstrap program is incomplete, determining that the first bootstrap program needs to be updated, and jumping from the first code module of the first bootstrap program to the second bootstrap program.
Optionally, the determining, by the first code module of the first bootstrap program, whether the first bootstrap program needs to be updated, and after the first bootstrap program jumps from the first bootstrap program to the second bootstrap program when the first bootstrap program needs to be updated, the method further includes:
the second bootstrap program is prohibited from updating the application program.
Optionally, the program data of the first bootstrap program is stored in a first partition, the first bootstrap program includes a first code module and a second code module, the program data of the first code module is stored in a first sub-partition of the first partition, and the program data of the second code module is stored in a second sub-partition of the first partition; the executing the updated first bootstrap program to update the second code module of the first bootstrap program with a first bootstrap program update file of the first bootstrap program includes:
erasing the original data stored in the second sub-partition of the first partition;
copying a first bootstrap update file of the first bootstrap to a second sub-partition of the first partition to update a second code module of the first bootstrap.
In a second aspect, the present application provides a boot program updating apparatus, the boot program including a first boot program and a second boot program, the apparatus comprising:
a first determining module, configured to determine, using a first code module of a first bootstrap, whether the first bootstrap needs to be updated, and skip from the first bootstrap to a second bootstrap when the first bootstrap needs to be updated;
a second determining module, configured to determine a first bootstrap update file of the first bootstrap in the second bootstrap; the first bootstrap update file is used for updating the first bootstrap;
and the updating module is used for executing the updated first bootstrap program so as to update the second code module of the first bootstrap program by using a first bootstrap program updating file of the first bootstrap program.
In a third aspect, the present application provides an apparatus comprising a memory for storing instructions or code and a processor for executing the instructions or code to cause the apparatus to perform the boot update method of the first aspect.
In a fourth aspect, the present application provides a computer storage medium having code stored therein, which when executed, implements the bootstrap updating method as described in the first aspect.
The application provides a bootstrap program updating method. When the method is executed, a first code module of a first bootstrap program is firstly utilized to determine whether the first bootstrap program needs to be updated, and when the first bootstrap program needs to be updated, the first bootstrap program jumps to a second bootstrap program; later, a first bootstrap program update file of the first bootstrap program is determined in the second bootstrap program; the first bootstrap program updating file is used for updating the first bootstrap program; and finally, executing the updated first bootstrap program to update the second code module of the first bootstrap program by using the first bootstrap program update file of the first bootstrap program. In this way, the first code module of the first bootstrap program is used as a starting area, only simple codes are included, and only the second code module of the first bootstrap program is updated when the second bootstrap program updates the first bootstrap program, but the starting area is not updated, so that the possibility of failure in updating the first bootstrap program in the updating process is reduced. Therefore, the situation that the first bootstrap program fails to update can be prevented to a certain extent, and the normal operation of the system is ensured.
Drawings
In order to more clearly illustrate this embodiment or the technical solutions of the prior art, the drawings that are required for the description of the embodiment or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a diagram of a layout of a bootstrap code in the related art;
FIG. 2 is a flowchart of a method for updating a boot program according to an embodiment of the present application;
FIG. 3 is a diagram illustrating a layout of a bootstrap code according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a bootstrap updating device according to an embodiment of the present application.
Detailed Description
As described above, fig. 1 is a schematic diagram of a code layout of a bootstrap program in the related art, and in conjunction with fig. 1, a mode of a first bootstrap+a second bootstrap+an application program is generally adopted for a scheme of upgrading the bootstrap program in the related art, where both the first bootstrap and the second bootstrap can be used as bootstrap programs of an ECU, and the first bootstrap can update the second bootstrap, but in an actual application process, there is a case that the first bootstrap needs to be updated, because the first bootstrap is in a start-up area, when the code amount of the first bootstrap is large, the probability of being brushed when updating the first bootstrap is large, and for an already packaged electronic control unit, if the first bootstrap is unexpected in the update process, the ECU may be down.
In order to solve the above problems, an embodiment of the present application provides a boot program update method. When the method is executed, a first code module of a first bootstrap program is firstly utilized to determine whether the first bootstrap program needs to be updated, and when the first bootstrap program needs to be updated, the first bootstrap program jumps to a second bootstrap program; later, a first bootstrap program update file of the first bootstrap program is determined in the second bootstrap program; the first bootstrap program updating file is used for updating the first bootstrap program; and finally, executing the updated first bootstrap program to update the second code module of the first bootstrap program by using the first bootstrap program update file of the first bootstrap program.
Therefore, the first code module of the first bootstrap program is used as a starting area, whether the first bootstrap program is updated or not is judged through the first code module of the first bootstrap program, and when the first bootstrap program needs to be updated, the second bootstrap program only updates the second code module of the first bootstrap program, but does not update the starting area, so that the possibility of update failure in the updating process of the first bootstrap program is reduced. Therefore, the situation that the first bootstrap program fails to update can be prevented to a certain extent, and the normal operation of the system is ensured.
It should be noted that, the embodiment of the present application is not limited to the execution body of the boot update method, and for example, the method of the embodiment of the present application may be applied to a data processing device such as a terminal device or a server. The terminal device may be a smart phone, a computer, a personal digital assistant (Personal Digital Assistant, PDA), a tablet computer, or the like. The servers may be stand alone servers, clustered servers, or cloud servers.
In order to make the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Fig. 2 is a flowchart of a method for updating a boot program according to an embodiment of the present application, and in conjunction with fig. 2, the method for updating a boot program according to an embodiment of the present application may include:
s201: a first code module of a first bootstrap program is utilized to determine whether the first bootstrap program needs to be updated, and when the first bootstrap program needs to be updated, the first bootstrap program jumps to a second bootstrap program.
In this embodiment, the first code module of the first boot program is used to boot the microcontroller to start and determine the execution program to be skipped, the second boot program is used to update the application program, and the application program is used to record the control service provided by the electronic controller. Fig. 3 is a schematic diagram of a bootstrap code layout provided in this embodiment of the present application, and in conjunction with fig. 3, the bootstrap code layout includes a first bootstrap program, a second bootstrap program and an APP (application program), where the first bootstrap program includes Block1 (first code module) and Block2 (second code module), it should be noted that, in this embodiment, the first code module is a complete program, and is composed of simple judgment type codes, and may be used to boot a microcontroller and determine an execution program to be skipped, and the first code module is fixedly stored in a sector area of a buffer area corresponding to the first bootstrap program, and when the first bootstrap program is updated, the program of the first code module is not updated.
In a specific embodiment, when the first code module of the first boot program determines whether the first boot program is updated, it needs to determine whether the second code module of the first boot program is complete, and when the second code module of the first boot program is complete, the step 201 of jumping from the first code module of the first boot program to the second code module of the first boot program determines whether the first boot program is updated, so that the step may specifically include: the first code module of the first bootstrap program judges whether the second code module of the first bootstrap program is complete; if the second code module of the first bootstrap program is complete, jumping from the first code module of the first bootstrap program to the second code module of the first bootstrap program; determining, by the second code module of the first bootstrap program, whether the first bootstrap program needs to be updated, and jumping from the second code module of the first bootstrap program to the second bootstrap program when the first bootstrap program needs to be updated. In this embodiment, since the first code module of the first bootstrap program only simply determines the skip code, when performing complex code operation, the first code module of the first bootstrap program skips to the corresponding target program, so that the target program is operated to achieve the purpose of determining whether the first bootstrap program is updated, and the effect of simplifying the first code module of the first bootstrap program is achieved.
In a specific embodiment, when the first code module of the first bootstrap program determines whether the first bootstrap program is updated, it needs to be determined whether the second code module of the first bootstrap program is complete, and when the second code module of the first bootstrap program is incomplete, it indicates that the first bootstrap program needs to be updated, in which case the first bootstrap program is directly skipped from the first code module of the first bootstrap program to the second bootstrap program so as to update the first bootstrap program through the second bootstrap program. Thus, the step 201 may specifically include: the first code module of the first bootstrap program judges whether the second code module of the first bootstrap program is complete; if the second code module of the first bootstrap program is incomplete, determining that the first bootstrap program needs to be updated, and jumping from the first code module of the first bootstrap program to the second bootstrap program. In this embodiment, when the second code module of the first bootstrap program is incomplete, the jump is directly from the first code module of the first bootstrap program to the second bootstrap program, so that the whole system is prevented from being brushed up due to the jump to the incomplete second code module, and the probability that the system cannot work due to the fact that the first bootstrap program is brushed up is reduced.
Alternatively, when the second code module of the first bootstrap is complete, then the second bootstrap may be updated by the first bootstrap. Specifically, the first bootstrap program determines whether the second bootstrap program update identifier exists in the public buffer area, and when the second bootstrap update identifier exists in the public buffer area, the second bootstrap program needs to be updated, and on the basis, the second code module of the first bootstrap program guides the second bootstrap program to update, and the first bootstrap program receives a second bootstrap program update file from the public buffer area, wherein the second bootstrap program update file is used for updating the second bootstrap program. Specifically, the second boot program is stored in the second partition, and when the second boot program is updated, the original data stored in the second partition is erased, and a second boot program update file is copied to the second boot partition to update the second boot program. It should be noted that, before erasing the original data stored in the second partition, the original data stored in the second partition may be copied to the common backup cache area so as to backup the original data.
In a specific embodiment, when the second bootstrap program is complete, that is, the second bootstrap program does not need to be updated, the first bootstrap program may be updated by using the second bootstrap program, so whether the first bootstrap update identifier exists may be detected by the second bootstrap, so that the second bootstrap program updates the first bootstrap program based on the first bootstrap program update identifier, so the determining, by the second code module of the first bootstrap program, whether the first bootstrap program needs to be updated may specifically include: the second code module of the first bootstrap program judges whether the second bootstrap program is complete; if the second bootstrap program is complete, the second bootstrap program detects the update identifier of the first bootstrap program to determine whether the first bootstrap program needs to be updated. In the above embodiment, when the first bootstrap program needs to be updated, the second bootstrap program is used to detect whether the update identifier of the first bootstrap program exists, the update identifier of the first bootstrap program is used to determine that the first bootstrap program needs to be updated, the operation of detecting the update identifier of the first bootstrap program is executed by the second bootstrap program, and the first bootstrap program is only responsible for determining the program to be skipped, so that the code amount of the first bootstrap program is reduced, the success rate of the update of the first bootstrap program is improved, and the system is prevented from being inoperable due to failure of the update of the first bootstrap program.
Specifically, after the application program has a command of updating the first bootstrap program, a common random storage area is marked, that is, a first bootstrap program update identifier exists in the common buffer area, when it is determined that the second bootstrap program is complete, the second bootstrap program jumps to the second bootstrap program from the second code module of the first bootstrap program, and the second bootstrap program can determine whether the first bootstrap program update identifier exists through the common buffer area, so that the step of detecting the first bootstrap program update identifier through the second bootstrap program to determine whether the first bootstrap program needs to be updated or not may specifically include: judging whether the first bootstrap program update identification exists in the public buffer area through the second bootstrap program, and determining that the first bootstrap program needs to be updated when the first bootstrap program update identification exists in the public buffer area.
In an alternative embodiment, the request for updating the first bootstrap program is directly sent before the system is powered up, at this time, the first code module of the first bootstrap program is used to determine whether the first bootstrap program needs to be updated, and when the first bootstrap program needs to be updated, the first bootstrap program jumps from the first bootstrap program to the second bootstrap program, and further includes: when the system is powered on and receives the first bootstrap program updating request, the system directly jumps to the second bootstrap program and is controlled to stay in the second bootstrap program so as to update the first bootstrap program by executing software reset or hardware reset.
S202: determining a first bootstrap update file of the first bootstrap in the second bootstrap; the first bootstrap update file is used for updating the first bootstrap.
In this embodiment, the second boot program may boot the first boot program, specifically, determine a first boot program update file of the first boot program in the second boot program, where the first boot program update file may be used to update the first boot program, that is, the first boot program update file is a file used to refresh the first boot program, and update the first boot program by determining a first boot program update file of the first boot program in the second boot program.
In an alternative embodiment, the second bootstrap program may also be used for updating the application program, where the update principle is the same as that of the first bootstrap program, and when the application program receives a request for updating the application program, a common random storage area is marked, that is, an application program update identifier may exist in the common buffer area, and the application program update file is obtained when the application program update identifier of the application program exists in the common buffer area by the second bootstrap program, so that the second bootstrap program updates the application program by using the application program update file.
S203: and executing the updated first bootstrap program to update the second code module of the first bootstrap program by using a first bootstrap program update file of the first bootstrap program.
In this embodiment, program data of a first boot program is stored in a first partition, the first boot program includes a first code module and a second code module, the program data of the first code module is stored in a first sub-partition of the first partition, and the program data of the second code module is stored in a second sub-partition of the first partition. When updating the first bootstrap program, only the second code module of the first bootstrap program is updated, but not the first code module of the first bootstrap program, in this embodiment, the first code module only retains a simple judgment logic code for determining the target program to be skipped, and does not include other complex functions, so the step 203 may specifically include: erasing the original data stored in the second sub-partition of the first partition; the first boot update file of the first boot is copied to the second sub-partition of the first partition to update the second code module of the first boot. In the above embodiment, when the first boot program is updated, only the second code module of the first boot program is updated, instead of updating the entire first boot program, so that the possibility that the first boot program is flushed is reduced, and the first code module of the first boot program is used as a starting area.
In a specific embodiment, only the second code module of the first boot can be swiped while the first boot is swiped. When the first guide is swiped through the second guide, software reset or hardware reset is firstly executed, and after a specific instruction is received, the program is blocked in the second guide code. That is, when the first boot program needs to be updated, after the first code module of the first boot program jumps to the second boot program, the second boot program needs to update the first boot program first, and the application program can be updated after the update of the first boot program is completed, so the first code module of the first boot program is utilized to determine whether the first boot program needs to be updated, and when the first boot program needs to be updated, after the first boot program jumps to the second boot program from the first boot program, the method further comprises: the second bootstrap program is prohibited from updating the application program. In this embodiment, when the first bootstrap program needs to be updated, the second bootstrap program is prohibited from updating the application program, so that the problem that the application program cannot be updated or cannot jump normally due to the fact that the first bootstrap program is not updated is prevented, and user experience is improved.
In the above embodiment, the first code module of the first bootstrap program is used as the boot area, and only the simple code is included, and when the second bootstrap program updates the first bootstrap program, only the second code module of the first bootstrap program is updated, but the boot area is not updated, so that the possibility of failure in updating the first bootstrap program in the updating process is reduced. Therefore, the situation that the first bootstrap program fails to update can be prevented to a certain extent, and the normal operation of the system is ensured.
The embodiments of the present application provide some specific implementations of a method for updating a boot program, and based on this, the present application also provides a corresponding apparatus. The apparatus provided by the embodiment of the present application will be described in terms of functional modularization.
Referring to the schematic structure of the bootstrap updating apparatus 400 shown in fig. 4, the apparatus 400 comprises a first determining module 401, a second determining module 402 and an updating module 403.
A first determining module 401, configured to determine, by using a first code module of a first bootstrap, whether the first bootstrap needs to be updated, and skip from the first bootstrap to the second bootstrap when the first bootstrap needs to be updated;
a second determining module 402, configured to determine a first bootstrap update file of the first bootstrap in the second bootstrap; the first bootstrap update file is used for updating the first bootstrap;
and an updating module 403, configured to execute the updated first bootstrap program, so as to update the second code module of the first bootstrap program by using a first bootstrap program update file of the first bootstrap program.
The first determining module includes:
the first judging unit is used for judging whether the second code module of the first bootstrap program is complete or not by the first code module of the first bootstrap program;
a first jump unit, configured to jump from the first code module of the first bootstrap to the second code module of the first bootstrap if the second code module of the first bootstrap is complete;
and the first determining unit is used for determining whether the first bootstrap program needs to be updated through the second code module of the first bootstrap program, and jumping from the second code module of the first bootstrap program to the second bootstrap program when the first bootstrap program needs to be updated.
The first determination unit includes:
the first judging subunit is used for judging whether the second bootstrap program is complete or not by the second code module of the first bootstrap program;
and the detection unit is used for detecting the first bootstrap program update identification through the second bootstrap program if the second bootstrap program is complete, and determining whether the first bootstrap program needs to be updated or not.
The detection unit includes:
and the first determination subunit is used for judging whether the first bootstrap program update identifier exists in the public buffer area through the second bootstrap program, and determining that the first bootstrap program needs to be updated when the first bootstrap program update identifier exists in the public buffer area.
The first determining module 401 includes:
and the second jump unit is used for determining that the first bootstrap program needs to be updated if the second code module of the first bootstrap program is incomplete and jumping from the first code module of the first bootstrap program to the second bootstrap program.
The device further comprises:
and the prohibition module is used for prohibiting the second bootstrap program from updating the application program.
Program data of the first bootstrap program is stored in a first partition, the first bootstrap program comprises a first code module and a second code module, the program data of the first code module is stored in a first sub-partition of the first partition, and the program data of the second code module is stored in a second sub-partition of the first partition; the updating module comprises:
an erasing unit for erasing original data stored in a second sub-partition of the first partition;
and the copying unit is used for copying the first bootstrap program update file of the first bootstrap program to the second sub-partition of the first partition so as to update the second code module of the first bootstrap program.
The embodiment of the application also provides corresponding equipment and a computer storage medium, which are used for realizing the scheme provided by the embodiment of the application.
The device comprises a memory and a processor, wherein the memory is used for storing instructions or codes, and the processor is used for executing the instructions or codes so as to enable the device to execute the bootstrap updating method according to any embodiment of the application.
The computer storage medium stores code, and when the code is executed, a device executing the code implements the bootstrap updating method according to any embodiment of the present application.
The "first" and "second" in the names of "first", "second" (where present) and the like in the embodiments of the present application are used for name identification only, and do not represent the first and second in sequence.
From the above description of embodiments, it will be apparent to those skilled in the art that all or part of the steps of the above described example methods may be implemented in software plus general hardware platforms. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a storage medium, such as a read-only memory (ROM)/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network communication device such as a router) to perform the method according to the embodiments or some parts of the embodiments of the present application.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present application without undue burden.
The foregoing description of the exemplary embodiments of the application is merely illustrative of the application and is not intended to limit the scope of the application.

Claims (10)

1. A method of bootstrap update, the bootstrap comprising a first bootstrap and a second bootstrap, the method comprising:
determining, with a first code module of a first boot program, whether the first boot program needs to be updated, and jumping from the first boot program to a second boot program when the first boot program needs to be updated;
determining a first bootstrap update file of the first bootstrap in the second bootstrap; the first bootstrap update file is used for updating the first bootstrap;
and executing the updated first bootstrap program to update the second code module of the first bootstrap program by using a first bootstrap program update file of the first bootstrap program.
2. The method of claim 1, wherein the determining, with the first code module of the first boot program, whether the first boot program needs to be updated, and jumping from the first boot program to the second boot program when the first boot program needs to be updated, comprises:
the first code module of the first bootstrap program judges whether the second code module of the first bootstrap program is complete;
if the second code module of the first bootstrap program is complete, jumping from the first code module of the first bootstrap program to the second code module of the first bootstrap program;
determining, by a second code module of a first bootstrap program, whether the first bootstrap program needs to be updated, and jumping from the second code module of the first bootstrap program to a second bootstrap program when the first bootstrap program needs to be updated.
3. The method of claim 2, wherein the determining, by the second code module of the first bootstrap program, whether the first bootstrap program requires updating comprises:
the second code module of the first bootstrap program judges whether the second bootstrap program is complete;
and if the second bootstrap program is complete, detecting a first bootstrap program update identifier through the second bootstrap program to determine whether the first bootstrap program needs to be updated.
4. A method according to claim 3, wherein said detecting, by the second bootstrap program, the first bootstrap program update identification to determine whether the first bootstrap program needs to be updated comprises:
judging whether a first bootstrap program update identifier exists in a public buffer area through a second bootstrap program, and determining that the first bootstrap program needs to be updated when the first bootstrap program update identifier exists in the public buffer area.
5. The method of claim 1, wherein the determining, with the first code module of the first boot program, whether the first boot program needs to be updated, and jumping from the first boot program to the second boot program when the first boot program needs to be updated, comprises:
the first code module of the first bootstrap program judges whether the second code module of the first bootstrap program is complete;
if the second code module of the first bootstrap program is incomplete, determining that the first bootstrap program needs to be updated, and jumping from the first code module of the first bootstrap program to the second bootstrap program.
6. The method of claim 1, wherein the determining, by the first code module of the first boot program, whether the first boot program needs to be updated, and when the first boot program needs to be updated, after jumping from the first boot program to the second boot program, further comprises:
the second bootstrap program is prohibited from updating the application program.
7. The method of claim 1, wherein the program data of the first boot program is stored in a first partition, the first boot program comprising a first code module and a second code module, the program data of the first code module being stored in a first sub-partition of the first partition, the program data of the second code module being stored in a second sub-partition of the first partition; the executing the updated first bootstrap program to update the second code module of the first bootstrap program with a first bootstrap program update file of the first bootstrap program includes:
erasing the original data stored in the second sub-partition of the first partition;
copying a first bootstrap update file of the first bootstrap to a second sub-partition of the first partition to update a second code module of the first bootstrap.
8. A boot program update apparatus, wherein the boot program comprises a first boot program and a second boot program, the apparatus comprising:
a first determining module, configured to determine, using a first code module of a first bootstrap, whether the first bootstrap needs to be updated, and skip from the first bootstrap to a second bootstrap when the first bootstrap needs to be updated;
a second determining module, configured to determine a first bootstrap update file of the first bootstrap in the second bootstrap; the first bootstrap update file is used for updating the first bootstrap;
and the updating module is used for executing the updated first bootstrap program so as to update the second code module of the first bootstrap program by using a first bootstrap program updating file of the first bootstrap program.
9. An electronic device comprising a memory for storing instructions or code and a processor for executing the instructions or code to cause the device to perform the bootstrap updating method of any of claims 1-7.
10. A computer storage medium having code stored therein, which when executed, causes an apparatus executing the code to implement the boot program update method of any of claims 1-7.
CN202310747452.5A 2023-06-21 2023-06-21 Method, device, equipment and storage medium for updating bootstrap program Pending CN116820512A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310747452.5A CN116820512A (en) 2023-06-21 2023-06-21 Method, device, equipment and storage medium for updating bootstrap program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310747452.5A CN116820512A (en) 2023-06-21 2023-06-21 Method, device, equipment and storage medium for updating bootstrap program

Publications (1)

Publication Number Publication Date
CN116820512A true CN116820512A (en) 2023-09-29

Family

ID=88116066

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310747452.5A Pending CN116820512A (en) 2023-06-21 2023-06-21 Method, device, equipment and storage medium for updating bootstrap program

Country Status (1)

Country Link
CN (1) CN116820512A (en)

Similar Documents

Publication Publication Date Title
CN111796848A (en) Bootloader software updating method and device, embedded controller and storage medium
CN107678762B (en) System version upgrading method and device
CN111562934A (en) Software system upgrading method based on hot patch, terminal and storage medium
US20110265072A1 (en) Dynamic Installation of Files for Running Programs
CN101506772B (en) Environment state changes to alter functionality
CN113254048A (en) Method, device and equipment for updating boot program and computer readable medium
CN115113905A (en) Firmware upgrading method and firmware upgrading device
CN105677409A (en) System upgrading method and device
CN113220319A (en) Data updating method and device and vehicle
CN112416411A (en) Upgrading method and device, equipment terminal, server and computer readable medium
CN112667265A (en) Method and device for updating bootstrap program
CN115061713A (en) Method and device for upgrading electronic equipment
CN116795408A (en) ECU software upgrading method and system and vehicle
CN116820512A (en) Method, device, equipment and storage medium for updating bootstrap program
JP2005284902A (en) Terminal device, control method and control program thereof, host device, control method and control program thereof, and method, system, and program for remote updating
CN114706608A (en) Method for upgrading firmware and electronic equipment
CN114546455A (en) MCU software upgrading method and device for double partitions
CN108920210B (en) Method, system and related assembly for loading storage control software
CN114237722A (en) System starting method, device, equipment and engineering vehicle
KR101420026B1 (en) A method, apparatus and computer program for loading files during a boot-up process
CN105278993A (en) Linux system based drive module upgrading method and apparatus
CN115421761A (en) Method, device, system, equipment and medium for upgrading micro-control unit application program
CN113419756A (en) File upgrading method and device and electronic equipment
CN116501373A (en) Software version switching method, device, equipment and storage medium
CN117369847A (en) Method for upgrading firmware, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination