Method and device for upgrading electronic equipment

By using a single Loader partition and App partition in the ECU, temporarily copying the Loader to the App partition to form a backup, solving the problems of high storage resource consumption and insufficient reliability during the ECU upgrade process, and achieving an efficient and reliable upgrade process.

CN115061713BActive Publication Date: 2025-08-22YINWANG INTELLIGENT TECHNOLOGIES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110251116.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-08
Publication Date
2025-08-22
Estimated Expiration
2041-03-08

AI Technical Summary

Technical Problem

The prior art has problems in the process of ECU upgrades that high storage resource consumption and abnormal upgrades lead to ECU damage that cannot continue. Especially when RAM resources are limited and storage space is tight, the upgrade reliability is insufficient.

Method used

The design of a single Loader partition and App partition is adopted. By temporarily copying the Loader to the App partition to form a backup, the temporary dual Loader state is realized, and backup protection is carried out during the upgrade process to avoid corruption caused by exceptions, and to ensure the normal startup of each partition through the boot program.

Benefits of technology

It reduces storage resource consumption, improves the reliability of the upgrade process, avoids ECU damage caused by exceptions, and improves the efficiency and reliability of the upgrade.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115061713B_ABST
    Figure CN115061713B_ABST
Patent Text Reader

Abstract

The present application provides a method for upgrading an electronic device, which can be used for upgrading an electronic control unit (ECU), such as upgrading an ECU in a vehicle. The electronic device includes a memory, the memory includes a first partition and a second partition, the first partition stores a loader, the loader has an upgrade module, and the second partition stores an application program. The method includes: starting the loader in the first partition, and the upgrade module of the loader copies the loader to the second partition to form a backup loader; starting the backup loader in the second partition, and the upgrade module of the backup loader updates the loader in the first partition; starting the updated loader in the first partition, and the upgrade module of the updated loader updates the application program in the second partition. The present application can reduce memory resource consumption during the upgrade process of the electronic device, and improve the reliability of the upgrade process by forming a temporary backup loader.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic device upgrades, and in particular to a method and apparatus for upgrading electronic devices, a computing device, and a computer-readable storage medium. Background Art

[0002] With the rapid development of the automotive industry, especially the rapid growth of intelligent connected vehicles, the proportion of automotive electronics in vehicles is increasing. Consequently, the number of in-vehicle electronic control units (ECUs) is increasing, and their functionality is becoming increasingly powerful. The development and market adoption of ECUs often involves upgrading ECU-specific applications (apps) to address bugs and add new features.

[0003] The upgrade process of an ECU application involves the transmission, storage, and validation of the application. However, the storage resources of an ECU are often relatively limited. Therefore, how to reduce the consumption of ECU storage resources during the ECU upgrade process is the technical problem to be solved by the present invention. Summary of the Invention

[0004] In view of the above problems in the prior art, the present application provides a method and apparatus for upgrading electronic devices, a computing device and a computer-readable storage medium, which can improve the reliability of the upgrade process and reduce the consumption of storage resources during the upgrade of electronic devices.

[0005] To achieve the above-mentioned object, the present application provides, in a first aspect, a method for upgrading an electronic device. The electronic device includes a memory, the memory including a first partition and a second partition, the first partition storing a loader having an upgrade module, and the second partition storing an application. The method includes:

[0006] Starting the loader of the first partition, and having the upgrade module of the loader copy the loader to the second partition to form a backup loader;

[0007] Starting the backup loader of the second partition, and updating the loader of the first partition by the upgrade module of the backup loader;

[0008] The updated loader of the first partition is started, and the application of the second partition is updated by the upgrade module of the updated loader.

[0009] Among them, the memory of the above-mentioned electronic device can be a Flash memory or EEPROM, etc., and the first partition and the second partition of the memory storing the loader (Loader) and the application (App) can also be called Loader partition and App partition. This method adopts a Loader partition and an App partition. Compared with the existing technology, there is no redundant partition, thus reducing the consumption of storage resources. In addition, when the Loader partition is self-updated, due to the setting of the step of backing up the Loader, a temporary double backup of the Loader partition during the upgrade process is achieved, preventing the problem of the Loader or App being damaged and unable to continue upgrading or recovering due to anomalies during the upgrade, thereby improving the reliability of the upgrade process.

