Program updating method and device and electronic equipment

By setting the first area and the second area in the memory of the electronic device, guiding the second program update with the first program, and running the first program when the update fails to ensure the normal operation of the device, the control abnormality caused by the failure of the program update is solved.

CN119781788APending Publication Date: 2025-04-08BYD CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411174426.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-25
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In electronic devices, when the program update fails, it may cause control abnormalities, affecting the normal operation of the device.

Method used

By setting the first area and the second area in the memory, the first program in the first area has the function of guiding the second program to update. If the second program update fails, run the first program to ensure that the electronic device can achieve the target function and avoid control abnormalities.

Benefits of technology

It effectively avoids control abnormalities when program update fails, ensures that electronic devices can still operate normally after update failure, and maintains the implementation of target functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781788A_ABST
    Figure CN119781788A_ABST
Patent Text Reader

Abstract

The invention relates to a program updating method and device and electronic equipment, the program updating method and device are applied to the electronic equipment, the electronic equipment comprises a memory, and the memory comprises a first area and a second area; the first area comprises a first program, and the first program at least has a function of guiding a second program to update; the second area comprises a second program, and running the first program to guide the second program to update; if the second program fails to be updated, the first program is operated, so that the electronic equipment achieves the target function, and the situation that abnormal control over the electronic equipment possibly occurs when the program fails to be updated is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of program updating, and in particular to a program updating method, device and electronic device. Background Art

[0002] With the continuous development of computer technology, electronic devices such as vehicles, mobile phones, and computers are more and more widely used in people's lives. At present, electronic devices need to be provided with a memory, and the memory stores the programs required to run the electronic devices.

[0003] With the use of electronic devices, it is often necessary to update the programs stored in the memory, and sometimes the program update fails. When the program update fails, the control of the electronic device may be abnormal. Summary of the invention

[0004] An embodiment of the present application provides a program update method to avoid abnormal control of an electronic device that may occur when a program update fails, so as to at least partially solve the above technical problems.

[0005] In order to achieve the above object, according to a first aspect of the present application, a program updating method is provided, which is applied to an electronic device, wherein the electronic device includes a memory, the memory includes a first area and a second area; the first area includes a first program, and the first program at least has a function of guiding the update of the second program; the second area includes a second program; the method includes:

[0006] Running the first program to guide the second program to be updated;

[0007] If the second program fails to be updated, the first program is run to enable the electronic device to achieve the target function.

[0008] Optionally, if the second program fails to be updated, running the first program to enable the electronic device to achieve a target function includes:

[0009] If the second program fails to update, jump to the third program by running the first program;

[0010] Based on the third program, the electronic device is controlled to achieve the target function.

[0011] Optionally, the second area is configured with a first flag bit for indicating a program status, and after the second program fails to be updated, the method further includes:

[0012] The first flag is updated to indicate that the second program update fails.

[0013] Optionally, after jumping to the third program by running the first program, the method further includes:

[0014] Through the third program, an error message is given based on the updated first flag, and the error message is used to indicate that the update of the second program has failed.

[0015] Optionally, the updating of the first flag bit includes:

[0016] By running the first program, the first flag is updated.

[0017] Optionally, the second program further has the function of guiding the third program to update and controlling the electronic device to implement the first function, and the method further includes:

[0018] Running the second program to guide the third program to be updated;

[0019] If the third program fails to be updated, the device stays in the second area and controls the electronic device to implement the first function based on the second program.

[0020] Optionally, the above method further includes:

[0021] In response to a program update instruction for the electronic device, determining a target operating area, wherein the program update instruction includes a second flag bit, and the second flag bit is used to indicate the target operating area;

[0022] The first program or the second program in the target running area is run to update the second program or the third program.

[0023] Optionally, the first area is a BootRom area, the second area is a BootLoader area, the third program is an application program of the electronic device, and the third program is located in the third area.

[0024] Optionally, the first program further controls the electronic device to achieve a target function, and if the second program fails to be updated, the first program is run to enable the electronic device to achieve the target function, including:

