Software updating method and device, electronic equipment and storage medium
By introducing the update plug-in runtime area into the software controller architecture and erasing and replacing the bootloader, the difficult and high-risk issues in the BootLoader update process are solved, enabling remote updates of the bootloader and improving system stability.
Patent Information
- Application Number
- CN202410523679.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2024-09-24
AI Technical Summary
In the existing technology, the update process of BootLoader is difficult and risky. Especially when large-scale recalls or remote upgrades are required, it is easy to cause the controller system to fail to start, bringing service and operation and maintenance pressure to the car factory.
Introducing the boot loader running area, flash area and update plug-in running area into the software controller architecture, erasing and replacing the boot loader by updating the plug-in, realizing remote update of the boot loader, reducing dependence on local devices.
It realizes the remote update of the boot loader, reduces the workload and cost, avoids the problem of the controller system being unable to start due to failure during the upgrade process, and improves the reliability and efficiency of the update.
Smart Images

Figure CN118689501A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software technology, and in particular to a software updating method and device, electronic equipment, and storage medium. Background Art
[0002] The existing common software architecture generally adopts the design of BootLoader (boot loader) + APP (application). In this design, BootLoader is mainly responsible for starting the device and initializing the basic hardware, while APP is responsible for implementing specific functions.
[0003] For example, in a traditional vehicle controller system, software upgrades usually require rewriting the BootLoader and application programs; the BootLoader is mainly responsible for starting the main operating system of the vehicle controller and loading the application program when necessary.
[0004] However, the software architecture of the related technology usually only has a single BootLoader area, which makes it difficult and risky to update the BootLoader. Especially when the BootLoader needs to be upgraded to support new hardware, improve security or fix critical errors, the related technology often requires the use of proximal devices (such as diagnostic instruments) to physically connect and perform the burning process. This method is not only labor-intensive and costly, but any failure during the upgrade process may cause the controller system to fail to start, that is, "becoming bricked". Especially in the case of large-scale recalls or large-scale remote upgrade needs, the related technology often cannot effectively update the BootLoader remotely, which brings great service and operation and maintenance pressure to car manufacturers. Summary of the invention
[0005] In view of the above problems, a software updating method and device, electronic device, and storage medium are proposed to overcome the above problems or at least partially solve the above problems, including:
[0006] A software update method, wherein the controller architecture of the software at least includes a boot loader running area, a boot loader flashing area and an update plug-in running area, and the boot loader running area runs a first boot loader, and the method comprises:
[0007] In response to an update requirement of the first boot loader, flashing the second boot loader to the boot loader flashing area;
[0008] Obtaining an update plug-in, and flashing the update plug-in to the update plug-in running area;
[0009] Erasing the first boot loader in the boot loader running area through the update plug-in; and copying the second boot loader to the boot loader running area;
[0010] Run the second boot loader.
[0011] Optionally, before running the second boot loader, the method further includes:
[0012] The update plug-in in the update plug-in running area and the second boot loader in the boot loader flashing area are erased.
[0013] Optionally, the controller architecture of the software further includes an application area, and after running the second boot loader, further includes:
[0014] Application update data is acquired, and the target application in the application area is updated using the application update data.
[0015] Optionally, flashing the update plug-in to the update plug-in running area includes:
[0016] The update plug-in and the running logic of the update plug-in are flashed to the update plug-in running area, wherein the update plug-in running area is located in a random access memory.
[0017] Optionally, erasing the update plug-in in the update plug-in running area and the second boot loader in the boot loader flashing area includes:
[0018] The update plug-in in the update plug-in running area and the second boot loader in the boot loader flashing area are erased through the running logic of the update plug-in.
[0019] Optionally, after erasing the first boot loader in the boot loader running area by the update plug-in and copying the second boot loader to the boot loader running area, the method further includes:
[0020] The valid flag of the update plug-in is set to an invalid state.
[0021] Optionally, after erasing the update plug-in in the update plug-in running area and the second boot loader in the boot loader program flashing area, the method further includes:
[0022] A reset operation is performed on the software.
[0023] A software update device, wherein the controller architecture of the software at least includes a boot loader running area, a boot loader flashing area and an update plug-in running area, the boot loader running area runs a first boot loader, and the device comprises:
[0024] A second boot loader program flashing module, configured to flash a second boot loader program to the boot loader program flashing area in response to an update requirement of the first boot loader program;
[0025] An update plug-in flashing module, used for obtaining an update plug-in and flashing the update plug-in to the update plug-in running area;
[0026] A second boot loader copy module, configured to erase the first boot loader in the boot loader running area through the update plug-in; and copy the second boot loader to the boot loader running area;
[0027] The second boot loader program running module is used to run the second boot loader program.
[0028] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the software updating method as described above when executed by the processor.
[0029] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the software updating method described above is implemented.
[0030] The embodiments of the present invention have the following advantages:
[0031] In an embodiment of the present invention, a software update method is proposed, in which the controller architecture of the software includes at least a boot loader running area, a boot loader flashing area and an update plug-in running area. The boot loader running area runs a first boot loader. When the first boot loader has an update requirement, the second boot loader is flashed to the boot loader flashing area; then the update plug-in is obtained and the update plug-in is flashed to the update plug-in running area; and then the first boot loader in the boot loader running area is erased through the update plug-in; and the second boot loader is copied to the boot loader running area; thereby running the second boot loader, and realizing the use of the update plug-in running in the controller architecture of the software instead of the proximal device to complete the upgrade and update process of the boot loader, thereby realizing the remote update of the boot loader, reducing the workload and cost of the software update process, and the boot loader flashing area additionally added in the controller architecture can be used to specifically perform the flashing work of the boot loader, without affecting the normal operation of the original boot loader in the boot loader running area, thereby avoiding the failure or interruption during the upgrade process that causes the controller system to be unable to start, that is, the "bricked" phenomenon. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0033] Figure 1 is a flowchart of the steps of a software updating method provided by some embodiments of the present invention;
[0034] Figure 2 is an example diagram of an XML file corresponding to a packaging format sample provided by some embodiments of the present invention;
[0035] Figure 3 is a flowchart of steps of another software updating method provided by some embodiments of the present invention;
[0036] Figure 4 It is a schematic diagram of the overall workflow of the present invention provided by some embodiments of the present invention;
[0037] Figure 5 It is a structural diagram of a software updating device provided by some embodiments of the present invention. DETAILED DESCRIPTION
[0038] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] The existing common software architecture generally adopts the BootLoader+APP design. In this design, the BootLoader is mainly responsible for starting the device and initializing the basic hardware, while the APP is responsible for implementing specific functions.
[0040] For example, in a traditional vehicle controller system, software upgrades usually require rewriting the BootLoader and application programs; the BootLoader is mainly responsible for starting the main operating system of the vehicle controller and loading the application program when necessary.
[0041] However, the software architecture of the related technology usually only has a single BootLoader area, which makes it difficult and risky to update the BootLoader. Especially when the BootLoader needs to be upgraded to support new hardware, improve security or fix critical errors, the related technology often requires the use of proximal devices (such as diagnostic instruments) to physically connect and perform the burning process. This method is not only labor-intensive and costly, but any failure during the upgrade process may cause the controller system to fail to start, that is, "becoming bricked". Especially in the case of large-scale recalls or large-scale remote upgrade needs, the related technology often cannot effectively update the BootLoader remotely, which brings great service and operation and maintenance pressure to car manufacturers.
[0042] In the embodiment of the present invention, based on the core technical concept of using an update plug-in running in the controller architecture of the software to replace the proximal device and complete the upgrade and update process of the boot loader, the software update method in the related art is improved. The present invention will be described in detail below with reference to the accompanying drawings:
[0043] Reference Figure 1 , shows a flowchart of the steps of a software update method provided by some embodiments of the present invention, wherein the controller architecture of the software includes at least a boot loader running area, a boot loader flashing area and an update plug-in running area, wherein the boot loader running area runs a first boot loader, and specifically may include the following steps:
[0044] Step 101, in response to an update requirement of the first boot loader, flashing a second boot loader to the boot loader flashing area;
[0045] Most controller architectures in related technologies are designed with BootLoader (boot loader) + APP (application), where BootLoader is mainly responsible for starting the device and initializing basic hardware, while APP is responsible for implementing specific functions; although some controllers in related technologies can realize dual-partition (dual APP) operation, so there can be an APP running area and an APP backup area; but for BootLoader, there is generally only one boot loader running area; where the running area refers to the area where the application runs normally;
[0046] Therefore, in the specific implementation, an additional BootLoader partition can be added to perform flashing (i.e., the boot loader flashing area), but the boot loader flashing area can be different from the dual-partition design of APP in the related art, that is, the update is not achieved by switching the running area (i.e., the dual-partition controller performs flashing when APP_A is running, and switches to APP_B partition after the flashing is completed). Because if the boot loader flashing area can also be used as the running area to run the boot loader, there will be 4 permutations and combinations of running areas, which increases the complexity of the overall controller software and reduces the running reliability. In addition, the software upgrade of APP is generally reversible, and in principle it is allowed to support returning to the corresponding partition of the previous version; however, when there is a need to update the BootLoader, it is generally because there are major problems that must be solved and need to be upgraded, and reversal is generally not allowed. Therefore, the boot loader flashing area can be used only for flashing operations, that is, the BootLoader program can only run in area 1 (boot loader running area) and perform flashing operations only in area 2 (boot loader flashing area);
[0047] Furthermore, in response to the update requirement of the first boot loader, the second boot loader can be flashed to the boot loader flashing area through the bootstrap program, wherein the second boot loader can be an updated boot loader file. At this time, the first boot loader in the boot loader running area can continue to maintain the running state, while the second boot loader in the boot loader flashing area may not perform any running operations at all.
[0048] Step 102, obtaining an update plug-in, and flashing the update plug-in to the update plug-in running area;
[0049] In actual applications, an update plug-in update can be pre-set, and the update plug-in can be loaded into the update plug-in running area in the controller architecture through the bootstrap program to jump to the update plug-in. The functional running logic of the update plug-in can also be copied to the RAM (Random Access Memory) area to run and control the update plug-in.
[0050] The specific function operation logic of the update plug-in mainly includes the following three functions:
[0051] 1. Erase the program of the boot loader running area;
[0052] 2. Move the program in the boot loader flashing area to the boot loader running area;
[0053] 3. Clear the update plug-in itself and the programs in the boot loader flash area;
[0054] Among them, the reason for copying the functional running logic of the update plug-in to RAM is to allow the update logic in RAM to clear the program in the boot loader flashing area and the update plug-in itself after completing the transfer of the program in the boot loader flashing area to the boot loader running area. Then, a reset can be performed through OTAmanager (Over-The-Airmanager), and the update plug-in running logic in RAM can also be cleared. After the relevant data is cleared and reset is performed, it can be considered that the entire boot loader has been updated and no other data remains.
[0055] In some embodiments of the present invention, the step of loading the update plug-in into the update plug-in running area includes:
[0056] The update plug-in and the running logic of the update plug-in are loaded into the update plug-in running area, wherein the update plug-in running area is located in a random access memory.
[0057] In actual applications, an update plug-in update can be set in advance, and the update plug-in can be loaded into the update plug-in running area in the controller architecture through the bootstrap program to jump to the update plug-in. The functional running logic of the update plug-in can also be copied to the RAM area to run to control the update plug-in. Among them, the reason for copying the functional running logic of the update plug-in to the RAM is to allow the update logic in the RAM to clear the program and update plug-in in the boot loader flashing area after completing the transfer or copying of the program in the boot loader flashing area to the boot loader running area. Then, a reset can be performed through OTAmanager, and the update plug-in running logic in RAM can also be cleared. After the relevant data is cleared and reset has been performed, it can be considered that the entire boot loader has been updated and no other data remains.
[0058] Step 103, erasing the first boot loader in the boot loader running area through the update plug-in; and copying the second boot loader to the boot loader running area;
[0059] In a specific implementation, the original boot loader (i.e., the first boot loader) in the boot loader running area can be first erased through the update plug-in, and the updated boot loader (i.e., the second boot loader) can be copied or moved to the boot loader running area; further, after the copying is completed, the program in the loader flashing area and the update plug-in in the update plug-in running area can be cleared, and then a reset can be performed through OTAmanager. After the reset is completed, it can be considered that the boot loader update has been completed, so that the APP update steps can be performed according to actual needs.
[0060] In some embodiments of the present invention, after erasing the first boot loader in the boot loader running area by the update plug-in and copying the second boot loader to the boot loader running area, the method further includes:
[0061] The valid flag of the update plug-in is set to an invalid state.
[0062] In actual applications, after executing the copy action, update can set its own program to invalid, and then execute the steps of clearing the program in the loader flash area and updating the plug-in running area through the function operation logic of the update plug-in in RAM.
[0063] In some embodiments of the present invention, after erasing the update plug-in in the update plug-in running area and the second boot loader in the boot loader program flashing area, the method further includes:
[0064] A reset operation is performed on the software.
[0065] In a specific implementation, the original boot loader in the boot loader running area can be erased by the update plug-in first, and the updated boot loader can be copied or moved to the boot loader running area; further, after the copying is completed, the running logic of the update plug-in can be used to clear the program in the loader flash area and the update plug-in in the update plug-in running area, and then a reset can be performed through OTAmanager. After the reset is completed, it can be considered that the boot loader update has been completed, so that the APP update steps can be performed according to actual needs.
[0066] Step 104: Run the second boot loader.
[0067] In a specific implementation, the updated boot loader can be copied or moved to the boot loader running area, and the function operation logic of the update plug-in in the RAM is used to execute the program in the clear loader flash area and the update plug-in running area, and then reset, and run the new boot loader after the reset to implement the corresponding functions, for example, the update of the APP in the application running area can continue.
[0068] Furthermore, since the boot loader update process of the present invention can be controlled by the update plug-in in the update plug-in running area and the update plug-in running logic in the RAM, there is no need to perform a specific update process (such as copying the updated boot loader to the boot loader running area and clearing related data, etc.) through a proximal device or a remote control. Therefore, when the corresponding control is performed through the OTAmanager, there is no need to set up additional control logic for the OTAmanager. The OTAmanager can completely flash the BootLoader and update according to the flash control logic and flash process of the original APP, that is, flash the second boot loader to the boot loader flashing area and load the update plug-in to the update plug-in running area. The steps, the OTAmanager can completely install the same process of flashing the APP for control, without the need for additional differentiated processing;
[0069] That is to say, when packaging APP, BootLoader and update, you can name BootLoader as APP_1, update as APP_2, and application as APP_3. OTAmanager does not need to perceive it (that is, there is no need to distinguish the specific file type, all are processed according to the APP type), and it is treated as an APP to execute the flashing process, and can be passed to OTAmanager through an XML file. It should be noted that although OTAmanager does not need to distinguish file types, it still needs to identify the upgrade order in the software package. For example, if the three files are named APP_1 / APP_02 / APP_03, the order of flashing execution can be defined in the XML file through order. OTAmanager only needs to send the flashing instructions defined by the enterprise standard in this order.
[0070] Specifically, Figure 2 The following is an XML file corresponding to a packaging format sample. The packaging format sample is as follows:
[0071] Software compression package VCU-XXXX—ZIP file (this file is the software compression package uploaded to the OTA platform, which contains the files that need to be flashed after opening);
[0072] The ZIP file can contain the following files:
[0073] 1-VCU-DRV-D01-------Driver file (S19 or HEX format);
[0074] 2-VCU-APP-A01-------BootLoader file (S19 or HEX format);
[0075] 2-VCU-APP-A02-------update file (S19 or HEX format);
[0076] 2-VCU-APP-A03-------Application file (S19 or HEX format);
[0077] pkg-cfg.xml---------description file (this file is similar to the instruction manual passed to OTAmanager, telling OTAmanager which software is included in the package and the file type of each file <filetype>, Flashing order <order>, file name <name>etc.).
[0078] Through the above Figure 2 The XML file containing basic information of components and software packages shown in the figure can be used by OTAmanager to obtain the information to be flashed and execute the flashing operation according to the content in the XML file. <order>The flashing process is carried out in the order of driver file-BootLoader-update-application.
[0079] Furthermore, corresponding abnormal scenario processing mechanisms can be added based on the above steps, for example:
[0080] 1. When a flashing failure occurs when flashing the second boot loader to the boot loader flashing area or flashing the update plug-in to the update plug-in running area, you can directly reset and exit, and then you can re-execute the flashing process;
[0081] 2. When an abnormal power failure occurs in the step of erasing the first boot loader program in the boot loader program running area through the update plug-in, the first boot loader program will be erased. At this time, the second boot loader program and the update plug-in are not erased. After power-on, the update plug-in can be re-run and the step of copying the second boot loader program to the boot loader program running area can be continued until the copy is successful;
[0082] 3. When the power is turned off during the step of copying the second boot loader to the boot loader running area, the data copied to the boot loader running area is incomplete, and the valid mark on the address of the boot loader running area does not exist. At this time, after powering on, the bootstrap can jump to the update plug-in again, and re-execute the steps of erasing the first boot loader and copying the second boot loader to the boot loader running area until the copy is successful;
[0083] 4. When the power is turned off after the valid flag of the update plug-in is set to an invalid state, the boot loader in the boot loader running area has been updated, but the update plug-in has been set to invalid at this time, and the bootstrap will not jump to the update plug-in for execution. The bootstrap will jump to the address of the boot loader running area to run. Although the update plug-in and the second boot loader in the boot loader flashing area are not erased, it does not affect the normal startup; when restarting, the steps of erasing the update plug-in and the second boot loader in the boot loader flashing area can be continued.
[0084] In some embodiments of the present invention, before running the second boot loader, the method further includes:
[0085] The update plug-in in the update plug-in running area and the second boot loader in the boot loader flashing area are erased.
[0086] In actual applications, the original boot loader (i.e., the first boot loader) in the boot loader running area can be erased by the update plug-in first, and the updated boot loader (i.e., the second boot loader) can be copied or moved to the boot loader running area; further, after the copying is completed, the program in the loader flashing area and the update plug-in in the update plug-in running area can be cleared, and then a reset can be performed through OTAmanager. After the reset is completed, it can be considered that the boot loader update has been completed, so that the APP update steps can be performed according to actual needs.
[0087] In some embodiments of the present invention, erasing the update plug-in in the update plug-in running area and the second boot loader in the boot loader flashing area includes:
[0088] The update plug-in in the update plug-in running area and the second boot loader in the boot loader flashing area are erased through the running logic of the update plug-in.
[0089] In a specific implementation, the original boot loader in the boot loader running area can be erased by the update plug-in first, and the updated boot loader can be copied or moved to the boot loader running area; further, after the copying is completed, the program in the loader flashing area and the update plug-in in the update plug-in running area can be cleared through the running logic of the update plug-in, and then a reset can be performed through OTAmanager. After the reset is completed, it can be considered that the boot loader update has been completed, so that the APP update steps can be performed according to actual needs.
[0090] In some embodiments of the present invention, after erasing the update plug-in in the update plug-in running area and the second boot loader in the boot loader program flashing area, the method further includes:
[0091] A reset operation is performed on the software.
[0092] In a specific implementation, the original boot loader in the boot loader running area can be erased by the update plug-in first, and the updated boot loader can be copied or moved to the boot loader running area; further, after the copying is completed, the program in the loader flashing area and the update plug-in in the update plug-in running area can be cleared through the running logic of the update plug-in, and then a reset can be performed through OTAmanager. After the reset is completed, it can be considered that the boot loader update has been completed, so that the APP update steps can be performed according to actual needs.
[0093] In some embodiments of the present invention, the controller architecture of the software further includes an application area, and after running the second boot loader, the software further includes:
[0094] Application update data is acquired, and the target application in the application area is updated using the application update data.
[0095] In a specific implementation, after completing the update of the boot loader, the update data can be obtained by the updated boot loader or the application itself, thereby performing an application update process on the target application in the application area. Specifically, the corresponding update can be completed by switching application partitions, etc., and the present invention does not limit this.
[0096] Reference Figure 3 , shows a flowchart of another software updating method provided by some embodiments of the present invention, which may specifically include the following steps:
[0097] Step 301, in response to the update requirement of the first boot loader, flashing the second boot loader to the boot loader flashing area;
[0098] In the specific implementation, an additional BootLoader partition can be added to perform flashing (i.e., the boot loader flashing area), but the boot loader flashing area can be different from the dual-partition design of APP in the related art, that is, the update is not achieved by switching the running area (i.e., the dual-partition controller performs flashing when APP_A is running, and switches to APP_B partition after the flashing is completed). Because if the boot loader flashing area can also be used as the running area to run the boot loader, there will be 4 permutations and combinations of running areas, which increases the complexity of the overall controller software and reduces the running reliability. In addition, the software upgrade of APP is generally reversible, and in principle it is allowed to support returning to the corresponding partition of the previous version; however, when there is a need to update the BootLoader, it is generally because there are major problems that must be solved and need to be upgraded, and reversal is generally not allowed. Therefore, the boot loader flashing area can be used only for flashing operations, that is, the BootLoader program can only run in area 1 (boot loader running area) and perform flashing operations only in area 2 (boot loader flashing area);
[0099] Furthermore, in response to the update requirement of the first boot loader, the second boot loader can be flashed to the boot loader flashing area through the bootstrap program, wherein the second boot loader can be an updated boot loader file. At this time, the first boot loader in the boot loader running area can continue to maintain the running state, while the second boot loader in the boot loader flashing area may not perform any running operations at all.
[0100] Step 302, obtaining an update plug-in, and flashing the update plug-in and the operation logic of the update plug-in to the update plug-in operation area, wherein the update plug-in operation area is located in a random access memory;
[0101] In actual applications, an update plug-in update can be pre-set, and the update plug-in can be loaded into the update plug-in running area in the controller architecture through the bootstrap program to jump to the update plug-in. The functional running logic of the update plug-in can also be copied to the RAM (Random Access Memory) area to run and control the update plug-in.
[0102] The specific function operation logic of the update plug-in mainly includes the following three functions:
[0103] 1. Erase the program of the boot loader running area;
[0104] 2. Move the program in the boot loader flashing area to the boot loader running area;
[0105] 3. Clear the update plug-in itself and the programs in the boot loader flash area;
[0106] Among them, the reason for copying the functional running logic of the update plug-in to RAM is to allow the update logic in RAM to clear the program in the boot loader flashing area and the update plug-in itself after completing the transfer of the program in the boot loader flashing area to the boot loader running area. Then, a reset can be performed through OTAmanager (Over-The-Airmanager), and the update plug-in running logic in RAM can also be cleared. After the relevant data is cleared and reset is performed, it can be considered that the entire boot loader has been updated and no other data remains.
[0107] Step 303: Erasing the first boot loader in the boot loader running area through the update plug-in; and copying the second boot loader to the boot loader running area;
[0108] In a specific implementation, the original boot loader (i.e., the first boot loader) in the boot loader running area can be first erased through the update plug-in, and the updated boot loader (i.e., the second boot loader) can be copied or moved to the boot loader running area; further, after the copying is completed, the program in the loader flashing area and the update plug-in in the update plug-in running area can be cleared, and then a reset can be performed through OTAmanager. After the reset is completed, it can be considered that the boot loader update has been completed, so that the APP update steps can be performed according to actual needs.
[0109] Step 304: run the second boot loader.
[0110] In a specific implementation, the updated boot loader can be copied or moved to the boot loader running area, and the function operation logic of the update plug-in in the RAM is used to execute the program in the clear loader flash area and the update plug-in running area, and then reset, and run the new boot loader after the reset to implement the corresponding functions, for example, the update of the APP in the application running area can continue.
[0111] Furthermore, since the boot loader update process of the present invention can be controlled by the update plug-in in the update plug-in running area and the update plug-in running logic in the RAM, there is no need to perform a specific update process (such as copying the updated boot loader to the boot loader running area and clearing related data, etc.) through a proximal device or a remote control. Therefore, when the corresponding control is performed through the OTAmanager, there is no need to set up additional control logic for the OTAmanager. The OTAmanager can completely flash the BootLoader and update according to the flash control logic and flash process of the original APP, that is, flash the second boot loader to the boot loader flashing area and load the update plug-in to the update plug-in running area. The steps, the OTAmanager can completely install the same process of flashing the APP for control, without the need for additional differentiated processing;
[0112] That is to say, when packaging APP, BootLoader and update, you can name BootLoader as APP_1, update as APP_2, and application as APP_3. OTAmanager does not need to perceive it (that is, there is no need to distinguish the specific file type, all are processed according to the APP type), and it is treated as an APP to execute the flashing process, and can be passed to OTAmanager through an XML file. It should be noted that although OTAmanager does not need to distinguish file types, it still needs to identify the upgrade order in the software package. For example, if the three files are named APP_1 / APP_02 / APP_03, the order of flashing execution can be defined in the XML file through order. OTAmanager only needs to send the flashing instructions defined by the enterprise standard in this order.
[0113] Furthermore, corresponding abnormal scenario processing mechanisms can be added based on the above steps, for example:
[0114] 1. When a flashing failure occurs when flashing the second boot loader to the boot loader flashing area or flashing the update plug-in to the update plug-in running area, you can directly reset and exit, and then you can re-execute the flashing process;
[0115] 2. When an abnormal power failure occurs in the step of erasing the first boot loader program in the boot loader program running area through the update plug-in, the first boot loader program will be erased. At this time, the second boot loader program and the update plug-in are not erased. After power-on, the update plug-in can be re-run and the step of copying the second boot loader program to the boot loader program running area can be continued until the copy is successful;
[0116] 3. When the power is turned off during the step of copying the second boot loader to the boot loader running area, the data copied to the boot loader running area is incomplete, and the valid mark on the address of the boot loader running area does not exist. At this time, after powering on, the bootstrap can jump to the update plug-in again, and re-execute the steps of erasing the first boot loader and copying the second boot loader to the boot loader running area until the copy is successful;
[0117] 4. When the power is turned off after the valid flag of the update plug-in is set to an invalid state, the boot loader in the boot loader running area has been updated, but the update plug-in has been set to invalid at this time, and the bootstrap will not jump to the update plug-in for execution. The bootstrap will jump to the address of the boot loader running area to run. Although the update plug-in and the second boot loader in the boot loader flashing area are not erased, it does not affect the normal startup; when restarting, the steps of erasing the update plug-in and the second boot loader in the boot loader flashing area can be continued.
[0118] The following combination Figure 4 The embodiments of the present invention are exemplarily described as follows:
[0119] Depend on Figure 4 It can be seen from the content that the overall workflow of the present invention can be summarized as follows:
[0120] Step 1, a first boot loader in a normal operating state obtains an update requirement;
[0121] Step 2, upgrade the secondary boot2 (i.e., flash the second boot loader to the boot loader flashing area, where boot is the abbreviation of BootLoader);
[0122] Step 3, upgrade the updater (i.e., obtain the update plug-in and flash the update plug-in to the update plug-in running area);
[0123] Step 4, the updater erases the original boot1 (i.e., by updating the plug-in, erases the first boot loader in the boot loader running area);
[0124] Step 5, move the new boot2 to the original boot1 area (i.e. copy the second boot loader to the boot loader running area);
[0125] Step 6, erasing boot2 and updater (ie, erasing the update plug-in in the update plug-in running area and the second boot loader in the boot loader flashing area).
[0126] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0127] Reference Figure 5 , shows a schematic diagram of the structure of a software updating device provided by some embodiments of the present invention, wherein the controller architecture of the software at least includes a boot loader running area, a boot loader flashing area and an update plug-in running area, wherein the boot loader running area runs a first boot loader, and specifically may include the following modules:
[0128] A second boot loader program flashing module 501, configured to flash a second boot loader program to the boot loader program flashing area in response to an update requirement of the first boot loader program;
[0129] An update plug-in flashing module 502 is used to obtain an update plug-in and flash the update plug-in to the update plug-in running area;
[0130] A second boot loader copying module 503 is used to erase the first boot loader in the boot loader running area through the update plug-in; and copy the second boot loader to the boot loader running area;
[0131] The second boot loader program running module 504 is configured to run the second boot loader program.
[0132] In some embodiments of the present invention, the device further comprises:
[0133] An erasing module is used to erase the update plug-in in the update plug-in running area and the second boot loader in the boot loader flashing area.
[0134] In some embodiments of the present invention, the controller architecture of the software further includes an application area, and the device further includes:
[0135] The application updating module is used to obtain application updating data and update the target application in the application area through the application updating data.
[0136] In some embodiments of the present invention, the update plug-in flashing module 502 includes:
[0137] The update plug-in flashing submodule is used to flash the update plug-in and the running logic of the update plug-in to the update plug-in running area, wherein the update plug-in running area is located in a random access memory.
[0138] In some embodiments of the present invention, the erasure module includes:
[0139] The erasing submodule is used to erase the update plug-in in the update plug-in running area and the second boot loader in the boot loader flashing area through the running logic of the update plug-in.
[0140] In some embodiments of the present invention, the device further comprises:
[0141] The flag bit adjustment module is used to set the valid flag bit of the update plug-in to an invalid state.
[0142] In some embodiments of the present invention, the device further comprises:
[0143] A reset module is used to perform a reset operation on the software.
[0144] Some embodiments of the present invention further provide an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and the computer program implements the above software update method when executed by the processor.
[0145] Some embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above software updating method is implemented.
[0146] Some embodiments of the present invention further provide a computer program product, including a computer program, which implements the above software update method when executed by a processor.
[0147] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0148] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0149] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0150] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0151] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0152] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0153] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0154] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0155] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including a..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the above elements.
[0156] The software update method and device, electronic device, and storage medium provided are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.< / order> < / name> < / order> < / filetype>
Claims
1. A software updating method, characterized in that: The controller architecture of the software at least includes a boot loader running area, a boot loader flashing area and an update plug-in running area, the boot loader running area runs a first boot loader, and the method includes: In response to an update requirement of the first boot loader, flashing the second boot loader to the boot loader flashing area; Obtaining an update plug-in, and flashing the update plug-in to the update plug-in running area; Erasing the first boot loader in the boot loader running area through the update plug-in; and copying the second boot loader to the boot loader running area; Run the second boot loader.
2. The software updating method according to claim 1, characterized in that: Before running the second boot loader, the method further includes: The update plug-in in the update plug-in running area and the second boot loader in the boot loader flashing area are erased.
3. The software updating method according to claim 1 or 2, characterized in that: The controller architecture of the software also includes an application area, and after running the second boot loader, it also includes: Application update data is acquired, and the target application in the application area is updated using the application update data.
4. The software updating method according to claim 2, characterized in that: Flashing the update plug-in to the update plug-in running area includes: The update plug-in and the running logic of the update plug-in are flashed to the update plug-in running area, wherein the update plug-in running area is located in a random access memory.
5. The software updating method according to claim 4, characterized in that: The step of erasing the update plug-in in the update plug-in running area and the second boot loader in the boot loader flashing area includes: The update plug-in in the update plug-in running area and the second boot loader in the boot loader flashing area are erased through the running logic of the update plug-in.
6. The software updating method according to claim 1 or 2, characterized in that: erasing the first boot loader in the boot loader running area by using the update plug-in; After the second boot loader is copied to the boot loader running area, the method further includes: The valid flag of the update plug-in is set to an invalid state.
7. The software updating method according to claim 2, characterized in that: After erasing the update plug-in in the update plug-in running area and the second boot loader in the boot loader program flashing area, the method further includes: A reset operation is performed on the software.
8. A software updating device, characterized in that: The controller architecture of the software at least includes a boot loader running area, a boot loader flashing area and an update plug-in running area, the boot loader running area runs a first boot loader, and the device includes: A second boot loader program flashing module, configured to flash a second boot loader program to the boot loader program flashing area in response to an update requirement of the first boot loader program; An update plug-in flashing module, used for obtaining an update plug-in and flashing the update plug-in to the update plug-in running area; A second boot loader copy module, configured to erase the first boot loader in the boot loader running area through the update plug-in; and copy the second boot loader to the boot loader running area; The second boot loader program running module is used to run the second boot loader program.
9. An electronic device, characterized in that: The invention comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the software updating method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the software updating method according to any one of claims 1 to 7 is implemented.