[0010] As a possible implementation of the first aspect, updating the loader of the first partition includes writing a loader file for updating into the first partition; and / or

[0011] Updating the application program in the second partition includes flashing the updated application program file into the second partition.

[0012] The above is one way to implement the update, that is, by directly writing the corresponding files to the partition.

[0013] As a possible implementation of the first aspect, the loader file or application file for updating is provided by one of the following devices:

[0014] A software upgrade server communicably connected to the electronic device, an external storage device communicably connected to the electronic device interface, or a user terminal communicably connected to the electronic device.

[0015] As described above, the method for obtaining the corresponding upgrade file during the upgrade process can be flexibly selected according to the scenario, such as whether the electronic device can directly access the Internet, whether it can connect to external storage media such as USB storage media, whether it can connect to a user terminal via near-field communication, etc. The method for obtaining the upgrade file can be flexibly selected according to different scenarios.

[0016] As a possible implementation of the first aspect, the memory further includes a third partition storing a boot program;

[0017] The starting of the loader of the first partition, the starting of the backup loader of the second partition, or the starting of the updated loader of the first partition is achieved by starting or restarting the electronic device and then booting it with the boot program.

[0018] Among them, the third partition of the memory storing the boot program (Boot) can also be called the Boot partition. The startup flag of the corresponding partition can be set after each step in the upgrade is completed. After restarting, the Boot will guide the startup of the corresponding partition according to the startup flag.

[0019] As a possible implementation of the first aspect, when an abnormal operation occurs in one of the following steps, the step is re-executed:

[0020] The step of starting the loader of the first partition, and having the upgrade module of the loader copy the loader to the second partition to form a backup loader;

[0021] The step of starting the backup loader of the second partition and updating the loader of the first partition by the upgrade module of the backup loader;

[0022] The updated loader of the first partition is started, and the upgrade module of the updated loader updates the application of the second partition.

[0023] As described above, by re-running the step where the exception occurred, the exception problem of the step can be solved without returning to the first step in the upgrade process. Therefore, there is no need to repeat the normal steps, which avoids step redundancy and speeds up the recovery of the upgrade.

[0024] As a possible implementation manner of the first aspect, the electronic device is an electronic control unit.

[0025] From the above, the present application can be applied to an electronic control unit, and can be further applied to devices equipped with the electronic control unit, such as vehicles, vehicle-mounted boxes (T-Boxes), set-top boxes, network devices (such as routers, wireless access points, etc.), embedded devices, or other consumer terminal electronic products.

[0026] A second aspect of the present application provides a device for upgrading an electronic device, the electronic device including a memory, the memory including a first partition and a second partition, the first partition storing a loader having an upgrade module, and the second partition storing an application program; the device including:

[0027] A first copy module is configured to start the loader of the first partition, and the upgrade module of the loader copies the loader to the second partition to form a backup loader;

[0028] A first updating module is configured to start the backup loader of the second partition, and update the loader of the first partition by the upgrading module of the backup loader;

[0029] The second updating module is used to start the updated loader of the first partition, and update the application of the second partition by the upgrading module of the updated loader.

[0030] As a possible implementation of the second aspect, the updating of the loader of the first partition by the first update module includes flashing a loader file for updating into the first partition; and / or

[0031] The updating of the application program in the second partition by the second updating module includes flashing the updated application program file into the second partition.

[0032] As a possible implementation of the second aspect, the loader file or application file for updating is provided by one of the following devices:

[0033] A software upgrade server communicably connected to the electronic device, an external storage device communicably connected to the electronic device interface, or a user terminal communicably connected to the electronic device.

[0034] As a possible implementation method of the second aspect, it also includes a boot module, and starting the loader of the first partition, starting the backup loader of the second partition, or starting the updated loader of the first partition is achieved by booting the boot module after starting or restarting the electronic device.

[0035] As a possible implementation of the second aspect, when one of the modules runs abnormally, the module is re-run.

[0036] As a possible implementation manner of the second aspect, the electronic device is an electronic control unit.

[0037] A third aspect of the present application provides a computing device, including:

[0038] Communication interface;

[0039] at least one processor connected to the communication interface; and