[0025] If the second program fails to be updated, the device stays in the first area and controls the electronic device to achieve the target function based on the program function of the first program.

[0026] Optionally, the first program includes at least part of the program functions of the second program, and the at least part of the program functions are used to control the electronic device to achieve the target function.

[0027] Optionally, the electronic device is arranged in a vehicle, and the target function includes at least one of a power management function, a safety management function, and a vehicle driving function.

[0028] According to a second aspect of the present application, a program updating device is provided, which is applied to an electronic device, wherein the electronic device includes a memory, the memory includes a first area and a second area; the first area includes a first program, and the first program at least has a function of guiding the update of the second program; the second area includes the second program; the device includes:

[0029] A program update module, used for running the first program to guide the second program to be updated;

[0030] The program running module is used to run the first program if the second program fails to be updated, so as to enable the electronic device to achieve the target function.

[0031] According to a third aspect of the present application, an electronic device is provided, comprising a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute any one of the program updating methods provided in the embodiments of the present application.

[0032] According to a fourth aspect of the present application, a vehicle is provided, comprising the above-mentioned program updating device or electronic device.

[0033] According to a fifth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is suitable for loading by a processor to execute any program updating method provided in the embodiments of the present application.

[0034] According to the sixth aspect of the present application, an embodiment of the present application also provides a computer program product, including a computer program, and when the above computer program is executed by a processor, it implements any program updating method provided in the embodiment of the present application.

[0035] In the program updating method of the embodiment of the present application, by being applied to an electronic device, the electronic device includes a memory, the memory includes a first area and a second area; the first area includes a first program, the first program at least has the function of guiding the update of the second program; the second area includes a second program; and the first program is run to guide the second program to be updated; if the update of the second program fails, it means that the electronic device cannot currently achieve the target function through the second program, and the first program can be used for remediation, that is, by running the first program to enable the electronic device to achieve the target function, and by using the first program to maintain the electronic device still able to achieve the target function, to avoid abnormal control of the electronic device when the second program update fails.

[0036] Other features and advantages of the present application will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.

[0038] In order to more completely understand the present application and its beneficial effects, the following description will be given in conjunction with the accompanying drawings, wherein the same figure numbers represent the same parts in the following description.

[0039] Figure 1 is a flowchart of a program updating method provided in an exemplary embodiment of the present disclosure;

[0040] Figure 2 is another flowchart of a program updating method provided in an exemplary embodiment of the present disclosure;

[0041] Figure 3 is another flowchart of a program updating method provided in an exemplary embodiment of the present disclosure;

[0042] Figure 4 is a schematic diagram of the structure of a program updating device provided in an exemplary embodiment of the present disclosure;

[0043] Figure 5 It is a schematic diagram of the structure of a vehicle provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0045] Embodiments of the present application provide a program updating method, device, and electronic device. The electronic device or the program updating device may be disposed in a vehicle.

[0046] In addition, the term "plurality" in the embodiments of the present application refers to two or more than two. The terms "first" and "second" in the embodiments of the present application are used to distinguish descriptions and should not be understood as implying relative importance.

[0047] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0048] See also Figure 1 , Figure 1 1 is a flowchart of a program update method provided by an embodiment of the present application. The program update method is applied to an electronic device, the electronic device includes a memory, the memory includes a first area and a second area; the first area includes a first program, the first program at least has the function of guiding the update of the second program; the second area includes the second program; the program update method may include:

[0049] S101, running the first program to guide the second program to be updated;

[0050] S102: If the second program fails to be updated, run the first program to enable the electronic device to achieve a target function.

[0051] It is understandable that in order to improve space utilization, data management efficiency, system stability, etc., the memory in the above electronic device can be divided into at least two areas to store different types of programs and / or data in different areas.

[0052] 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 a boot program, and the APP area is used to store an application program to enable the electronic device to implement various functions. The application program is a program required for the electronic device to implement a specific function, and at least one specific function constitutes the above-mentioned target function.

