Program update method and apparatus, and vehicle
By dividing the memory into regions and using the first program to guide the second program update, the control anomaly caused by program update failure is resolved, ensuring the stable operation of electronic devices, especially providing basic functional guarantees in vehicles.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2026-03-05
AI Technical Summary
When a program update fails in an electronic device, it can lead to control abnormalities, which are difficult to resolve effectively with existing technologies.
By dividing the memory into multiple regions, a first program guides a second program to update, and switches to the first program to achieve the target function when the update fails. A flag is set to detect the update status, and an error message is displayed through a third program to ensure the normal operation of the electronic device.
When a program update fails, the first program maintains the normal operation of the electronic device, avoids control anomalies, and ensures the stability and safety of the electronic device, especially providing basic guarantees for power management, safety management and vehicle driving functions in vehicle applications.
Smart Images

Figure CN2025076707_05032026_PF_FP_ABST
Abstract
Description
Program update methods, devices and vehicles
[0001] This disclosure claims priority to Chinese invention patent application No. 202411174426.9, filed with the Chinese Patent Office on August 25, 2024, entitled "Program Update Method, Apparatus and Electronic Equipment", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This disclosure relates to, but is not limited to, the field of program update technology, and in particular to a program update method, apparatus, and vehicle. Background Technology
[0003] With the continuous development of computer technology, electronic devices such as vehicles, mobile phones, and computers are being used more and more widely in people's lives. Currently, electronic devices need to be equipped with memory, which stores the programs required to run the electronic device.
[0004] As electronic devices are used, the programs stored in their memory often need to be updated, and sometimes these updates fail. When an update fails, it can lead to malfunctions in the control of the electronic device. Technical solutions
[0005] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.
[0006] This disclosure provides a program update method to avoid abnormal control of electronic devices when program updates fail, thereby at least partially solving the above-mentioned technical problems.
[0007] To achieve the above objectives, according to a first aspect of this disclosure, a program update method is provided, applied to an electronic device, the electronic device including a memory, the memory including a first region and a second region; the first region including a first program, the first program having at least the function of guiding a second program update; the second region including a second program; the method includes:
[0008] Run the first program described above to guide the second program to perform the update;
[0009] If the second program update fails, the first program will be run to enable the electronic device to perform the target function.
[0010] Optionally, if the second program update fails, the first program is run to enable the electronic device to perform the target function, including:
[0011] If the second program update fails, the process will jump to the third program by running the first program.
[0012] The aforementioned third program controls the aforementioned electronic device to achieve the aforementioned target function.
[0013] Optionally, the second region is configured with a first flag bit for indicating the program status, and after the second program update fails, it further includes:
[0014] The first flag bit is updated to indicate that the second procedure update failed.
[0015] Optionally, after jumping to the third program by running the first program described above, the method further includes:
[0016] The third procedure described above generates an error message based on the updated first flag. This error message is used to indicate that the second procedure update failed.
[0017] Optionally, updating the first flag bit as described above includes:
[0018] The first flag bit is updated by running the first program described above.
[0019] Optionally, the second program also has the function of guiding the third program to update and controlling the electronic device to perform the first function; the method further includes:
[0020] Run the second program described above to guide the third program to perform the update;
[0021] If the third program update fails, the system remains in the second area and, based on the second program, controls the electronic device to perform the first function.
[0022] Optionally, the above method further includes:
[0023] In response to a program update instruction for the aforementioned electronic device, a target operating area is determined, wherein the program update instruction includes a second flag bit, the second flag bit being used to indicate the target operating area;
[0024] Run the first program or the second program in the target operating area to update the second program or the third program.
[0025] Optionally, the first region is the BootRom region, the second region is the BootLoader region, and the third program is the application program of the electronic device, which is located in the third region.
[0026] Optionally, the first program further includes controlling the electronic device to achieve the target function. If the second program fails to update, the first program is run to enable the electronic device to achieve the target function, including:
[0027] If the second program update fails, the system remains in the first area and controls the electronic device to achieve the target function based on the program functions of the first program.
[0028] Optionally, the first program includes at least some of the program functions of the second program, and the at least some program functions are used to control the electronic device to achieve the target function.
[0029] Optionally, the aforementioned electronic device is installed in a vehicle, and the aforementioned target function includes at least one of power management function, safety management function, and vehicle driving function.
[0030] According to a second aspect of this disclosure, a program update apparatus is provided, applied to an electronic device, the electronic device including a memory, the memory including a first region and a second region; the first region including a first program, the first program having at least the function of guiding a second program update; the second region including the second program; the apparatus includes:
[0031] The program update device is used to run the first program described above in order to guide the second program to perform the update.
[0032] The program running device is used to run the first program if the second program update fails, so that the electronic device can perform the target function.
[0033] According to a third aspect of this disclosure, an electronic device is provided, including a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute any of the program update methods provided in the embodiments of this disclosure.
[0034] According to a fourth aspect of this disclosure, a vehicle is provided, including the aforementioned program update device or electronic device.
[0035] According to a fifth aspect of this disclosure, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program adapted for loading by a processor to execute any of the program update methods provided in the embodiments of this disclosure.
[0036] According to a sixth aspect of this disclosure, embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements any of the program update methods provided in embodiments of this disclosure.
[0037] In the program update method of this disclosure embodiment, the method is applied to an electronic device, which includes a memory, a first region, and a second region. The first region includes a first program, which at least has the function of guiding a second program update. The second region includes a second program. The first program is run to guide the second program to update. If the second program update fails, it means that the electronic device cannot currently achieve the target function through the second program. In this case, the first program can be used to remedy the situation, that is, by running the first program, the electronic device can achieve the target function. The first program is used to maintain the electronic device's ability to achieve the target function, thereby avoiding abnormal control of the electronic device when the second program update fails.
[0038] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of this disclosure. Those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0040] To gain a more complete understanding of this disclosure and its beneficial effects, the following description will be made in conjunction with the accompanying drawings, wherein the same reference numerals denote the same parts in the following description.
[0041] Figure 1 is a flowchart illustrating a program update method provided in an exemplary embodiment of this disclosure.
[0042] Figure 2 is a schematic flowchart of another program update method provided in an exemplary embodiment of this disclosure;
[0043] Figure 3 is a schematic flowchart of another program update method provided in an exemplary embodiment of this disclosure;
[0044] Figure 4 is a schematic diagram of the structure of the program update device provided in an exemplary embodiment of this disclosure;
[0045] Figure 5 is a structural schematic diagram of the vehicle provided in an embodiment of this disclosure.
[0046] Implementation of this disclosure
[0047] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0048] This disclosure provides a program update method, apparatus, and electronic device, which can be installed in a vehicle.
[0049] Furthermore, in the embodiments of this disclosure, "multiple" refers to two or more. The terms "first" and "second," etc., in the embodiments of this disclosure are used for distinguishing descriptions and should not be construed as implying relative importance.
[0050] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.
[0051] Please refer to Figure 1, which is a flowchart illustrating a program update method according to an embodiment of this disclosure. The program update method is applied to an electronic device, which includes a memory comprising a first region and a second region; the first region includes a first program, which at least has the function of guiding a second program update; the second region includes the second program; the program update method may include:
[0052] S101. Run the first program described above to guide the second program to perform the update;
[0053] S102. If the second program update fails, the first program is run to enable the electronic device to perform the target function.
[0054] Understandably, in order to improve space utilization, data management efficiency, and system stability, the memory in the aforementioned electronic devices can be divided into at least two regions to store different types of programs and / or data in different regions.
[0055] For example, if the memory is a Flash memory, the Flash memory can be divided into a Boot area and an App area. The Boot area is used to store the boot program, while the App area is used to store the application program to enable the electronic device to perform various functions. The application program is the program required for the electronic device to perform a specific function, and at least one specific function constitutes the aforementioned target function.
[0056] Alternatively, the Boot area can be further divided into two levels: the smallest working unit, the BootRom area, and the smaller working unit, the Bootloader area. The BootRom area and the Bootloader area work together during the boot process to ensure the correct loading and operation of the operating system. For example, the program in the BootRom area is the first-level loaded software and can be used to boot the Bootloader area, such as to update the program in the Bootloader area, to implement the jump from the APP area to the Bootloader area, and to perform the validity check of the program in different areas (for example, to check the flag indicating whether the program update in different areas is successful). The Bootloader area, as a secondary Boot, can be used to boot the App area, such as to update the program in the App area.
[0057] Alternatively, instead of dividing the App area, the applications that need to be stored in the undivided App area can be stored in the Bootloader area. This allows the original boot program in the Bootloader area to boot the applications in the Bootloader area. The specific division of areas and the storage of different types of programs or data in the divided areas can be determined according to the requirements, and there are no restrictions here.
[0058] In this embodiment, since the first program in the first region can be used to guide the second program in the second region to update, the first region can be a Boot region, the first program being the bootloader of the Boot region, and the second region can be an App region, the second program being the application of the App region; or, the first region can be a BootROM region, the first program being the bootloader of the BootROM region, and the second region can be a Bootloader region, the second program being the bootloader of the Bootloader region; or, the first region can be a Bootloader region, the first program being the bootloader of the Bootloader region, and the second region can be an App region, the second program being the application of the App region; or, the first region can be a portion of the Bootloader region where the bootloader is stored, the first program being the bootloader of the Bootloader region, and the second region can be a portion of the Bootloader region where the application is stored, the first program being the application of the Bootloader region, etc. The specific configuration can be determined according to requirements and is not limited here.
[0059] Because a program update failure can lead to abnormal control of electronic devices—that is, a program update failure in a certain area of the memory can render that area unusable or affect the use of programs in other areas, thus causing the electronic device to malfunction—this embodiment can run a first program to guide a second program to update. The update status of the second program is then checked to determine if it has failed. If the second program fails, it means that the electronic device cannot currently achieve its target function using the second program. The first program can then be used to remedy this, enabling the electronic device to achieve its target function. The first program maintains the electronic device's ability to perform its target function, thus preventing abnormal control of the electronic device when the second program update fails.
[0060] It should be noted that electronic devices may also include a controller, which is used to coordinate and control the various functions of the electronic device. The memory plays an important role in the controller. For example, the aforementioned memory may be a Flash memory, which can be used to support the storage of different programs that coordinate and control the various functions of the electronic device. If the program update of a certain area in the memory fails, it will cause the controller to become unusable.
[0061] Specifically, the way the first program guides the second program to update can be by erasing the old version of the second program in the second area and then writing the new version of the second program in the second area, or by directly overwriting the old version of the second program with the new version of the second program. The specific method can be set according to the requirements and is not limited here.
[0062] In some embodiments, before running the first program to enable the electronic device to perform the target function if the second program update fails, it is also necessary to determine whether the second program update has failed, and to determine whether the second program update has failed based on the update status during the second program update process, so that appropriate processing can be carried out in a timely manner based on the update status of the second program.
[0063] Specifically, the update duration of the second program can be obtained. If the update duration of the second program exceeds a preset duration threshold, the update of the second program is determined to have failed. And / or the update result of the second program can be obtained. If the update result of the second program does not meet the preset update completion condition, the update of the second program is determined to have failed. The update completion condition can be the target content after the second program is updated. If the update result of the second program does not match the target content, the update result of the second program is determined to have failed to meet the preset update completion condition.
[0064] In some embodiments, since the target function of the above-mentioned electronic device needs to be implemented through a specific application, in this embodiment, the application that controls the electronic device to implement the target function can be set as a third program. That is, when the second area is the Bootloader area, the third program can be located in the Bootloader area or the App area. The second program in the Bootloader area is used to guide the third program to start, that is, the third program can be jumped to through the second program to start the third program.
[0065] It is understandable that when the second program update fails, the third program may fail to start. Therefore, in this embodiment, the first program is needed to restart the third program to ensure that the third program can run normally and control the electronic device to achieve the target function. As shown in Figure 2, if the second program update fails, the first program is run to enable the electronic device to achieve the target function, including:
[0066] S201. If the second program update fails, the third program will be executed.
[0067] S202. Based on the above-mentioned third program, control the above-mentioned electronic device to achieve the above-mentioned target function.
[0068] In this embodiment, by configuring the function of jumping to the third program in the first program, when the second program fails to update, the first program can be used to re-implement the jump to the third program to start the third program to control the electronic device to achieve the target function. This avoids the situation where the third program cannot be started due to the second program being unusable, which would cause abnormal control of the electronic device.
[0069] In some embodiments, in order to facilitate the determination of the program status of the updated second region during program updates, i.e. whether the program in the updated second region has been successfully updated, the second region is configured with a first flag bit for indicating the program status, so as to determine whether the corresponding second region has been successfully updated through the first flag bit. For example, if the second region is a Bootloader region, the first flag bit needs to be set for the Bootloader region, and if the second region is an App region, the first flag bit needs to be set for the App region.
[0070] Specifically, after the second program update fails, the method may further include: updating the first flag bit to indicate that the second program update has failed, that is, the updated first flag bit is used to indicate that the program update in the second area has failed.
[0071] In this embodiment, when the second program fails to update, the first flag bit of the second region to which the second program belongs is updated, so that other threads can clearly see that there is an anomaly in the second region when running the program, and the second program in the second region cannot be used normally. Alternatively, it can help relevant staff to locate the second region where the program update is abnormal based on the first flag bit, so as to process the abnormal program in the second region and improve the speed at which relevant staff find the abnormal program.
[0072] In some embodiments, in order to enable relevant personnel to quickly identify the program with an update error, it is necessary to prompt the relevant personnel to indicate that the program with an update error exists. That is, after running the first program to jump to the third program, it may also include: using the third program to display an error message based on the updated first flag bit. The error message is used to indicate that the update of the second program has failed.
[0073] In this embodiment, the third program can check the validity of the second program in the second area. That is, after the first program starts the third program, the third program queries the first flag bit of the second area to which the second program belongs to determine whether there is an update anomaly in the second area, that is, whether the second program has failed to update. When it is determined that there is an update anomaly in the second area, that is, the second program has failed to update, an error message can be displayed to inform the relevant personnel that the second program update has failed. This enables the relevant personnel to discover and take appropriate remedial measures in a timely manner, thereby improving the security of electronic devices.
[0074] In some embodiments, updating the first flag bit may include updating the first flag bit by running the first program.
[0075] In this embodiment, since the first program is needed to guide the second program to update, the first program can determine in real time whether the second program has failed to update. Therefore, by updating the first flag bit of the second region through the first program, the first flag bit of the second region can indicate the current program status of the second region in real time and accurately.
[0076] In some embodiments, the second program further includes the function of guiding the third program to update and controlling the electronic device to perform the first function. The method may further include: running the second program to guide the third program to update; if the third program update fails, remaining in the second area and controlling the electronic device to perform the first function based on the second program. The first function may be the same as or different from the target function, and can be set according to requirements, without limitation here.
[0077] In this embodiment, since the second program in the second area can be used to guide the third program to update, the third program can be updated by running the second program, and then the update status of the third program can be detected to determine whether the third program has failed to update. If the third program fails to update, it means that the electronic device cannot currently perform the first function through the third program. The second program can be used to remedy this, that is, by running the second program, the electronic device can perform the first function. The second program can maintain the electronic device's ability to perform the first function, thereby avoiding abnormal control of the electronic device when the third program fails to update.
[0078] In some embodiments, the method may further include: first, determining a target operating area in response to a program update instruction for the electronic device, wherein the program update instruction includes a second flag bit used to indicate the target operating area; and then updating the second program or the third program by running the first program or the second program in the target operating area.
[0079] In this embodiment, the target operating area is determined by the second flag bit in the program update instruction. Since different target operating areas correspond to different security access levels, this means that the second flag bit defines the security access level of different areas when performing program updates, so as to ensure the security of program updates.
[0080] Different second flag bits are used to indicate different regions, such as one second flag bit used to indicate the BootRom region and another second flag bit used to indicate the Bootloader region.
[0081] Understandably, during program flashing, a specific programming session instruction, namely the aforementioned program update instruction, is entered to enable the program to jump from the APP area to the Boot area. Since there are two levels of Boot, such as the BootROM area and the Bootloader area, the jump needs to be differentiated. Specifically, during secure access, different security levels can be set, with different security access levels corresponding to different second flag bits to indicate different Boot areas. Therefore, different second flag bits can be written into a fixed area of the FLASH memory according to the security access level. Thus, when entering the programming session instruction for a restart jump, the program enters either the BootROM area or the Bootloader area based on the difference in the second flag bits in the instruction.
[0082] In some embodiments, the first region is the BootRom region, the second region is the BootLoader region, and the third program is the application program of the electronic device. The third program is located in the third region, which can be the App region. This can prevent the electronic device from malfunctioning due to the third program being unusable in specific scenarios.
[0083] In some embodiments, since the target function of the above-mentioned electronic device needs to be implemented through a specific application, in this embodiment, the application that controls the electronic device to implement the target function can be set as a second program. At this time, the first program not only has the function of guiding the second program to update, but also has the function of starting the second program.
[0084] It is understandable that when the second program update fails, the electronic device cannot be controlled to achieve the target function because the second program cannot be used. Therefore, in this embodiment, the first program is needed to control the electronic device to achieve the target function. That is, the first program also has the function of controlling the electronic device to achieve the target function, as shown in Figure 3. The first program also has the function of controlling the electronic device to achieve the target function. If the second program update fails, the first program is run to enable the electronic device to achieve the target function, including:
[0085] S301. If the second program update fails, the system remains in the first area and controls the electronic device to achieve the target function based on the program functions of the first program.
[0086] In this embodiment, by configuring a program in the first program to replace the second program in controlling the electronic device to achieve the target function, the first program can be used to replace the second program in the event that the second program fails to update, and the electronic device can be controlled to achieve the target function again, thus avoiding the situation where the electronic device control is abnormal due to the second program being unusable.
[0087] In some embodiments, the first program includes at least a portion of the program functions of the second program. The at least a portion of the program functions are used to control the electronic device to achieve the target function. Thus, the first program can be used to remedy the partial program functions when the second program fails to update, so as to avoid the situation where the electronic device control is abnormal due to the second program being unable to be used normally. Furthermore, by maintaining only a portion of the program functions, the pressure on storage space caused by the program functions added in the first program to achieve the normal operation of the electronic device is also alleviated.
[0088] In some embodiments, at least some of the above-mentioned program functions may be basic function programs to achieve the target function of the electronic device. The target function is the basic function corresponding to the basic function program. For example, if the electronic device is installed in a vehicle, the target function includes at least one of power management function, safety management function, and vehicle driving function.
[0089] The aforementioned power management function ensures that the vehicle can normally hibernate / wake up, preventing the vehicle from entering an ultra-low power state; the aforementioned safety management function must support the activation of hard-wired signals to alert the upper-level controller program to a loss, thereby ensuring that the vehicle can promptly and effectively remind the driver, such as regarding airbags; the aforementioned vehicle drive function must support the drive function to maintain minimum control requirements, such as controlling the water pump / fan, to ensure that the vehicle can maintain low-speed operation, allowing the driver to park the vehicle in a safe location.
[0090] In this embodiment, when the electronic device is a vehicle, the first program has at least the basic functional programs in the second program. When the second program fails to update and cannot be used, the vehicle can be guaranteed to be in a safe and reliable state, thereby reducing the dependence on program backup and effectively reducing costs.
[0091] To facilitate better implementation of the program update method provided in this disclosure, this disclosure also provides an apparatus based on the above-described program update method. The meanings of the terms used are the same as in the program update method described above, and specific implementation details can be found in the descriptions within the method embodiments.
[0092] For example, as shown in Figure 4, the program update device is applied to an electronic device, which includes a memory comprising a first region and a second region; the first region includes a first program, which at least has the function of guiding a second program update; the second region includes a second program, and the program update device may include:
[0093] The program update device 401 is used to run the first program to guide the second program to perform the update.
[0094] The program running device 402 is used to run the first program if the second program update fails, so that the electronic device can achieve the target function.
[0095] In some embodiments, the program running device 402 is specifically used for:
[0096] If the second program update fails, the process will jump to the third program by running the first program.
[0097] The aforementioned third program controls the aforementioned electronic device to achieve the aforementioned target function.
[0098] In some embodiments, the second region is configured with a first flag bit for indicating program status, and the program update device further includes a flag bit updating device, which is specifically used for:
[0099] The first flag bit is updated to indicate that the second procedure update failed.
[0100] In some embodiments, the above-described program update apparatus further includes a prompting device, which is specifically used for:
[0101] The third procedure described above generates an error message based on the updated first flag. This error message is used to indicate that the second procedure update failed.
[0102] In some embodiments, the above-mentioned flag update device is specifically used for:
[0103] The first flag bit is updated by running the first program described above.
[0104] In some embodiments, the second program further has the function of guiding the third program to update and controlling the electronic device to perform the first function. The program update device further includes a control device, which is specifically used for:
[0105] Run the second program described above to guide the third program to perform the update;
[0106] If the third program update fails, the system remains in the second area and, based on the second program, controls the electronic device to perform the first function.
[0107] In some embodiments, the above method and the above program update apparatus further include an instruction response device, the instruction response device being specifically used for:
[0108] In response to a program update instruction for the aforementioned electronic device, a target operating area is determined, wherein the program update instruction includes a second flag bit, the second flag bit being used to indicate the target operating area;
[0109] Run the first program or the second program in the target operating area to update the second program or the third program.
[0110] In some embodiments, the first region is the BootRom region, the second region is the BootLoader region, and the third program is the application program of the electronic device, and the third program is located in the third region.
[0111] In some embodiments, the first program further comprises controlling the electronic device to achieve the target function, and the program running device 402 is specifically used for:
[0112] If the second program update fails, the system remains in the first area and controls the electronic device to achieve the target function based on the program functions of the first program.
[0113] In some embodiments, the first program includes at least a portion of the program functions of the second program, and the at least a portion of the program functions are used to control the electronic device to achieve the target function.
[0114] In some embodiments, the electronic device is disposed in a vehicle, and the target function includes at least one of power management function, safety management function, and vehicle driving function.
[0115] The program update apparatus disclosed herein is applied to an electronic device, which includes a memory comprising a first region and a second region. The first region includes a first program, which at least has the function of guiding a second program update. The second region includes a second program. The first program is run to guide the second program to update. If the second program update fails, it indicates that the electronic device cannot currently achieve the target function through the second program. In this case, the first program can be used to remedy the situation, i.e., by running the first program, the electronic device can achieve the target function. The first program maintains the electronic device's ability to achieve the target function, thereby avoiding abnormal control of the electronic device when the second program update fails.
[0116] In practice, each of the above devices can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation methods and corresponding beneficial effects of each of the above devices, please refer to the previous method embodiments, which will not be repeated here.
[0117] This disclosure also provides an electronic device, as shown in FIG5, which illustrates a structural schematic diagram of the electronic device involved in this disclosure embodiment. Specifically:
[0118] The electronic device may include components such as a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a power supply 503, and an input unit 504. Those skilled in the art will understand that the electronic device structure shown in FIG. 5 does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0119] The processor 501 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes computer programs and / or modules stored in the memory 502, and calls data stored in the memory 502, to perform various functions and process data. Optionally, the processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 501.
[0120] The memory 502 can be used to store computer programs and modules. The processor 501 executes various functional applications and data processing by running the computer programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, computer programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
[0121] The electronic device also includes a power supply 503 that supplies power to various components. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 503 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0122] The electronic device may also include an input unit 504, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0123] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 501 in the electronic device loads the executable files corresponding to the processes of one or more computer programs into the memory 502 according to the following instructions, and the processor 501 runs the computer programs stored in the memory 502 to realize various functions, such as:
[0124] Run the first program described above to guide the second program to perform the update;
[0125] If the second program update fails, the first program will be run to enable the electronic device to perform the target function.
[0126] For details on the specific implementation methods and corresponding beneficial effects of the above operations, please refer to the detailed description of the program update method above, which will not be repeated here.
[0127] This disclosure also provides a vehicle including the above-mentioned program update device or electronic device. In addition, the vehicle may also include a motor, a display device, etc., which can be set according to needs and are not limited here.
[0128] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0129] Therefore, embodiments of this disclosure provide a computer-readable storage medium storing a computer program that can be loaded by a processor to perform steps in any of the program update methods provided in embodiments of this disclosure. For example, the computer program can perform the following steps:
[0130] Run the first program described above to guide the second program to perform the update;
[0131] If the second program update fails, the first program will be run to enable the electronic device to perform the target function.
[0132] For details on the specific implementation methods and corresponding beneficial effects of the above operations, please refer to the previous embodiments, which will not be repeated here.
[0133] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0134] Since the computer program stored in the computer-readable storage medium can execute the steps in any of the program update methods provided in the embodiments of this disclosure, the beneficial effects that any of the program update methods provided in the embodiments of this disclosure can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0135] According to one aspect of this disclosure, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the program update method described above.
[0136] The above provides a detailed description of a program update method, apparatus, and electronic device provided by the embodiments of this disclosure. Specific examples have been used to illustrate the principles and implementation methods of this disclosure. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this disclosure. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of this disclosure. Therefore, the content of this specification should not be construed as a limitation of this disclosure.
Claims
1. A program update method, wherein, The invention is applied to an electronic device, which includes a memory comprising a first region and a second region; the first region includes a first program, which at least has the function of guiding the second program to update. The second area includes the second program; the method includes: Run the first program to guide the second program to update; If the second program update fails, the first program is run to enable the electronic device to perform the target function.
2. The program update method according to claim 1, wherein, If the second program update fails, the first program is run to enable the electronic device to perform the target function, including: If the second program fails to update, the first program will be run to jump to the third program. The electronic device is controlled by the third program to achieve the target function.
3. The program update method according to claim 2, wherein, The second area is configured with a first flag bit for indicating the program status, and further includes: [Further details needed - likely related to program update failure]. The first flag is updated to indicate that the second program update failed.
4. The program update method according to claim 3, wherein, After jumping to the third program by running the first program, the program also includes: The third program generates an error message based on the updated first flag, which indicates that the second program failed to update.
5. The program update method according to any one of claims 3 to 4, wherein, The step of updating the first flag bit includes: The first flag is updated by running the first program.
6. The program update method according to any one of claims 2 to 5, wherein, The second program also has the function of guiding the third program to update and the function of controlling the electronic device to perform the first function, and the method further includes: Run the second program to guide the third program to perform an update; If the third program update fails, the system remains in the second area and, based on the second program, controls the electronic device to perform the first function.
7. The program update method according to claim 6, wherein, The method further includes: In response to a program update instruction for the electronic device, a target operating area is determined, wherein the program update instruction includes a second flag bit, the second flag bit being used to indicate the target operating area; Run the first program or the second program in the target running area to update the second program or the third program.
8. The program update method according to any one of claims 2 to 7, wherein, The first region is the BootRom region, the second region is the BootLoader region, and the third program is the application program of the electronic device, which is located in the third region.
9. The program update method according to claim 1, wherein, The first program also has the function of controlling the electronic device to achieve the target function, wherein if the second program fails to update, the first program is run to enable the electronic device to achieve the target function, including: If the second program update fails, it remains in the first area and controls the electronic device to achieve the target function based on the program functions of the first program.
10. The program update method according to claim 9, wherein, The first program includes at least some of the program functions of the second program, and the at least some program functions are used to control the electronic device to achieve the target function.
11. The program update method according to any one of claims 9 to 10, wherein, The electronic device is installed in the vehicle, and the target function includes at least one of power management function, safety management function, and vehicle driving function.
12. A program update apparatus, wherein, The invention is applied to an electronic device, which includes a memory comprising a first region and a second region; the first region includes a first program, which at least has the function of guiding the second program to update. The second area includes the second program; the device includes: A program update device is used to run the first program to guide the second program to perform an update; The program execution device is used to run the first program if the second program update fails, so that the electronic device can perform the target function.
13. The program update apparatus according to claim 12, wherein, The program update apparatus is applied to an electronic device, the electronic device including a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps of the program update method as described in any one of claims 1 to 11.
14. A vehicle, wherein, Includes the program update apparatus as described in claim 12.
Citation Information
Patent Citations
Program upgrading method and device, electronic equipment and storage medium
CN114035828A
Program upgrading method and device, computer equipment, storage medium and program product
CN116909607A
Control device for a vehicle and method for a data update for a control device for a vehicle
US20110208956A1
Vehicle controller, updated program, program updating system, and writing device
US20220276851A1