[0040] At least one memory is connected to the processor and stores program instructions, and when the program instructions are executed by the at least one processor, the at least one processor executes any one of the methods described in the first aspect above.

[0041] A fourth aspect of the present application provides a computer-readable storage medium having program instructions stored thereon. When the program instructions are executed by a computer, the computer is caused to execute any of the methods described in the first aspect.

[0042] In summary, the technical solution of this application adopts a single Loader partition and App partition when upgrading electronic devices, which reduces redundancy, eliminates functional redundancy, reduces the consumption of storage resources, and improves the reliability of the upgrade process by building a temporary dual Loader, meeting the upgrade requirements of electronic devices, such as: supporting App and Loader updates; reducing ECU software damage caused by upgrade anomalies, that is, requiring reliability; saving storage space. Particularly suitable scenarios include: Flash storage resources are relatively tight, and partition division needs to reduce redundancy; or RAM resources are relatively tight, and the Loader program cannot be stored in the memory; or upgrade anomalies need to be considered, and the App cannot be damaged and cannot be recovered due to anomalies.

[0043] These and other aspects of the invention will be apparent from and elucidated with reference to the following description of the embodiment(s). BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The following further illustrates the various features of the present invention and the relationships between the various features with reference to the accompanying drawings. The accompanying drawings are all exemplary, and some features are not shown in actual proportion. In addition, some drawings may omit features that are customary in the field to which this application relates and are not necessary for this application, or additional features that are not necessary for this application may be shown. The combination of the various features shown in the accompanying drawings is not intended to limit this application. In addition, throughout this specification, the same reference numerals refer to the same content. The specific description of the drawings is as follows:

[0045] Figure 1A This is a schematic diagram of an ECU upgrade based on a single Boot partition and a single App partition according to the prior art.

[0046] Figure 1B This is a schematic diagram of an ECU upgrade based on dual App partitions according to the second prior art;

[0047] Figure 1C This is a schematic diagram of ECU upgrade based on dual Loader partitions according to the third prior art;

[0048] Figure 2 A schematic diagram of an embodiment of a method for upgrading an electronic device provided by the present application;

[0049] Figure 3A A schematic diagram of Flash partitions in a specific implementation of the method for upgrading an electronic device provided in this application;

[0050] Figure 3B A flowchart of a specific embodiment of the method for upgrading an electronic device provided by the present application;

[0051] Figure 3C for Figure 3B A schematic diagram of upgrading each partition in the first specific implementation manner is shown;

[0052] Figure 4 A schematic diagram of an embodiment of an apparatus for upgrading an electronic device provided by the present application;

[0053] Figure 5 A schematic diagram of the computing device used in this application. DETAILED DESCRIPTION

[0054] The words "first, second, third, etc." or module A, module B, module C and other similar terms in the specification and claims are only used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that the specific order or sequence can be interchanged where permitted so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0055] In the following description, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps must be executed in this manner. If permitted, the order of the steps can be interchanged or they can be executed simultaneously.

[0056] The term "comprising" as used in the specification and claims should not be construed as limiting to what is listed thereafter; it does not exclude other elements or steps. Thus, it should be interpreted as specifying the presence of the features, integers, steps, or components mentioned, but not excluding the presence or addition of one or more other features, integers, steps, or components, or groups thereof. Thus, the expression "a device comprising means A and B" should not be limited to a device consisting solely of components A and B.

[0057] References in this specification to "one embodiment" or "an embodiment" mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Therefore, appearances of the phrases "in one embodiment" or "in an embodiment" throughout this specification do not necessarily refer to the same embodiment, but may do so. Furthermore, in one or more embodiments, the particular features, structures, or characteristics may be combined in any suitable manner, as would be apparent to one of ordinary skill in the art from this disclosure.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. In the event of any inconsistency, the meanings described in this specification or the meanings derived from the contents recorded in this specification shall prevail. In addition, the terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application. In order to accurately describe the technical content in this application and to accurately understand the present invention, the following explanations or definitions are given for the terms used in this specification before describing the specific embodiments:

[0059] 1) Electronic Control Unit (ECU): This unit consists of a microprocessor (MCU), Flash memory for storing application programs, RAM for program execution, and input / output (I / O) interfaces, among other integrated circuits. When used in a vehicle, it is also called a driving computer or onboard computer.