[0053] Alternatively, the Boot area can be further split into two levels, that is, the Boot area can be split into a BootRom area with the smallest working unit and a Bootloader area with a smaller working unit. 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, if the program in the BootRom area is the first-level loading software, it can be used to boot the Bootloader area, such as booting the program in the Bootloader area to update, realize the jump from the APP area to the Bootloader area, and perform valid flag checks on programs in different areas (for example, check the flag indicating whether the program update in different areas is successful), etc., and the Bootloader area, as a secondary Boot, can be used to boot the App area, such as booting the program in the App area to update.

[0054] Alternatively, the App area may not be divided, and the application programs to be stored in the undivided App area may be stored in the Bootloader area, so that the original booting program in the Bootloader area can be used to boot the application programs in the Bootloader area, etc. The specific area division can be carried out according to needs, and different types of programs or data can be stored in the divided areas, which are not limited here.

[0055] In this regard, in the present embodiment, since the first program in the first area can be used to guide the second program in the second area to update, the first area can be a Boot area, the first program is a boot program in the Boot area, the second area can be an App area, and the second program is an application in the App area; or, the first area can be a BootRom area, the first program is a boot program in the BootRom area, the second area can be a Bootloader area, and the second program is a boot program in the Bootloader area; or, the first area can be a Bootloader area, the first program is a boot program in the Bootloader area, the second area can be an App area, and the second program is an application in the App area; or, the first area can be a partial area in the Bootloader area for storing the boot program, the first program is the boot program in the Bootloader area, the second area can be a partial area in the Bootloader area for storing the application program, the first program is an application in the Bootloader area, etc., which can be set specifically according to the needs and are not limited here.

[0056] Since, currently, when a program update fails, abnormal control of the electronic device may occur, that is, due to the failure of program update in a certain area in the memory, the program in the area cannot be used, or affects the use of programs in other areas, so that the electronic device cannot be controlled normally. Therefore, in this embodiment, the first program can be run to guide the second program to be updated, and then the update status of the second program is detected to clarify whether the second program fails to update. If the second program update fails, it means that the electronic device cannot be prompted to achieve the target function through the second program at present, and the first program can be used to remedy the situation, that is, by running the above-mentioned first program to enable the above-mentioned electronic device to achieve the target function, and the first program is used to maintain the electronic device to still achieve the target function, so as to avoid the abnormal control of the electronic device when the second program fails to update.

[0057] It should be noted that a controller may also be provided in the electronic device, and the controller is used to coordinate and control the various functions of the electronic device, and the memory plays an important role in the controller. For example, the above-mentioned memory may be a Flash memory, and the Flash memory may be used to support the storage of different programs for coordinating and controlling the various functions of the electronic device. If the program update in a certain area in the memory fails, the controller will become bricked.

[0058] Specifically, the method for guiding the update of the second program by the above-mentioned first program can be to erase the old version of the second program in the second area by the first program, and then write the new version of the second program in the second area by the first program; or, directly overwrite the old version of the second program with the new version of the second program by the first program, etc. The specific setting can be made according to needs and is not limited here.

[0059] In some embodiments, if the second program fails to be updated, before running the first program to enable the electronic device to achieve the target function, it is necessary to determine whether the second program has failed to be updated, and determine whether the second program has failed to be updated based on the update status during the update process of the second program, so that corresponding processing can be made in time according to the update status of the second program.

[0060] Specifically, the update duration of the second program can be obtained. If the update duration of the second program is greater than a preset duration threshold, it is determined that the update of the second program has 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, it is determined that the update of the second program has failed, wherein the update completion condition may be the target content after the second program is updated. If the update result of the second program does not meet the target content, it is determined that the update result of the second program does not meet the preset update completion condition.

[0061] 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, at this time, the third program can be located in the Bootloader area or in the App area, and the second program in the Bootloader area is used to boot the third program to start, that is, the second program can jump to the third program to start the third program.

[0062] It is understandable that when the second program fails to update, the third program cannot be started. 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. Figure 2As shown, if the second program fails to be updated, the first program is run to enable the electronic device to achieve the target function, including:

[0063] S201, if the second program fails to be updated, jump to the third program by running the first program;