[0060] 2) ECU data flashing: also known as ECU data filling, is used to update the application program in the ECU's Flash memory.

[0061] 3) Flash memory: Also known as flash memory or flash memory, the full name is Flash EEPROM (Electrically Erasable Programmable Read-Only Memory), which is a type of non-volatile memory. Hereinafter, Flash memory will be referred to as Flash.

[0062] 4) Loader Partition and Loader Program: The partition that stores the Loader program is called the Loader partition. The Loader program, also known as the Bootloader program, supports loading and updating functions. These updates are implemented by the upgrade module within the Loader program. During the ECU's power-on process, this Loader program controls the normal startup of app applications or the execution of programs in the Boot area, such as flashing data to the ECU's Flash memory. Hereinafter, the Loader program will be referred to as simply the Loader.

[0063] 5) App Partition and App Program: The partition that stores App programs is called the App partition. App stands for application program, which is the program that implements the ECU's functions. Hereinafter, App application programs will be referred to as App.

[0064] 6) Boot partition and Boot program: The partition that stores the Boot program is called the Boot partition. The Boot program is the boot program used to start the App partition or Loader partition.

[0065] 7) RAM: Random-Access Memory, which is a volatile memory. The original data in RAM will disappear after the ECU is restarted.

[0066] The following first introduces the existing methods, and then introduces the technical solution of this application in detail.

[0067] Prior art 1: Figure 1A The figure shows a traditional upgrade solution. In this solution, only one Boot partition (boot program partition) and one App partition are set in the ECU's Flash. In order to update the App partition, it is necessary to temporarily load the Loader into the ECU's RAM during the upgrade. After loading, the Loader flashes and updates the App partition.

[0068] The prior art 1 has the following defects:

[0069] 1) During the App upgrade process, if an upgrade exception occurs during the flashing and erasing of the App partition, such as data transmission errors or power outages, the new App has not yet been successfully flashed, resulting in only the program in the Boot area of ​​the ECU's Flash being able to run. This will directly lead to the failure of the ECU upgrade and the inability to execute application functions normally. Since the App in the App partition is erased and damaged, and the Loader in the RAM will disappear after the ECU restarts, the ECU will be unable to continue booting and will have to be returned to the factory for repair;

[0070] 2) The ECU's limited RAM resources limit the size of the loader. If the loader is too large, it will not fit into RAM. This limitation on the size of the loader's code also restricts the amount of code that can be added to improve the loader's functionality.

[0071] Prior art 2: Figure 1B An improved upgrade solution for the prior art is shown, which is a dual App partition upgrade solution. In this solution, the ECU's Flash contains a Boot partition and two App partitions (such as Figure 1B The two App partitions are backed up by each other and both have upgrade and update functions. When the App partition is updated, the program of one App partition can be used to upgrade the other App partition. The typical process is as follows:

[0072] First, you need to use a startup flag to identify the currently activated App partition. If the startup flag corresponds to App0, then the App0 partition is the activated partition and the App0 partition is currently started and running.

[0073] When the App0 partition is running and an App partition update is performed, App0 downloads the upgrade software and flashes it to the App1 partition. The boot flag is then changed to App1, so that the App1 partition starts running after a reboot. App1 then flashes the App0 partition. If the App1 partition update fails, the boot flag remains at App0, and the App1 update can be rolled back or the App1 partition can be flashed again.

[0074] Since the second existing technology uses App0 partition and App1 partition to back up each other, there is a large redundancy, which leads to low Flash storage utilization. Especially for vehicle-mounted ECUs with small storage space, when Flash storage space is particularly tight when integrating increasingly complex functional requirements, this method aggravates the space shortage and even leads to insufficient space.

[0075] Prior art three: Figure 1C Another improved upgrade solution for the prior art is shown, which is a dual loader solution: in this solution, the Flash partition of the ECU includes a Boot partition, a dual Loader partition (such as Figure 1C When updating an App partition, either Loader0 or Loader1 can update the App partition. Furthermore, Loader0 and Loader1 can also update each other. This mutual update is similar to the mutual update of the dual App partitions in the second prior art, and will not be described in detail.

[0076] Since the third prior art adopts the Loader0 and Loader1 partitions, the two partitions serve as backups for each other and are redundant, and therefore, the defects described in the second prior art also exist.

[0077] Based on the technical problems existing in the above-mentioned prior art, the present application provides a method for upgrading an electronic device. The present application sets a Boot partition, a Loader partition, and an App partition in the memory (such as Flash) of the electronic device. By temporarily moving the Loader to the App partition, the Loader partition is flashed and updated to achieve the update of the Loader partition, and the App partition is flashed and updated by the updated Loader to achieve the update of the Loader partition and the App partition. Since there is a temporary backup state of dual Loaders after the Loader is moved to the App partition and before the Loader partition is flashed and updated, it can solve the problem mentioned in the prior art one that the power outage, disconnection, file error, etc. that occur during the upgrade process lead to the ECU abnormality and inability to continue after flashing. Moreover, compared with the prior art two and three, the App partition and the Loader partition are single partitions, there is no redundancy, and storage resources can be saved.

[0078] The ECU upgrade scenario described in this application can be applied to vehicle ECUs, vehicle-mounted boxes (T-Boxes), set-top box ECUs, network equipment (such as routers and wireless access points), embedded device ECUs, and other consumer electronic product ECUs. It is also suitable for general-purpose ECUs / MCUs with limited hardware resources (Flash and RAM) but requiring reliable upgrades.

[0079] [First embodiment of a method for upgrading an electronic device]

[0080] Refer to the following Figure 2 The flowchart shown introduces the first embodiment of the method for upgrading an electronic device of the present application. In this first embodiment, the electronic device includes a memory, such as a Flash memory or an EEPROM, and the memory includes a first partition and a second partition. The first partition stores a loader (Loader), and the loader (Loader) has an upgrade module. The second partition stores an application (App). In some embodiments, the memory also includes a third partition for storing a boot program (Boot). According to the different stored contents, the first, second, and third partitions are also referred to as Loader partitions, App partitions, and Boot partitions in the following text.

[0081] Wherein, in the first embodiment, the electronic device is an electronic control unit ECU. When the electronic device is upgraded, such as Figure 2 As shown, the method for upgrading an electronic device includes the following steps:

[0082] S210: Starting the loader of the first partition, and using the upgrade module of the loader of the first partition, copying the loader to the second partition to form a backup loader;

[0083] In some embodiments, when the electronic device is powered on or restarted, this step can be entered by booting the boot program (i.e., the Boot program). Specifically, when the electronic device is started, a specific key or key combination can be pressed to enter the Boot process, and when entering the Boot process, the Loader of the first partition is booted and executed.

[0084] S220: Starting the backup loader of the second partition, and using the upgrade module of the backup loader to update the loader of the first partition;

[0085] The updating of the loader program of the first partition may be achieved by flashing the updated loader program file into the first partition.

[0086] In some embodiments, after executing step S210, the electronic device can be restarted, and after restarting, it can enter this step by booting the boot program. For example, after executing step S210, the boot flag can be set to correspond to the second partition. After restarting, the Boot will boot the backup Loader of the second partition according to the boot flag.

[0087] S230: Start the updated loader of the first partition, and use the upgrade module of the updated loader to update the application (ie, App program) of the second partition.

[0088] The updating of the application in the second partition may be achieved by flashing the application file for updating into the second partition.

[0089] In some embodiments, after executing step S220, the electronic device can be restarted, and after restarting, it can enter this step by booting the boot program. For example, after executing step S220, the boot flag can be set to correspond to the first partition. After restarting, the Boot will guide the updated Loader of the first partition according to the boot flag.

[0090] As can be seen from the above, this method utilizes a Loader partition and an App partition. Compared to existing technologies, this method eliminates redundant partitions, thereby reducing storage resource consumption. Furthermore, when updating the Loader partition through steps S210 and S220, the inclusion of a Loader backup step in step S210 allows for a temporary dual backup of the Loader partition during the upgrade process. This prevents upgrade anomalies from causing Loader or App corruption and making it impossible to continue upgrading or restoring the app, thereby improving reliability during the upgrade process.

[0091] After this step is completed, the electronic device has completed the application update and the loader update. When the electronic device is restarted again, the boot program boots up the updated application in the second partition, completing the startup of the electronic device. For example, after executing step S230, the boot flag can be set to correspond to the second partition. After the restart, the boot program boots up the updated app in the second partition based on the boot flag.

[0092] In this embodiment, if a step in the above steps encounters an abnormality, the step in which the abnormality occurred is re-executed to resolve the abnormality. In other embodiments, regardless of which step the abnormality occurred, the process may return to step S210. However, in this embodiment, only the step in which the abnormality occurred needs to be re-executed, thus eliminating the need to return to the first step. This eliminates the need to repeat normal steps, avoids redundant steps, and speeds up the recovery and upgrade process.

[0093] In some embodiments, the loader file or application file for the update is provided by one of the following methods:

[0094] Provided by a software upgrade server that can be connected to the electronic device via a communication network. The software upgrade server is usually deployed on the network side. The electronic device accesses the Internet through a wireless communication network, such as through a wireless access point, or through a 5G or 4G network. After connecting to the Internet, it connects to the software upgrade server on the network side to obtain the corresponding update file;

[0095] Alternatively, the update file may be provided by an external storage device connected to the interface of the electronic device, such as a USB storage medium. The corresponding update file may be downloaded and stored in advance in the external storage device, which is then inserted into the corresponding interface of the electronic device to provide the update file to the electronic device.

[0096] Alternatively, a user terminal connected to the electronic device for communication, such as a user's mobile phone, PAD, etc., which can be connected wirelessly, such as WIFI or Bluetooth, or via a data cable, can communicate with the software upgrade server, obtain the corresponding update files from the software upgrade server, and provide them to the electronic device.

[0097] In some embodiments, the process of updating the Loader of the Loader partition or the App of the App partition can be performed in a file incremental update manner.

[0098] [First Specific Implementation Method for Upgrading Electronic Equipment]

[0099] The following is an example of an embodiment of the present application being applied to an ECU. Specifically, the upgrade is to upgrade the Flash of the ECU. Figure 3A The Flash memory allocated to the ECU shown includes at least the following partitions:

[0100] The Boot partition contains a bootloader, also referred to as "Boot." This bootloader can determine whether to launch an app or the upgrade program in the Loader partition based on certain conditions, such as a flag or whether the app launched normally. To ensure ECU reliability, this bootloader must be as simple and stable as possible, and the Boot partition generally does not require updates.

[0101] The Loader partition deploys a software upgrade program, which is referred to as the Loader for short. The Loader partition supports downloading and refreshing data in each partition of the Flash.

[0102] App partition, which contains application programs App.

[0103] Other partitions may include partitions for storing parameters. To ensure the integrity of these parameters before and after the ECU is updated, these partitions do not need to be updated during the ECU update process.

[0104] Next, based on the above Flash partition, see Figure 3B A flowchart of a specific embodiment of the method for upgrading an ECU provided by the present application is shown. Figure 3C The schematic diagram of each partition upgrade in this specific embodiment is shown to illustrate this specific embodiment. In this specific embodiment, updating the Loader partition and the App partition is used as an example for explanation, including the following steps:

[0105] S310: After the Loader partition is started through the Boot process, the Loader partition data is copied to the App partition through the upgrade module in the Loader to form a backup Loader. At this time, the Apps stored in the App partition will not be able to be used normally.

[0106] If communication is interrupted or power is off, restart the Loader partition's Loader after the next boot and continue or re-execute this step.

[0107] For descriptive purposes, in this embodiment, the Loader in the Loader partition is referred to as Loader0, and the backup Loader in the App partition is referred to as Loader1.

[0108] S320: Start Loader1 in the App partition. Loader1 can be started through Boot after the ECU is restarted. For example, before switching, the startup flag of the Loader is set to the Loader that is not currently running. In this way, after the Boot is restarted, another Loader will be started.

[0109] S330: The upgrade module in Loader1 downloads the new version of the Loader file package from the software upgrade server and flashes the new version of the Loader file package to the Loader partition. If an exception occurs during the flashing process, the current Loader1 is restarted after the next boot and this step is continued or repeated.

[0110] S340: After flashing the Loader partition, start Loader0 in the Loader partition. At this time, Loader0 has been updated. The method of starting Loader0 can refer to the description in step S320 and will not be repeated here.

[0111] S350: Use the upgrade module in Loader0 to update the App partition. This includes downloading the App file package from the software update server and updating the App partition accordingly. If an exception occurs during the update process, restart Loader0 after the next boot and continue or re-execute this step.

[0112] When the App partition is flashed, the upgrade is completed. At this time, both the Loader partition and the App partition are updated. When the ECU is restarted, the App in the App partition is started normally through the Boot.

[0113] It should also be noted that if only the App partition is updated, only step S350 above is involved and will not be repeated. It should also be noted that the above description uses the App partition as an example. It is not difficult to understand that if other partitions exist and the data of the partition is not affected, the Loader partition data in S310 above can also be copied to other partitions to implement the above dual Loader process.

[0114] Among them, the above is to download the required Loader file package and App file package from the software upgrade server during the upgrade process. In some embodiments, the corresponding file package can also be obtained from a peripheral device connected through an interface, such as an external memory connected through a USB interface and storing the above file package. In other embodiments, the corresponding file package can also be obtained from a wirelessly connected terminal, such as a mobile phone or PAD connected at a short distance via Bluetooth, WIFI, etc. Moreover, when the update adopts an incremental update method, the file package described here may only involve the incremental part that needs to be updated.

[0115] [Embodiment of the device for upgrading electronic equipment of the present application]

[0116] like Figure 4As shown, the present application also provides an embodiment of a corresponding device for upgrading electronic devices. For the beneficial effects or technical problems solved by the device, please refer to the description of the methods corresponding to each device, or refer to the description in the content of the invention, which will not be repeated here.

[0117] In an embodiment of the apparatus for upgrading an electronic device, the electronic device includes a memory, the memory includes a first partition and a second partition, the first partition stores a loader having an upgrade module, and the second partition stores an application program; the apparatus includes:

[0118] A first copy module 410 is configured to start the loader of the first partition, and have the upgrade module of the loader copy the loader to the second partition to form a backup loader;

[0119] A first updating module 420 is configured to start the backup loader of the second partition and update the loader of the first partition by using the upgrade module of the backup loader;

[0120] The second updating module 430 is configured to start the updated loader of the first partition, and update the application of the second partition by the upgrading module of the updated loader.

[0121] In some embodiments, the updating of the loader of the first partition by the first update module 420 includes writing the updated loader file to the first partition; the updating of the application of the second partition by the second update module 430 includes writing the updated application file to the second partition.

[0122] In some embodiments, the updating loader file or application file is provided by one of the following devices: a software upgrade server, an external storage device connected to the electronic device interface, or a user terminal connected to the electronic device for communication.

[0123] In some embodiments, a boot module 440 is also included, and starting the loader of the first partition, starting the backup loader of the second partition, or starting the updated loader of the first partition is achieved by booting the boot module after starting or restarting the electronic device.

[0124] In some embodiments, when each module encounters an operational abnormality, the module is re-run.

[0125] In some embodiments, the electronic device is an electronic control unit.

[0126] [Embodiment of the computing device of the present application]

[0127] Figure 5 9 is a schematic structural diagram of a computing device 900 provided in an embodiment of the present application. The computing device 900 includes: a processor 910, a memory 920, and a communication interface 930.

[0128] It should be understood that Figure 5 The communication interface 930 in the computing device 900 shown in FIG. 9 may be used to communicate with other devices.

[0129] The processor 910 may be connected to a memory 920. The memory 920 may be used to store the program code and data. Therefore, the memory 920 may be a storage unit within the processor 910, an external storage unit independent of the processor 910, or a component including both a storage unit within the processor 910 and an external storage unit independent of the processor 910.

[0130] Optionally, the computing device 900 may further include a bus. The memory 920 and the communication interface 930 may be connected to the processor 910 via the bus. The bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, and the like.

[0131] It should be understood that in the embodiment of the present application, the processor 910 can adopt a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. Alternatively, the processor 910 adopts one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0132] The memory 920 may include a read-only memory and a random access memory, and provides instructions and data to the processor 910. A portion of the processor 910 may also include a non-volatile random access memory. For example, the processor 910 may also store information about the device type.