[0064] S202: Control the electronic device to achieve the target function based on the third program.

[0065] In this embodiment, by configuring a program in the first program to jump to the third program, when the second program fails to be updated, 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, thereby avoiding the situation where the third program cannot be started due to the second program that starts the third program not being able to be used normally, resulting in abnormal control of the electronic device.

[0066] In some embodiments, in order to facilitate the clarification of the program status of the updated second area when the program is updated, that is, whether the program in the updated second area is updated successfully, the above-mentioned second area is configured with a first flag bit for indicating the program status, so that through the first flag bit, it is determined whether the corresponding second area has successfully updated the program. For example, when the second area is a Bootloader area, the first flag bit needs to be set for the Bootloader area. For example, when the second area is an App area, the first flag bit needs to be set for the App area.

[0067] Specifically, after the second program update fails, the method may further include: updating the first flag to indicate that the second program update fails, that is, the updated first flag is used to indicate that the program update in the second area fails.

[0068] In this embodiment, when the second program update fails, the first flag bit of the second area to which the second program belongs is updated, so that other threads can clearly know that there is an abnormality in the second area when running the program, and the second program in the second area cannot be used normally, or, it is convenient for relevant staff to locate the second area where the program update has an abnormality based on the first flag bit, so as to process the program with the update abnormality in the second area, thereby improving the speed at which relevant staff can find the program with the update abnormality.

[0069] In some embodiments, in order to enable relevant staff to quickly identify the program that currently has an update abnormality, it is necessary to prompt the relevant staff to remind them that there is a program that currently has an update abnormality, that is, after running the above-mentioned first program to jump to the third program, it can also include: through the above-mentioned third program, an error prompt is given based on the first flag bit after the update, and the above-mentioned error prompt is used to prompt that the update of the above-mentioned second program has failed.

[0070] In this embodiment, the validity of the second program in the second area can be checked through the third program, 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 a program with an update abnormality in the second area, that is, determine whether the second program has failed to update. When it is determined that there is a program with an update abnormality in the second area, that is, the update of the second program has failed, an error message can be given to prompt relevant staff members of the update failure of the second program, thereby enabling relevant staff members to discover the failure in time and take corresponding remedial measures, thereby improving the safety of electronic equipment.

[0071] In some embodiments, updating the first flag may include: updating the first flag by running the first program.

[0072] In this embodiment, since the second program needs to be updated through the first program, the first program can determine whether the second program fails to update in a relatively real time manner. Therefore, by updating the first flag bit of the second area through the first program, the first flag bit of the second area can indicate the current program status of the second area in real time and accurately.

[0073] In some embodiments, the second program also has the function of guiding the third program to update and controlling the electronic device to implement the first function. The method may also include: running the second program to guide the third program to update; if the third program fails to update, it stays in the second area and controls the electronic device to implement the first function based on the second program. The first function may be the same as the target function or different from the target function, which can be set according to the needs and is not limited here.

[0074] In this regard, in this embodiment, since the second program in the above-mentioned second area can be used to guide the third program to be updated, the second program can be run to guide the third program to be updated, and then the update status of the third program is detected to clarify whether the third program fails to update. If the third program fails to update, it means that the electronic device cannot be prompted to realize the first function through the third program at present, and the second program can be used to remedy the situation, that is, by running the above-mentioned second program to enable the above-mentioned electronic device to realize the first function, and by using the second program to maintain the electronic device to still realize the first function, abnormal control of the electronic device when the third program fails to update can be avoided.

[0075] In some embodiments, the method may further include: first, in response to a program update instruction for the electronic device, determining a target operating area, wherein the program update instruction includes a second flag, and the second flag is used to indicate the target operating area. Then, by running the first program or the second program in the target operating area, the second program or the third program is updated.

[0076] In this embodiment, the target operating area is determined by the second flag in the program update instruction. Since different target operating areas correspond to different security access levels, the second flag defines the security access levels of different areas when performing a program update to ensure security during program update.

[0077] Different second flag bits are used to indicate different areas. For example, one second flag bit is used to indicate a BootRom area, and another second flag bit is used to indicate a Bootloader area.