[0133] When the computing device 900 is running, the processor 910 executes the computer-executable instructions in the memory 920 to perform the operating steps of the above method.

[0134] It should be understood that the computing device 900 according to the embodiment of the present application can correspond to the corresponding subject in executing the method according to each embodiment of the present application, and the above-mentioned and other operations and / or functions of each module in the computing device 900 are respectively for implementing the corresponding processes of each method of the present embodiment. For the sake of brevity, they will not be repeated here.

[0135] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0136] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0137] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0138] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0139] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0140] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0141] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, it is used to execute a method for generating diversified questions, which includes at least one of the solutions described in the above embodiments.

[0142] The computer storage medium of the embodiment of the present application can adopt any combination of one or more computer-readable media.Computer-readable media can be computer-readable signal media or computer-readable storage media.Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof.More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connection with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination thereof.In this document, computer-readable storage media can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0143] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0144] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0145] The computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0146] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present application has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, all of which fall within the scope of protection of the present invention.

Claims

1. A method for upgrading an electronic device, characterized in that: The electronic device includes a memory, the memory includes a first partition and a second partition, the first partition stores a loader program having an upgrade module, and the second partition stores an application program. The method includes: Starting the loader of the first partition, and having the upgrade module of the loader copy the loader to the second partition to form a backup loader; Starting the backup loader of the second partition, and updating the loader of the first partition by the upgrade module of the backup loader; The updated loader of the first partition is started, and the application of the second partition is updated by the upgrade module of the updated loader.