[0078] It is understandable that when the program is burned, a specific programming session instruction, that is, the above-mentioned program update instruction, will be entered to realize the jump of the program from the APP area to the Boot area. Since there are two levels of Boot, such as the BootRom area and the Bootloader area, it is necessary to distinguish the jump. That is, when performing security access, different levels of security access can be set, that is, different security access levels correspond to different second flag bits to indicate different levels of Boot areas. Therefore, different second flag bits can be written into the FLASH fixed area according to the security access level, so that when entering the programming session instruction to restart the jump, the BootRom area or the Bootloader area can be entered according to the difference in the second flag bit in the instruction.

[0079] In some embodiments, the first area is a BootRom area, the second area is a BootLoader area, the third program is an application program of the electronic device, and the third program is located in a third area, which can be an App area. Thus, in specific scenarios, it is possible to avoid abnormal control of the electronic device due to the failure of the third program to be used normally.

[0080] 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 update of the second program, but also has the function of starting the second program.

[0081] It is understandable that when the second program fails to update, the second program cannot be used and cannot control the electronic device to achieve the target function. Therefore, in this embodiment, the first program is required 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. Figure 3 As shown, the first program also has the function of controlling the electronic device to achieve the target function. If the second program fails to be updated, the first program is run to enable the electronic device to achieve the target function, including:

[0082] S301: If the second program fails to be updated, the device stays in the first area and controls the electronic device to achieve the target function based on the program function of the first program.

[0083] In this embodiment, a program that replaces the second program to control the electronic device to achieve the target function is configured in the first program, so that when the second program fails to be updated, the first program can replace the second program to re-control the electronic device to achieve the target function, thereby avoiding abnormal control of the electronic device due to the failure of the second program to be used normally.

[0084] In some embodiments, the first program includes at least part of the program functions of the second program, and the at least part of the program functions are used to control the electronic device to implement the target functions, so that the first program can be used to remedy some of the program functions when the second program fails to update, so as to avoid abnormal control of the electronic device due to the inability to use the second program normally. In addition, by maintaining only part of the program functions, the pressure on the storage space caused by the programs added to the first program to implement the program functions for the normal operation of the electronic device is also alleviated.

[0085] In some embodiments, at least part of the above-mentioned program functions may be basic function programs to achieve the target function of the electronic device, and the target function is the basic function corresponding to the basic function program. For example, the above-mentioned electronic device is arranged in a vehicle, and the above-mentioned target function includes at least one of a power management function, a safety management function, and a vehicle driving function.

[0086] Among them, the above-mentioned power management function can ensure that the vehicle can sleep / wake up normally and prevent the vehicle from entering an ultra-low power consumption state; the above-mentioned safety management function needs to support the triggering of a hard-wired signal to remind the upper-level controller that the program is lost, thereby ensuring that the entire vehicle can promptly and effectively remind the driver, such as airbags; the above-mentioned vehicle driving function needs to support the driving function to maintain the minimum control requirements, such as controlling the water pump / fan, etc., to ensure that the vehicle can maintain a lower speed operation, so that the driver can park the vehicle in a safe location.

[0087] In this embodiment, when the electronic device is a vehicle, the first program has at least the basic functional program in the second program, so that when the second program fails to update and cannot be used, it can ensure that the vehicle can be in a safe and reliable state, thereby reducing dependence on program backup and effectively reducing costs.

[0088] In order to better implement the program update method provided in the embodiment of the present application, the embodiment of the present application also provides a device based on the above program update method. The meanings of the terms are the same as those in the above program update method, and the specific implementation details can refer to the description in the method embodiment.

[0089] For example, Figure 4 As shown, the program updating device is applied to an electronic device, the electronic device includes a memory, the memory includes a first area and a second area; the first area includes a first program, the first program at least has a function of guiding the update of the second program; the second area includes a second program, and the program updating device may include:

[0090] A program update module 401, used to run the first program to guide the second program to be updated;

[0091] The program running module 402 is used to run the first program if the second program fails to be updated, so as to enable the electronic device to achieve the target function.

[0092] In some embodiments, the program execution module 402 is specifically used to:

[0093] If the second program fails to update, the first program is run to jump to the third program;

[0094] Based on the third program, the electronic device is controlled to achieve the target function.

[0095] In some embodiments, the second area is configured with a first flag bit for indicating a program state, and the program updating device further includes a flag bit updating module, and the flag bit updating module is specifically used to:

[0096] The first flag is updated to indicate that the second program update fails.

[0097] In some embodiments, the program updating device further includes a prompt module, and the prompt module is specifically used to:

[0098] Through the third program, an error message is given based on the updated first flag, and the error message is used to indicate that the update of the second program has failed.

[0099] In some embodiments, the flag bit update module is specifically used to:

[0100] By running the first program, the first flag is updated.

[0101] In some embodiments, the second program further has the function of guiding the third program to update and controlling the electronic device to implement the first function, and the program update device further includes a control module, and the control module is specifically used to:

[0102] Running the second program to guide the third program to be updated;

[0103] If the third program fails to be updated, the device stays in the second area and controls the electronic device to implement the first function based on the second program.

[0104] In some embodiments, the method and the program updating device further include an instruction response module, and the instruction response module is specifically used to:

[0105] In response to a program update instruction for the electronic device, determining a target operating area, wherein the program update instruction includes a second flag bit, and the second flag bit is used to indicate the target operating area;

[0106] The first program or the second program in the target running area is run to update the second program or the third program.

[0107] In some embodiments, the first area is a BootRom area, the second area is a BootLoader area, the third program is an application program of the electronic device, and the third program is located in the third area.

[0108] In some embodiments, the first program further controls the electronic device to achieve a target function, and the program execution module 402 is specifically used to:

[0109] If the second program fails to be updated, the device stays in the first area and controls the electronic device to achieve the target function based on the program function of the first program.

[0110] In some embodiments, the first program includes at least some of the program functions of the second program, and the at least some of the program functions are used to control the electronic device to achieve the target function.

[0111] In some embodiments, the electronic device is disposed in a vehicle, and the target function includes at least one of a power management function, a safety management function, and a vehicle driving function.

[0112] The program updating device proposed in the present application is applied to an electronic device, wherein the electronic device includes a memory, and the memory includes a first area and a second area; the first area includes a first program, and the first program at least has the function of guiding the update of the second program; the second area includes a second program; and the first program is run to guide the second program to be updated; if the update of the second program fails, it means that the electronic device cannot currently achieve the target function through the second program, and the first program can be used to remedy the situation, that is, by running the first program to enable the electronic device to achieve the target function, and by using the first program to maintain the electronic device still able to achieve the target function, to avoid abnormal control of the electronic device when the second program update fails.

[0113] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation methods and corresponding beneficial effects of the above modules can be found in the previous method embodiments, which will not be repeated here.

[0114] The present application also provides an electronic device, such as Figure 5 As shown, it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application, specifically:

[0115] 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 appreciate that Figure 5 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0116] The processor 501 is the control center of the electronic device, which uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing computer programs and / or modules stored in the memory 502, and calling data stored in the memory 502. 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 processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 501.

[0117] 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, wherein the program storage area may store an operating system, a computer program required for at least one function (such as a sound playback function, an 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 a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.

[0118] The electronic device also includes a power supply 503 for supplying power to each component. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 503 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0119] The electronic device may further include an input unit 504, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0120] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 501 in the electronic device will load 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 will run the computer programs stored in the memory 502, thereby realizing various functions, such as:

[0121] Running the first program to guide the second program to be updated;

[0122] If the second program fails to be updated, the first program is run to enable the electronic device to achieve the target function.

[0123] The specific implementation methods and corresponding beneficial effects of the above operations can be found in the detailed description of the program updating method above, which will not be elaborated here.

[0124] An embodiment of the present application also provides a vehicle, including the above-mentioned program updating device or electronic device. In addition, the vehicle may also include a motor, a display device, etc., which can be specifically set according to needs and are not limited here.