2. The method according to claim 1, wherein: Updating the loader of the first partition includes writing the loader file for updating into the first partition; and / or Updating the application in the second partition includes flashing an updated application file into the second partition.

3. The method according to claim 2, characterized in that The loader file or application file for the update is provided by one of the following devices: A software upgrade server communicably connected to the electronic device, an external storage device communicably connected to the electronic device interface, or a user terminal communicably connected to the electronic device.

4. The method according to claim 1, wherein The memory further includes a third partition storing a boot program; The starting of the loader of the first partition, the starting of the backup loader of the second partition, or the starting of the updated loader of the first partition is achieved by starting or restarting the electronic device and then booting it with the boot program.

5. The method according to claim 1, wherein If an abnormality occurs in one of the following steps, rerun the step: The step of starting the loader of the first partition, and having the upgrade module of the loader copy the loader to the second partition to form a backup loader; The step of starting the backup loader of the second partition and updating the loader of the first partition by the upgrade module of the backup loader; The updated loader of the first partition is started, and the upgrade module of the updated loader updates the application of the second partition.

6. The method according to any one of claims 1 to 5, characterized in that The electronic device is an electronic control unit.

7. A device for upgrading electronic equipment, characterized in that: The electronic device includes a memory, the memory includes a first partition and a second partition, the first partition stores a loader program having an upgrade module, and the second partition stores an application program; the device includes: A first copy module is configured to start the loader of the first partition, and the upgrade module of the loader copies the loader to the second partition to form a backup loader; A first updating module is configured to start the backup loader of the second partition, and update the loader of the first partition by the upgrading module of the backup loader; The second updating module is used to start the updated loader of the first partition, and update the application of the second partition by the upgrading module of the updated loader.

8. The device according to claim 7, characterized in that: The updating of the loader of the first partition by the first updating module includes writing a loader file for updating into the first partition; and / or The updating of the application program in the second partition by the second updating module includes flashing the updated application program file into the second partition.

9. The device according to claim 8, characterized in that The loader file or application file for the update is provided by one of the following devices: A software upgrade server communicably connected to the electronic device, an external storage device communicably connected to the electronic device interface, or a user terminal communicably connected to the electronic device.

10. The device according to claim 7, characterized in that It also includes a boot module, and starting the loader of the first partition, starting the backup loader of the second partition, or starting the updated loader of the first partition is achieved by booting the boot module after starting or restarting the electronic device.

11. The device according to claim 7, characterized in that When one of the modules runs abnormally, the module is re-run.

12. The device according to any one of claims 7 to 11, characterized in that: The electronic device is an electronic control unit.

13. A computing device, characterized in that include: Communication interface; at least one processor connected to the communication interface; as well as At least one memory is connected to the processor and stores program instructions, and when the program instructions are executed by the at least one processor, the at least one processor executes the method according to any one of claims 1 to 6.

14. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a computer, the computer is caused to perform the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Bootloader program updating method and device, electronic device and storage medium

    CN109857426A