[0125] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0126] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program can be loaded by a processor to execute the steps in any program update method provided in the embodiment of the present application. For example, the computer program can execute the following steps:

[0127] Running the first program to guide the second program to be updated;

[0128] If the second program fails to be updated, the first program is run to enable the electronic device to achieve the target function.

[0129] The specific implementation methods and corresponding beneficial effects of the above operations can be found in the previous embodiments and will not be described in detail here.

[0130] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0131] Since the computer program stored in the computer-readable storage medium can execute the steps in any program updating method provided in the embodiments of the present application, the beneficial effects that can be achieved by any program updating method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0132] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned program update method.

[0133] The above is a detailed introduction to a program updating method, device and electronic device provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A program updating method, characterized in that: Applied to an electronic device, the electronic device comprises a memory, the memory comprises a first area and a second area; the first area comprises a first program, the first program at least has a function of guiding the update of the second program; The second area includes the second program; and the method includes: Running the first program to guide the second program to be updated; If the second program fails to be updated, the first program is run to enable the electronic device to achieve the target function.

2. The program updating method according to claim 1, characterized in that: If the second program fails to be updated, running the first program to enable the electronic device to achieve a target function includes: If the second program fails to update, jumping to the third program by running the first program; The electronic device is controlled to realize the target function based on the third program.

3. The program updating method according to claim 2, characterized in that: The second area is configured with a first flag bit for indicating a program status, and after the second program fails to be updated, the method further includes: The first flag is updated to indicate that the second program update fails.

4. The program updating method according to claim 3, characterized in that: After jumping to the third program by running the first program, the method further includes: Through the third program, an error prompt is given based on the updated first flag, and the error prompt is used to prompt that the update of the second program fails.

5. The program updating method according to claim 3, characterized in that: The updating of the first flag bit includes: The first flag is updated by running the first program.

6. The program updating method according to claim 2, characterized in that: The second program also has the function of guiding the third program to update and controlling the electronic device to implement the first function, and the method further includes: Running the second program to guide the third program to be updated; If the third program fails to be updated, the device stays in the second area and controls the electronic device to implement the first function based on the second program.

7. The program updating method according to claim 6, characterized in that: The method further comprises: In response to a program update instruction for the electronic device, determining a target operating area, the program update instruction comprising a second flag bit, the second flag bit being used to indicate the target operating area; The first program or the second program in the target running area is run to update the second program or the third program.

8. The program updating method according to any one of claims 2 to 7, characterized in that: The first area is a BootRom area, the second area is a BootLoader area, the third program is an application program of the electronic device, and the third program is located in the third area.

9. The program updating method according to claim 1, characterized in that: The first program also has the function of controlling the electronic device to achieve a target function, and if the second program fails to be updated, running the first program to enable the electronic device to achieve the target function includes: If the second program fails to be updated, the device stays in the first area and controls the electronic device to implement the target function based on the program function of the first program.

10. The program updating method according to claim 9, characterized in that: The first program includes at least part of the program functions of the second program, and the at least part of the program functions are used to control the electronic device to implement the target function.

11. The program updating method according to claim 9, characterized in that: The electronic device is arranged in a vehicle, and the target function includes at least one of a power management function, a safety management function, and a vehicle driving function.

12. A program updating device, characterized in that: Applied to an electronic device, the electronic device comprises a memory, the memory comprises a first area and a second area; the first area comprises a first program, the first program at least has a function of guiding the update of the second program; The second area includes the second program; and the device includes: A program update module, used for running the first program to guide the second program to be updated; The program running module is used to run the first program if the update of the second program fails, so as to enable the electronic device to achieve the target function.

13. An electronic device, characterized in that: The system comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the program updating method according to any one of claims 1 to 11.

14. A vehicle, characterized in that: Includes the program updating device according to claim 12 or the electronic device according to claim 13.

Citation Information

Patent Citations

  • A program updating method and device

    CN106990982A

  • Electronic equipment, starting method and device thereof, storage medium and vehicle

    CN116685945A

  • Program upgrading method and device, computer equipment, storage medium and program product

    CN116909607A