WO2022188690A1 - Method and apparatus for upgrading electronic device - Google Patents

Method and apparatus for upgrading electronic device Download PDF

Info

Publication number
WO2022188690A1
WO2022188690A1 PCT/CN2022/079081 CN2022079081W WO2022188690A1 WO 2022188690 A1 WO2022188690 A1 WO 2022188690A1 CN 2022079081 W CN2022079081 W CN 2022079081W WO 2022188690 A1 WO2022188690 A1 WO 2022188690A1
Authority
WO
WIPO (PCT)
Prior art keywords
partition
loader
electronic device
program
module
Prior art date
Application number
PCT/CN2022/079081
Other languages
French (fr)
Chinese (zh)
Inventor
许小兵
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022188690A1 publication Critical patent/WO2022188690A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0626Reducing size or complexity of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/065Replication mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Definitions

  • the present invention relates to the technical field of electronic equipment upgrading, and in particular, to a method and apparatus for upgrading electronic equipment, a computing device and a computer-readable storage medium.
  • the upgrade process of the ECU application program involves the transmission, storage and validation process of the application program, and the storage resources of the ECU are often relatively small. Therefore, how to reduce the consumption of the ECU storage resources during the ECU upgrade process is to be solved by the present invention. technical issues.
  • the present application provides a method and device for upgrading electronic equipment, a computing device and a computer-readable storage medium, which can improve the reliability of the upgrading process during the upgrading process of electronic equipment, and reduce the need for Consumption of storage resources.
  • a first aspect of the present application provides a method 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 loading program
  • the The loader has an upgrade module
  • the second partition stores application programs
  • the method includes:
  • the updated loader of the first partition is started, and the application program of the second partition is updated by an upgrade module of the updated loader.
  • the memory of the electronic device may be Flash memory or EEPROM, etc.
  • the first partition and the second partition of the memory storing the loader (Loader) and the application program (App) may also be referred to as the Loader partition and the App partition.
  • the method adopts a Loader partition and an App partition, and compared with the prior art, there is no redundant partition, thus reducing the consumption of storage resources.
  • the step of backing up the Loader is set, which realizes the temporary double backup of the Loader partition during the upgrade process, preventing the problem that the Loader or App is damaged and the upgrade or recovery cannot be continued due to abnormal upgrades. reliability during the upgrade process.
  • the updating the loader of the first partition includes writing a loader file for updating into the first partition;
  • the updating the application program of the second partition includes writing the application program file for updating into the second partition. .
  • the above is an implementation method of updating, that is, by directly flashing the corresponding files to the partition.
  • the loader file or application file for the update is provided by one of the following devices:
  • a software upgrade server that can be connected in communication with the electronic device, an external storage device that can be interfaced with the electronic device, or a user terminal that can be connected in communication with the electronic device.
  • the scenario can be: whether the electronic device can directly access the Internet, whether it can connect to external storage media such as USB storage media, and whether it can be connected through short-range communication. user terminal, etc. You can flexibly choose the way to obtain the upgrade file according to different scenarios.
  • the memory further includes a third partition storing a boot program
  • Said starting the loader of the first partition, starting the loader of the backup of the second partition, or starting the updated loader of the first partition by starting or restarting the electronic device by the It is implemented in the way of bootstrap.
  • the third partition of the memory storing the boot program may also be called the Boot partition, and the startup flag of the corresponding partition can be set after each step in the upgrade is completed. Partition startup.
  • the step is re-run:
  • the abnormal problem of this step can be solved without returning to the first step in the upgrade process, so that the normal steps do not need to be repeated, the redundancy of steps is avoided, and the recovery and upgrade speed is faster.
  • the electronic device is an electronic control unit.
  • the present application can be applied to an electronic control unit, and further can be applied to equipment equipped with the electronic control unit, such as a vehicle, a vehicle-mounted box (T-Box), a set-top box, a network device (such as a router, a wireless access point) etc.), embedded devices, or other consumer terminal electronic products, etc.
  • equipment equipped with the electronic control unit such as a vehicle, a vehicle-mounted box (T-Box), a set-top box, a network device (such as a router, a wireless access point) etc.), embedded devices, or other consumer terminal electronic products, etc.
  • a second aspect of the present application provides an 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
  • the loader has an upgrade module
  • the second partition stores application programs
  • the device includes:
  • a first copying module used for starting the loading program of the first sub-region, and the upgrading module of the loading program copies the loading program to the second sub-region to form a backup loading program;
  • a first update module configured to start a backup loader of the second partition, and update the loader of the first partition by an upgrade module of the backup loader;
  • the second update module is used for starting the updated loader of the first partition, and the application program of the second partition is updated by the update module of the updated loader.
  • the updating the loader of the first partition of the first update module includes writing a loader file for updating into the first partition;
  • the updating of the application program of the second partition of the second update module includes writing an application program file for updating into the second partition.
  • the update loader file or application file is provided by one of the following devices:
  • a software upgrade server that can be connected in communication with the electronic device, an external storage device that can be interfaced with the electronic device, or a user terminal that can be connected in communication with the electronic device.
  • the method further includes a booting module for starting the loader of the first partition, starting the loader of the backup of the second partition, or starting the updated first partition.
  • the loader is implemented by starting or restarting the electronic device and being guided by the boot module.
  • the module when one of the modules runs abnormally, the module is re-run.
  • the electronic device is an electronic control unit.
  • a third aspect of the present application provides a computing device, including:
  • At least one memory connected to the processor and storing program instructions, the program instructions, when executed by the at least one processor, cause the at least one processor to perform the method of any one of the first aspects above.
  • a fourth aspect of the present application provides a computer-readable storage medium on which program instructions are stored, the program instructions, when executed by a computer, cause the computer to perform any of the methods described in the first aspect above.
  • the technical solution of the present application adopts a single Loader partition and App partition when upgrading electronic equipment, which reduces redundancy, does not exist functional redundancy, and reduces the consumption of storage resources.
  • Loader improves the reliability during the upgrade process and meets the upgrade requirements of electronic devices.
  • the requirements are: support for App and Loader updates; reduce ECU software damage caused by upgrade exceptions, which requires reliability; save storage space.
  • Especially suitable scenarios include: Flash storage resources are relatively tight, and partitioning needs to reduce redundancy; or RAM resources are relatively tight, and the Loader program cannot be stored in memory; or upgrade exceptions need to be considered, and the App cannot be damaged due to exceptions. recovery situation.
  • FIG. 1A is a schematic diagram of an ECU upgrade based on a single Boot partition and a single App partition according to the prior art
  • FIG. 1B is a schematic diagram of an ECU upgrade based on dual App partitions according to the second prior art
  • FIG. 1C is a schematic diagram of an ECU upgrade based on dual Loader partitions in the prior art three;
  • FIG. 2 is a schematic diagram of an embodiment of a method for upgrading an electronic device provided by the present application
  • 3A is a schematic diagram of a partition of Flash in a specific embodiment of the method for upgrading an electronic device provided by the application;
  • 3B is a flowchart of a specific implementation manner of a method for upgrading an electronic device provided by the present application
  • FIG. 3C is a schematic diagram of each partition upgrade in the first embodiment shown in FIG. 3B;
  • FIG. 4 is a schematic diagram of an embodiment of an apparatus for upgrading electronic equipment provided by the present application.
  • FIG. 5 is a schematic diagram of a computing device of the present application.
  • ECU Electronic Control Unit
  • MCU microprocessor
  • RAM for program running
  • I/O input/output interface
  • trip computer When used in a vehicle, it is also called a trip computer or an on-board computer.
  • ECU data flashing Also known as ECU data filling, it is used to update the application program in the Flash memory of the ECU.
  • Flash memory also known as flash memory, or flash memory, the full name is Flash EEPROM (Electrically Erasable Programmable read only memory, EEPROM), that is, electrified erasable programmable read-only memory, which is a non-volatile memory.
  • Flash EEPROM Electrical Erasable Programmable read only memory
  • the Flash memory is hereinafter referred to as Flash for short.
  • Loader partition and Loader program The partition where Loader program is stored is called Loader partition.
  • the Loader program is a loader program, or is called a Bootloader program, which supports loading and updating functions, and the updating function is implemented by an upgrade module in the Loader program.
  • the Loader program is used to control the normal startup of jumping to the App application, or to control the operation of the programs in the Boot area, such as performing the data flashing operation to the ECU's Flash.
  • the Loader program will be referred to as Loader in the following text.
  • App partition and App program The partition where App programs are stored is called App partition.
  • App is an application program, that is, a program that realizes the functions of the ECU.
  • the App will be referred to as the App for short.
  • 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 boot the App partition or the Loader partition.
  • RAM Random-Access Memory, which is a volatile memory, the original data in RAM will disappear after the ECU restarts.
  • FIG. 1A shows a traditional upgrade solution.
  • this solution only one Boot partition (boot program partition) and one App partition are set in the Flash of the ECU. Temporarily load the Loader into the RAM of the ECU, and after loading, the Loader will flash and update the App partition.
  • the existing technology 1 has the following defects:
  • FIG. 1B shows an improved upgrade solution for the first prior art, which is a dual-App partition upgrade solution.
  • the Flash of the ECU includes a Boot partition and two App partitions (App0 and App1 partitions as shown in Figure 1B), and the two App partitions back up each other, and both have the function of upgrading and updating.
  • App partition is updated , you can use the program of one App partition to upgrade another App partition.
  • the typical process is as follows:
  • App0 downloads the upgrade software, flashes and updates it to the App1 partition, and then modifies the startup flag to correspond to App1, so as to start and run the App1 partition after restarting, App1 will then update the App0
  • the partition is flashed and updated. If the update of the App1 partition fails, continue to maintain the startup flag corresponding to App0, and roll back the update of App1, or refresh the App1 partition again.
  • Fig. 1C shows another improved upgrade solution for prior art one, which is a dual-loader solution: in this solution, the Flash partition of the ECU includes a Boot partition and a dual Loader partition (as shown in Fig. 1C ). Loader0 and Loader1 partitions shown) and an App partition. When flashing and updating the App partition, Loader0 or Loader1 flashes and updates the App partition. In addition, Loader0 and Loader1 can also update each other, and the mutual update is similar to the mutual update of the dual App partitions in the above-mentioned second prior art, which will not be repeated.
  • the third prior art adopts the Loader0 and Loader1 partitions, the two partitions are mutually backup, and there is redundancy. Therefore, the defects described in the second prior art also exist.
  • 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.
  • the Loader is temporarily moved to the App partition, refresh and update the Loader partition to update the Loader, and refresh and update the App partition through the updated Loader to update the Loader partition and the App partition.
  • the backup state of the dual Loader temporarily exists, which can solve the problem of power failure, disconnection, and file errors during the upgrade process mentioned in the prior art.
  • the ECU upgrade scenario of this application can be applied to vehicle ECUs, vehicle-mounted boxes (T-Box), set-top box ECUs, network equipment (such as routers, wireless access points, etc.) ECUs, embedded equipment ECUs, or other consumer terminal electronics. product ECU. It is also suitable for scenarios where the reliability of the upgrade needs to be ensured under the premise of few hardware resources (Flash and RAM) such as general ECU/MCU.
  • Flash and RAM hardware resources
  • the electronic device includes a memory, such as Flash memory or EEPROM, etc.
  • the memory includes a first partition and a second partition
  • the first partition stores a loader (Loader)
  • the A loader (Loader) has an upgrade module
  • the second partition stores an application program (App)
  • the memory further includes a third partition that stores a boot program (Boot).
  • the first, second, and third partitions are also referred to as Loader partitions, App partitions, and Boot partitions hereinafter, according to different stored contents.
  • the electronic device is an electronic control unit ECU.
  • the method for upgrading the electronic device includes the following steps:
  • S210 Start the loader of the first partition, and copy the loader to the second partition to form a backup loader through an upgrade module of the loader of the first partition;
  • this step can be entered by means of the boot program (ie, the Boot program).
  • the boot program ie, the Boot program
  • a specific key or key combination can be pressed to enter the Boot boot process, and when the Boot boot process is entered, the Loader of the first partition can be booted to run.
  • S220 Start the backup loader of the second partition, and update the loader of the first partition by an upgrade module of the backup loader;
  • the update of the loader of the first partition may be implemented by brushing the loader file for updating into the first partition.
  • step S210 the electronic device can be restarted, and after restarting, the step can be entered by means of the bootstrap program.
  • a startup flag can be set corresponding to the second Partition, when restarted, Boot will guide and run the backup Loader of the second partition according to the startup flag.
  • S230 Start the updated loader of the first partition, and update the application program (ie, the App program) of the second partition by an upgrade module of the updated loader.
  • the update of the application program in the second partition may be implemented by brushing the application program file for updating into the second partition.
  • step S220 the electronic device can be restarted, and the step can be entered into this step by means of the bootstrap program after the restart.
  • a startup flag can be set corresponding to the first Partition, after restarting, Boot will run the updated Loader of the first partition according to the startup flag.
  • this method adopts one Loader partition and one App partition, and there is no redundant partition compared to the prior art, thus reducing the consumption of storage resources.
  • the Loader partition is updated through the above steps S210 and S220, since the step of backing up the Loader is set through the step S210, the temporary double backup of the Loader partition during the upgrade process is realized, preventing the Loader or App from being damaged due to abnormality during the upgrade. Upgrade or restore issues, improving reliability during upgrades.
  • the electronic device After this step is completed, the electronic device has completed the update of the application program and the update of the loading program.
  • the updated application program in the second partition is guided to run through the bootstrap program to complete the startup of the electronic device.
  • the startup flag can be set to correspond to the second partition.
  • the updated App of the second partition is booted and run by Boot according to the startup flag.
  • step S210 when an abnormal operation occurs in each of the above steps, the abnormal step is re-executed to solve the abnormal problem.
  • step S210 may also be returned.
  • this embodiment only needs to re-run the abnormal step. Therefore, there is no need to return to the first step, so that the normal steps do not need to be repeated, and the redundancy of the steps is avoided, so the recovery and upgrade process is faster.
  • the above-mentioned update loader file or application file is provided by one of the following ways:
  • a software upgrade server that can be connected to the electronic device through a communication network.
  • the software upgrade server is usually arranged on the network side.
  • the electronic device is connected to the Internet through a wireless communication network, such as through a wireless access point, or through a 5G or 4G network. After the Internet, connect to the software upgrade server on the network side to obtain the corresponding update files;
  • the corresponding update file can be downloaded and stored in the external storage device in advance, and inserted into the corresponding interface of the electronic device to provide the electronic device;
  • a user terminal that is communicatively connected to the electronic device, such as a user mobile phone, PAD, etc., that can be connected wirelessly, such as WIFI or Bluetooth, or a data cable, can be connected to the software upgrade server in communication, and obtained from the software upgrade server. Corresponding update documents are made available to the electronic device.
  • the process of updating the Loader in the Loader partition or the App in the App partition may be performed in a file incremental update manner.
  • the Flash allocated to the ECU includes at least the following partitions:
  • the Boot partition has a boot program, which is referred to as Boot for short.
  • the boot program can determine whether to start the App or the upgrade program of the Loader partition according to certain conditions, such as a certain flag or whether the App starts normally.
  • certain conditions such as a certain flag or whether the App starts normally.
  • the boot program should be as simple and stable as possible, and the Boot partition usually does not need to be updated.
  • the Loader partition in which the software upgrade program is deployed, and the software upgrade program is referred to as Loader for short, can support the download and refresh of data in each partition in the Flash.
  • App partition which has application App.
  • partitions may include partitions for storing parameters, etc. In order to ensure the integrity of these parameters before and after the ECU update, these partitions do not need to be updated during the ECU update process.
  • the Loader in the Loader partition is called Loader0
  • the backup Loader in the App partition is called Loader1.
  • S320 Start Loader1 in the App partition.
  • the Loader1 can be started through the Boot boot. For example, before switching, set the Loader's startup flag to the currently not running Loader, so that after the Boot restarts, another Loader will be started.
  • S330 Download the Loader file package of the new version from the software upgrade server through the upgrade module in Loader1, and flash the Loader file package of the new version to the Loader partition. If an exception occurs during the flashing process, restart the current Loader1 after the next Boot startup, and continue or perform this step again.
  • step S340 After flashing the Loader partition, start Loader0 in the Loader partition. At this time, Loader0 has been updated. For the method of starting Loader0, reference may be made to the description in step S320, and details are not repeated here.
  • S350 Use the upgrade module in Loader0 to flash and update the App partition, including downloading the App file package from the software upgrade server, and flash the App partition accordingly. If the flashing process is abnormal, after the next Boot startup, restart the current Loader0, and continue or perform this step again.
  • the corresponding file package may also be acquired from a peripheral device connected through an interface, such as an external memory connected through a USB interface that stores the above-mentioned file package.
  • the corresponding file package may also be obtained from a wirelessly connected terminal, such as a mobile phone or a PAD connected in a short distance through Bluetooth, WIFI, or the like.
  • the file package described here may only involve the incremental part that needs to be updated.
  • the present application also provides a corresponding embodiment of a device for upgrading electronic equipment.
  • a device for upgrading electronic equipment For the beneficial effects or technical problems solved by the device, reference may be made to the description in the method corresponding to each device, or Refer to the descriptions in the Summary of the Invention, which will not be repeated here.
  • 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, the The second partition stores application programs; the device includes:
  • the first copying module 410 is used to start the loading program of the first partition, and the upgrade module of the loading program copies the loading program to the second partition to form a backup loading program;
  • a first update module 420 configured to start a backup loader of the second partition, and update the loader of the first partition by an upgrade module of the backup loader;
  • the second update module 430 is configured to start the updated loader of the first partition, and update the application program of the second partition by the update module of the updated loader.
  • the updating of the loader of the first partition of the first update module 420 includes writing a loader file for updating into the first partition; the update of the second update module 430
  • the application program of the second partition includes writing the application file for updating into the second partition.
  • the update loader file or application file is provided by one of the following devices: a software update server, an external storage device interfaced with the electronic device, or a user communicatively connected to the electronic device terminal.
  • a booting module 440 is further included, for starting the loader of the first partition, starting the loader of the backup of the second partition, or starting the updated loader of the first partition, It is realized by booting by the boot module after starting or restarting the electronic device.
  • the module when each module runs abnormally, the module is re-run.
  • the electronic device is an electronic control unit.
  • FIG. 5 is a schematic structural diagram of a computing device 900 provided by an embodiment of the present application.
  • the computing device 900 includes: a processor 910 , a memory 920 , and a communication interface 930 .
  • the communication interface 930 in the computing device 900 shown in FIG. 5 may be used to communicate with other devices.
  • the processor 910 can be connected with the memory 920 .
  • the memory 920 may be used to store the program codes and data. Therefore, the memory 920 may be a storage unit within the processor 910 , or may be an external storage unit independent of the processor 910 , or may include a storage unit within the processor 910 and an external storage unit independent of the processor 910 . part.
  • computing device 900 may also include a bus.
  • the memory 920 and the communication interface 930 may be connected to the processor 910 through a bus.
  • the bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus or the like.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like.
  • the processor 910 may adopt a central processing unit (central processing unit, CPU).
  • the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), ready-made programmable gate arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGAs ready-made programmable gate arrays
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the processor 910 uses one or more integrated circuits to execute related programs to implement the technical solutions provided by the embodiments of the present application.
  • the memory 920 which may include read-only memory and random access memory, provides instructions and data to the processor 910 .
  • a portion of processor 910 may also include non-volatile random access memory.
  • the processor 910 may also store device type information.
  • the processor 910 executes the computer-executable instructions in the memory 920 to execute the operation steps of the above method.
  • the computing device 900 may correspond to a corresponding subject in executing the methods according to the various embodiments of the present application, and the above-mentioned and other operations and/or functions of each module in the computing device 900 are for the purpose of realizing the present application, respectively.
  • the corresponding processes of each method in the embodiment will not be repeated here.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
  • Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, is used to execute a method for upgrading an electronic device, and the method includes the methods described in the foregoing embodiments. at least one of the options.
  • the computer storage medium of the embodiments of the present application may adopt any combination of one or more computer-readable media.
  • the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium.
  • the computer readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination of the above. More specific examples (a non-exhaustive list) of computer readable storage media include: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), Erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
  • a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a propagated data signal in baseband or as part of a carrier wave, with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • Computer program code for performing the operations of the present application may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, but also conventional Procedural programming language - such as the "C" language or similar programming language.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or wide area network (WAN), or may be connected to an external computer (eg, through the Internet using an Internet service provider) connect).
  • LAN local area network
  • WAN wide area network
  • Internet service provider an external computer

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The present application provides a method for upgrading an electronic device, applicable to upgrading of electronic control units (ECUs), such as upgrading of an ECU of a vehicle. The electronic device comprises a memory, the memory comprises a first partition and a second partition, the first partition stores a loader program, the loader program has an upgrading module, and the second partition stores an application program. The method comprises: starting the loader program of the first partition, and copying the loader program to the second partition by the upgrading module of the loader program to form a backup loader program; starting the backup loader program of the second partition, and updating the loader program of the first partition by an upgrading module of the backup loader program; and starting the updated loader program of the first partition, and updating the application program of the second partition by the upgrading module of the updated loader program. According to the present application, consumption of resources in a memory can be reduced in an upgrading process of the electronic device, and the reliability in the upgrading process is improved by forming a temporary backup loader program.

Description

升级电子设备的方法及装置Method and device for upgrading electronic equipment 技术领域technical field
本发明涉及电子设备升级的技术领域,尤其涉及升级电子设备的方法及装置、计算设备和计算机可读存储介质。The present invention relates to the technical field of electronic equipment upgrading, and in particular, to a method and apparatus for upgrading electronic equipment, a computing device and a computer-readable storage medium.
背景技术Background technique
随着汽车行业的高速发展,尤其是智能网联汽车的快速发展,汽车电子产品在整车中的比重越来越大,相应的,车内电子控制单元(Electronic Control Unit,ECU)越来越多,功能越来越强大。而在ECU的开发及市场应用过程中,常常涉及到针对ECU的应用程序(App)的升级,从而不断修复应用程序中的缺陷或者增加新的功能。With the rapid development of the automotive industry, especially the rapid development of intelligent networked vehicles, the proportion of automotive electronic products in the whole vehicle is increasing. Correspondingly, the electronic control unit (ECU) in the vehicle is becoming more and more More and more functions. In the process of ECU development and market application, the upgrade of the application program (App) for the ECU is often involved, so as to continuously repair the defects in the application program or add new functions.
ECU应用程序的升级过程,涉及到应用程序的传输、存储和生效过程,而ECU的存储资源往往比较少,因此,如何能在ECU升级过程中降低对ECU存储资源的消耗,是本发明所要解决的技术问题。The upgrade process of the ECU application program involves the transmission, storage and validation process of the application program, and the storage resources of the ECU are often relatively small. Therefore, how to reduce the consumption of the ECU storage resources during the ECU upgrade process is to be solved by the present invention. technical issues.
发明内容SUMMARY OF THE INVENTION
鉴于现有技术的以上问题,本申请提供一种升级电子设备的方法及装置、计算设备和计算机可读存储介质,可以实现电子设备升级过程中即提高了升级过程的可靠性,有减少了对存储资源的消耗。In view of the above problems in the prior art, the present application provides a method and device for upgrading electronic equipment, a computing device and a computer-readable storage medium, which can improve the reliability of the upgrading process during the upgrading process of electronic equipment, and reduce the need for Consumption of storage resources.
为达到上述目的,本申请第一方面提供了一种升级电子设备的方法,该电子设备包括存储器,所述存储器包括第一分区和第二分区,所述第一分区存储有加载程序,所述加载程序具有升级模块,所述第二分区存储有应用程序,该方法包括:In order to achieve the above object, a first aspect of the present application provides a method 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 loading program, and the The loader has an upgrade module, the second partition stores application programs, and the method includes:
启动所述第一分区的加载程序,由所述加载程序的升级模块将所述加载程序复制到所述第二分区形成备份的加载程序;Start the loader of the first partition, and copy the loader to the second partition to form a backup loader by the upgrade module of the loader;
启动所述第二分区的备份的加载程序,由所述备份的加载程序的升级模块更新所述第一分区的加载程序;Start the backup loader of the second partition, and update 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 program of the second partition is updated by an upgrade module of the updated loader.
其中,上述电子设备的存储器可为Flash存储器或EEPROM等,存储加载程序(Loader)和应用程序(App)的存储器的第一分区和第二分区也可称为Loader分区、App分区。该方法采用了一个Loader分区和一个App分区,相对于现有技术来说不存在冗余的分区,因此减少了对存储资源的消耗。并且,Loader分区在进行自更新的时候,由于设置了备份Loader的步骤,实现了升级过程中的Loader分区的临时双备份,防止升级时异常导致Loader或App损坏无法继续升级或恢复的问题,提高了升级过程中的可靠性。The memory of the electronic device may be Flash memory or EEPROM, etc., and the first partition and the second partition of the memory storing the loader (Loader) and the application program (App) may also be referred to as the Loader partition and the App partition. The method adopts a Loader partition and an App partition, and compared with the prior art, there is no redundant partition, thus reducing the consumption of storage resources. In addition, when the Loader partition is self-updating, the step of backing up the Loader is set, which realizes the temporary double backup of the Loader partition during the upgrade process, preventing the problem that the Loader or App is damaged and the upgrade or recovery cannot be continued due to abnormal upgrades. reliability during the upgrade process.
作为第一方面的一种可能的实现方式,所述更新所述第一分区的加载程序包括将更新用的加载程序文件刷写入所述第一分区;和/或As a possible implementation manner of the first aspect, the updating the loader of the first partition includes writing a loader file for updating into the first partition; and/or
所述更新所述第二分区的应用程序包括将更新用的应用程序文件刷写入所述第二分区。。The updating the application program of the second partition includes writing the application program file for updating into the second partition. .
由上为更新的一种实现方式,即通过将相应文件直接刷写到分区的方式。The above is an implementation method of updating, that is, by directly flashing the corresponding files to the partition.
作为第一方面的一种可能的实现方式,所述更新用的加载程序文件或应用程序文件由下述之一设备提供:As a possible implementation manner of the first aspect, the loader file or application file for the update is provided by one of the following devices:
可与所述电子设备通信连接的软件升级服务器、可与所述电子设备接口连接的外部存储装置、或可与所述电子设备通信连接的用户终端。A software upgrade server that can be connected in communication with the electronic device, an external storage device that can be interfaced with the electronic device, or a user terminal that can be connected in communication with the electronic device.
由上,升级过程中获取相应升级文件的方式可以根据场景灵活选择,该场景可以为:电子设备是否能直接接入互联网、是否能连接USB存储介质等外部存储介质、是否能通过近距离通讯连接用户终端等。根据不同的场景灵活选择获取升级文件的方式。From the above, the way to obtain the corresponding upgrade file during the upgrade process can be flexibly selected according to the scenario. The scenario can be: whether the electronic device can directly access the Internet, whether it can connect to external storage media such as USB storage media, and whether it can be connected through short-range communication. user terminal, etc. You can flexibly choose the way to obtain the upgrade file according to different scenarios.
作为第一方面的一种可能的实现方式,所述存储器还包括第三分区,存储有引导程序;As a possible implementation manner of the first aspect, the memory further includes a third partition storing a boot program;
所述启动所述第一分区的加载程序、启动所述第二分区的备份的加载程序、或启动所述第一分区更新后的加载程序,是通过启动或重启所述电子设备后由所述引导程序引导的方式实现。Said starting the loader of the first partition, starting the loader of the backup of the second partition, or starting the updated loader of the first partition by starting or restarting the electronic device by the It is implemented in the way of bootstrap.
其中,存储引导程序(Boot)的存储器的第三分区也可称为Boot分区,可以在升级中各个步骤执行完毕后设置相应分区的启动标志位,当重启后由Boot根据启动标志位引导运行相应分区的启动。Among them, the third partition of the memory storing the boot program (Boot) may also be called the Boot partition, and the startup flag of the corresponding partition can be set after each step in the upgrade is completed. Partition startup.
作为第一方面的一种可能的实现方式,当下述之一的步骤中出现运行异常的步骤时,重新运行该步骤:As a possible implementation manner of the first aspect, when an abnormal operation occurs in one of the following steps, the step is re-run:
启动所述第一分区的加载程序,由所述加载程序的升级模块将所述加载程序复制到所述第二分区形成备份的加载程序的步骤;Steps of starting the loading program of the first partition, and copying the loading program to the second partition by the upgrade module of the loading program to form a backup loading program;
启动所述第二分区的备份的加载程序,由所述备份的加载程序的升级模块更新所述第一分区的加载程序的步骤;A step of starting the backup loader of the second partition, and updating the loader of the first partition by an upgrade module of the backup loader;
启动所述第一分区更新后的加载程序,由所述更新后的加载程序的升级模块更新所述第二分区的应用程序的步骤。The step of starting the updated loader of the first partition, and updating the application program of the second partition by an upgrade module of the updated loader.
由上,通过重新运行出现异常的步骤,可以解决该步骤的异常问题,而无需返回升级过程中的第一步骤,从而无需重复正常的步骤,避免了步骤的冗余,恢复升级的速度更快。From the above, by re-running the abnormal step, the abnormal problem of this step can be solved without returning to the first step in the upgrade process, so that the normal steps do not need to be repeated, the redundancy of steps is avoided, and the recovery and upgrade speed is faster. .
作为第一方面的一种可能的实现方式,所述电子设备为电子控制单元。As a possible implementation manner of the first aspect, the electronic device is an electronic control unit.
由上,本申请可应用于电子控制单元,进而可进一步应用于装配该电子控制单元的设备,这些设备如车辆、车载盒(T-Box)、机顶盒、网络设备(如路由器、无线接入点等)、嵌入式设备,或其他消费终端类电子产品等。From the above, the present application can be applied to an electronic control unit, and further can be applied to equipment equipped with the electronic control unit, such as a vehicle, a vehicle-mounted box (T-Box), a set-top box, a network device (such as a router, a wireless access point) etc.), embedded devices, or other consumer terminal electronic products, etc.
本申请第二方面提供了一种升级电子设备的装置,该电子设备包括存储器,所述存储器包括第一分区和第二分区,所述第一分区存储有加载程序,所述加载程序具有升级模块,所述第二分区存储有应用程序;该装置包括:A second aspect of the present application provides an 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, and the loader has an upgrade module , the second partition stores application programs; the device includes:
第一复制模块,用于启动所述第一分区的加载程序,由所述加载程序的升级模块将所述加载程序复制到所述第二分区形成备份的加载程序;a first copying module, used for starting the loading program of the first sub-region, and the upgrading module of the loading program copies the loading program to the second sub-region to form a backup loading program;
第一更新模块,用于启动所述第二分区的备份的加载程序,由所述备份的加载程序的升级模块更新所述第一分区的加载程序;a first update module, configured to start a backup loader of the second partition, and update the loader of the first partition by an upgrade module of the backup loader;
第二更新模块,用于启动所述第一分区更新后的加载程序,由所述更新后的加载程序的升级模块更新所述第二分区的应用程序。The second update module is used for starting the updated loader of the first partition, and the application program of the second partition is updated by the update module of the updated loader.
作为第二方面的一种可能的实现方式,所述第一更新模块的所述更新所述第一分区的加载程序包括将更新用的加载程序文件刷写入所述第一分区;和/或As a possible implementation manner of the second aspect, the updating the loader of the first partition of the first update module includes writing a loader file for updating into the first partition; and/or
所述第二更新模块的所述更新所述第二分区的应用程序包括将更新用的应用程序文件刷写入所述第二分区。The updating of the application program of the second partition of the second update module includes writing an application program file for updating into the second partition.
作为第二方面的一种可能的实现方式,所述更新用的加载程序文件或应用程序文件由下述之一设备提供:As a possible implementation manner of the second aspect, the update loader file or application file is provided by one of the following devices:
可与所述电子设备通信连接的软件升级服务器、可与所述电子设备接口连接的外部存储装置、或可与所述电子设备通信连接的用户终端。A software upgrade server that can be connected in communication with the electronic device, an external storage device that can be interfaced with the electronic device, or a user terminal that can be connected in communication with the electronic device.
作为第二方面的一种可能的实现方式,还包括引导模块,所述启动所述第一分区的加载程序、启动所述第二分区的备份的加载程序、或启动所述第一分区更新后的加载程序,是通过启动或重启所述电子设备后由所述引导模块引导的方式实现。As a possible implementation manner of the second aspect, the method further includes a booting module for starting the loader of the first partition, starting the loader of the backup of the second partition, or starting the updated first partition. The loader is implemented by starting or restarting the electronic device and being guided by the boot module.
作为第二方面的一种可能的实现方式,当各个所述模块之一出现运行异常时,重新运行该模块。As a possible implementation manner of the second aspect, when one of the modules runs abnormally, the module is re-run.
作为第二方面的一种可能的实现方式,所述电子设备为电子控制单元。As a possible implementation manner of the second aspect, the electronic device is an electronic control unit.
本申请第三方面提供了一种计算设备,包括:A third aspect of the present application provides a computing device, including:
通信接口;Communication Interface;
至少一个处理器,其与所述通信接口连接;以及at least one processor connected to the communication interface; and
至少一个存储器,其与所述处理器连接并存储有程序指令,所述程序指令当被所述至少一个处理器执行时使得所述至少一个处理器执行上述第一方面任一所述的方法。At least one memory connected to the processor and storing program instructions, the program instructions, when executed by the at least one processor, cause the at least one processor to perform the method of any one of the first aspects above.
本申请第四方面提供了一种计算机可读存储介质,其上存储有程序指令,所述程序指令当被计算机执行时使得所述计算机执行上述第一方面任一所述的方法。A fourth aspect of the present application provides a computer-readable storage medium on which program instructions are stored, the program instructions, when executed by a computer, cause the computer to perform any of the methods described in the first aspect above.
综上所述,本申请技术方案在升级电子设备时,采用了单一的Loader分区和App分区,降低冗余度,不存在功能冗余,降低了对存储资源的消耗,且通过构建临时的双Loader,提高了升级过程中的可靠性,满足了电子设备对升级的要求,例如该要求为:支持App和Loader的更新;降低升级异常导致ECU软件损坏,即要求可靠性;节省存储空间。尤其适用于的场景包括:Flash存储资源比较紧张,分区划分需要减少冗余的情况;或RAM资源比较紧张,Loader程序不能存放在内存的情况;或需要考虑升级异常,不能因为异常导致App损坏无法恢复的情况。To sum up, the technical solution of the present application adopts a single Loader partition and App partition when upgrading electronic equipment, which reduces redundancy, does not exist functional redundancy, and reduces the consumption of storage resources. Loader improves the reliability during the upgrade process and meets the upgrade requirements of electronic devices. For example, the requirements are: support for App and Loader updates; reduce ECU software damage caused by upgrade exceptions, which requires reliability; save storage space. Especially suitable scenarios include: Flash storage resources are relatively tight, and partitioning needs to reduce redundancy; or RAM resources are relatively tight, and the Loader program cannot be stored in memory; or upgrade exceptions need to be considered, and the App cannot be damaged due to exceptions. recovery situation.
本发明的这些和其它方面在以下(多个)实施例的描述中会更加简明易懂。These and other aspects of the invention will be more clearly understood in the following description of the embodiment(s).
附图说明Description of drawings
以下参照附图来进一步说明本发明的各个特征和各个特征之间的联系。附图均为示例性的,一些特征并不以实际比例示出,并且一些附图中可能省略了本申请所涉及领域的惯常的且对于本申请非必要的特征,或是额外示出了对于本申请非必要的特征, 附图所示的各个特征的组合并不用以限制本申请。另外,在本说明书全文中,相同的附图标记所指代的内容也是相同的。具体的附图说明如下:The various features of the present invention and the relationships between the various features are further explained below with reference to the accompanying drawings. The drawings are exemplary, some features are not shown to scale, and some of the drawings may omit features that are customary in the field to which the application relates and not essential to the application, or additionally show The non-essential features of the present application, and the combination of individual features shown in the drawings are not intended to limit the present application. In addition, the same reference numerals refer to the same contents throughout the present specification. The specific drawings are described as follows:
图1A为现有技术一的基于单Boot分区和单App分区的ECU升级示意图;1A is a schematic diagram of an ECU upgrade based on a single Boot partition and a single App partition according to the prior art;
图1B为现有技术二的基于双App分区的ECU升级示意图;FIG. 1B is a schematic diagram of an ECU upgrade based on dual App partitions according to the second prior art;
图1C为现有技术三的基于双Loader分区的ECU升级示意图;FIG. 1C is a schematic diagram of an ECU upgrade based on dual Loader partitions in the prior art three;
图2为本申请提供的升级电子设备的方法的一实施例的示意图;2 is a schematic diagram of an embodiment of a method for upgrading an electronic device provided by the present application;
图3A为本申请提供的升级电子设备的方法的一具体实施方式中的Flash的分区示意图;3A is a schematic diagram of a partition of Flash in a specific embodiment of the method for upgrading an electronic device provided by the application;
图3B为本申请提供的升级电子设备的方法的一具体实施方式的流程图;3B is a flowchart of a specific implementation manner of a method for upgrading an electronic device provided by the present application;
图3C为图3B示出的第一具体实施方式中各分区升级的示意图;3C is a schematic diagram of each partition upgrade in the first embodiment shown in FIG. 3B;
图4为本申请提供的升级电子设备的装置一实施例的示意图;4 is a schematic diagram of an embodiment of an apparatus for upgrading electronic equipment provided by the present application;
图5为本申请计算设备的示意图。FIG. 5 is a schematic diagram of a computing device of the present application.
具体实施方式Detailed ways
说明书和权利要求书中的词语“第一、第二、第三等”或模块A、模块B、模块C等类似用语,仅用于区别类似的对象,不代表针对对象的特定排序,可以理解地,在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。The words "first, second, third, etc." in the description and claims, or similar terms such as module A, module B, module C, etc., are only used to distinguish similar objects, and do not represent a specific ordering of objects, which can be understood Indeed, where permitted, the specific order or sequence may be interchanged to enable the embodiments of the application described herein to be practiced in sequences other than those illustrated or described herein.
在以下的描述中,所涉及的表示步骤的标号,如S110、S120……等,并不表示一定会按此步骤执行,在允许的情况下可以互换前后步骤的顺序,或同时执行。In the following description, the reference numerals representing steps, such as S110, S120, etc., do not necessarily mean that this step will be performed, and the order of the preceding and following steps may be interchanged or performed simultaneously if permitted.
说明书和权利要求书中使用的术语“包括”不应解释为限制于其后列出的内容;它不排除其它的元件或步骤。因此,其应当诠释为指定所提到的所述特征、整体、步骤或部件的存在,但并不排除存在或添加一个或更多其它特征、整体、步骤或部件及其组群。因此,表述“包括装置A和B的设备”不应局限为仅由部件A和B组成的设备。The term "comprising" used in the description and claims should not be interpreted as being limited to what is listed thereafter; it does not exclude other elements or steps. Accordingly, it should be interpreted as specifying the presence of said features, integers, steps or components mentioned, but not excluding the presence or addition of one or more other features, integers, steps or components and groups thereof. Therefore, the expression "apparatus comprising means A and B" should not be limited to apparatuses consisting of parts A and B only.
本说明书中提到的“一个实施例”或“实施例”意味着与该实施例结合描述的特定特征、结构或特性包括在本发明的至少一个实施例中。因此,在本说明书各处出现的用语“在一个实施例中”或“在实施例中”并不一定都指同一实施例,但可以指同一实施例。此外,在一个或多个实施例中,能够以任何适当的方式组合各特定特征、结构或特性,如从本公开对本领域的普通技术人员显而易见的那样。Reference in this specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the terms "in one embodiment" or "in an embodiment" in various places in this specification are not necessarily all referring to the same embodiment, but can refer to the same embodiment. Furthermore, the particular features, structures or characteristics can be combined in any suitable manner, as would be apparent to one of ordinary skill in the art from this disclosure, in one or more embodiments.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。如有不一致,以本说明书中所说明的含义或者根据本说明书中记载的内容得出的含义为准。另外,本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。为了准确地对本申请中的技术内容进行叙述,以及为了准确地理解本发明,在对具体实施方式进行说明之前先对本说明书中所使用的术语给出如下的解释说明或定义:Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. If there is any inconsistency, the meaning described in this specification or the meaning derived from the content described in this specification shall prevail. In addition, the terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application. In order to accurately describe the technical content in this application, and in order to accurately understand the present invention, the following explanations or definitions are given to the terms used in this specification before the specific embodiments are described:
1)电子控制单元(Electronic Control Unit,ECU):由微处理器(MCU)、存储有应用程序的Flash存储器、用于程序运行的RAM、输入/输出接口(I/O)等集成电路组成。应用车辆中时,又称行车电脑或车载电脑。1) Electronic Control Unit (ECU): It is composed of a microprocessor (MCU), a Flash memory storing application programs, a RAM for program running, and an input/output interface (I/O) and other integrated circuits. When used in a vehicle, it is also called a trip computer or an on-board computer.
2)ECU数据刷写:又称为ECU数据灌装,用于实现ECU的Flash存储器内的 应用程序的更新。2) ECU data flashing: Also known as ECU data filling, it is used to update the application program in the Flash memory of the ECU.
3)Flash存储器:又称为闪存,或快闪存储器,全称是Flash EEPROM(Electrically Erasable Programmable read only memory,EEPROM),即带电可擦可编程只读存储器,是一种非易失性存储器。后文将Flash存储器简称为Flash。3) Flash memory: also known as flash memory, or flash memory, the full name is Flash EEPROM (Electrically Erasable Programmable read only memory, EEPROM), that is, electrified erasable programmable read-only memory, which is a non-volatile memory. The Flash memory is hereinafter referred to as Flash for short.
4)Loader分区与Loader程序:存储Loader程序的分区称为Loader分区。Loader程序为加载程序,或称作Bootloader程序,其支持加载和更新功能,所述更新功能由Loader程序内的升级模块实现。在ECU上电启动过程中通过该Loader程序控制跳转到App应用程序的正常启动,或控制运行Boot区里的程序,如执行对ECU的Flash的数据刷写操作。后文将Loader程序简称为Loader。4) Loader partition and Loader program: The partition where Loader program is stored is called Loader partition. The Loader program is a loader program, or is called a Bootloader program, which supports loading and updating functions, and the updating function is implemented by an upgrade module in the Loader program. During the ECU power-on and startup process, the Loader program is used to control the normal startup of jumping to the App application, or to control the operation of the programs in the Boot area, such as performing the data flashing operation to the ECU's Flash. The Loader program will be referred to as Loader in the following text.
5)App分区与App程序:存储App程序的分区称为App分区。App为应用程序,即实现了ECU的功能的程序。后文将App应用程序简称为App。5) App partition and App program: The partition where App programs are stored is called App partition. App is an application program, that is, a program that realizes the functions of the ECU. Hereinafter, the App will be referred to as the App for short.
6)Boot分区与Boot程序:存储Boot程序的分区称为Boot分区。Boot程序是引导程序,用于引导启动App分区还是Loader分区。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 boot the App partition or the Loader partition.
7)RAM:随机存储器(Random-Access Memory),属于易失性存储器,ECU重启后RAM中的原数据将消失。7) RAM: Random-Access Memory, which is a volatile memory, the original data in RAM will disappear after the ECU restarts.
下面先对现有的方法进行介绍,然后再对本申请的技术方案进行详细介绍。The existing methods are first introduced below, and then the technical solutions of the present application are introduced in detail.
现有技术一:如图1A示出了传统的升级方案,该方案中,ECU的Flash中只设置有一个Boot分区(引导程序分区)和一个App分区,为了能够更新App分区,需要在升级时临时加载Loader到ECU的RAM中,并在加载完之后,由Loader对App分区进行刷写更新。Prior art 1: Figure 1A shows a traditional upgrade solution. In this solution, only one Boot partition (boot program partition) and one App partition are set in the Flash of the ECU. Temporarily load the Loader into the RAM of the ECU, and after loading, the Loader will flash and update the App partition.
现有技术一存在着以下的缺陷:The existing technology 1 has the following defects:
1)App升级过程中,当App分区被刷写擦除过程中,出现升级异常时,如数据传输错误、断电等场景,此时新的App尚未刷写成功,导致ECU的Flash中只有Boot区的程序可以运行,这种情况将直接导致ECU升级失败,无法正常执行应用功能。由于App分区的App被擦除损坏,且ECU重启后RAM中的Loader将消失,将导致ECU无法继续启动,只能返厂维修;1) During the App upgrade process, when the App partition is being flashed and erased, and an upgrade exception occurs, such as data transmission error, power failure, etc., the new App has not been flashed successfully at this time, resulting in only Boot in the ECU Flash. The program in the area can be run, which will directly lead to the failure of the ECU upgrade, and the application function cannot be executed 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 cannot continue to be started, and it can only be returned to the factory for repair;
2)ECU的RAM资源有限,导致了对Loader大小有限制,如果Loader比较大,会导致无法加载到RAM中。由于限制了Loader本身代码量的大小,进而对于由于Loader功能的完善、改进导致的代码量的增加都有限制性。2) The RAM resources of the ECU are limited, which limits the size of the Loader. If the Loader is relatively large, it will not be able to be loaded into the RAM. Since the code size of the Loader itself is limited, there are restrictions on the increase of the code size due to the improvement and improvement of the Loader function.
现有技术二:如图1B示出了针对现有技术一的一种改进的升级方案,为双App分区升级方案。该方案中,ECU的Flash包含一个Boot分区和两个App分区(如图1B示出的App0和App1分区),两个App分区互为备份,且均有升级更新的功能,在App分区更新时,可以使用其中的一个App分区的程序升级另外一个App分区,其典型过程如下:The second prior art: FIG. 1B shows an improved upgrade solution for the first prior art, which is a dual-App partition upgrade solution. In this solution, the Flash of the ECU includes a Boot partition and two App partitions (App0 and App1 partitions as shown in Figure 1B), and the two App partitions back up each other, and both have the function of upgrading and updating. When the App partition is updated , you can use the program of one App partition to upgrade another App partition. The typical process is as follows:
首先需要通过一启动标志位标识当前激活的App分区,如果启动标志位对应App0,则App0分区为激活的分区,当前启动运行App0分区;First, it is necessary to identify the currently activated App partition by a startup flag bit. If the startup flag bit corresponds to App0, then the App0 partition is the activated partition, and the App0 partition is currently activated;
当App0分区处于运行状态下,执行App分区更新时,由App0下载升级软件,并刷写更新到App1分区,然后修改启动标志对应为App1,以在重启后启动运行App1 分区,由App1再对App0分区进行刷写更新。如果App1分区更新失败,则继续维持启动标志对应为App0,并可回退App1的更新,或重新对App1分区进行刷写更新。When the App0 partition is running and the App partition update is performed, App0 downloads the upgrade software, flashes and updates it to the App1 partition, and then modifies the startup flag to correspond to App1, so as to start and run the App1 partition after restarting, App1 will then update the App0 The partition is flashed and updated. If the update of the App1 partition fails, continue to maintain the startup flag corresponding to App0, and roll back the update of App1, or refresh the App1 partition again.
由于现有技术二采用App0分区和App1分区互为备份,存在着较大冗余,因此导致Flash存储利用率偏低,尤其对于存储空间较小的车载ECU,在集成日益复杂的功能需求时Flash存储空间尤为紧张的情况下,这种方式加剧了空间紧张、甚至导致空间不足的情况。Because the existing technology 2 uses the App0 partition and the App1 partition as backups for each other, there is a large redundancy, so the utilization rate of Flash storage is low, especially for vehicle ECUs with small storage space, when integrating increasingly complex functional requirements, Flash When storage space is particularly tight, this approach exacerbates space constraints and even leads to space shortages.
现有技术三:如图1C示出了针对现有技术一的另一种改进的升级方案,为双loader方案:该方案中,ECU的Flash分区包括一Boot分区、双Loader分区(如图1C示出的Loader0和Loader1分区)和一App分区。当进行App分区刷写更新时,由Loader0或Loader1对App分区进行刷写更新。并且,还可以由Loader0与Loader1互相更新,该互相更新类似上述现有技术二中的双App分区的互相更新,不再赘述。Prior art three: Fig. 1C shows another improved upgrade solution for prior art one, which is a dual-loader solution: in this solution, the Flash partition of the ECU includes a Boot partition and a dual Loader partition (as shown in Fig. 1C ). Loader0 and Loader1 partitions shown) and an App partition. When flashing and updating the App partition, Loader0 or Loader1 flashes and updates the App partition. In addition, Loader0 and Loader1 can also update each other, and the mutual update is similar to the mutual update of the dual App partitions in the above-mentioned second prior art, which will not be repeated.
由于现有技术三采用了Loader0和Loader1分区,该两分区互为备份,存在冗余,故,同样存在现有技术二所述的缺陷。Since the third prior art adopts the Loader0 and Loader1 partitions, the two partitions are mutually backup, and there is redundancy. Therefore, the defects described in the second prior art also exist.
基于上述现有技术所存在的技术问题,本申请提供了一种升级电子设备的方法,本申请将电子设备的存储器(如Flash)内设置一Boot分区、一Loader分区、一App分区,通过将Loader临时搬移到App分区后,去刷写更新Loader分区,实现对Loader的更新,并通过更新后的Loader对App分区进行刷写更新,实现Loader分区与App分区的更新。由于Loader搬移到App分区之后,刷写更新Loader分区之前,临时存在双Loader的备份状态,能够解决现有技术一提到的升级过程中出现的掉电、断线、文件错误等导致刷写后ECU异常无法继续的问题,并且,相对现有技术二和三,App分区和Loader分区为单分区,不存在冗余,能够节省存储资源。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. After the Loader is temporarily moved to the App partition, refresh and update the Loader partition to update the Loader, and refresh and update the App partition through the updated Loader to update the Loader partition and the App partition. After the Loader is moved to the App partition, and before the Loader partition is refreshed and updated, the backup state of the dual Loader temporarily exists, which can solve the problem of power failure, disconnection, and file errors during the upgrade process mentioned in the prior art. The problem that the ECU cannot be continued abnormally, and, compared with the existing technologies 2 and 3, the App partition and the Loader partition are single partitions, there is no redundancy, and storage resources can be saved.
本申请ECU的升级场景,可应用于车辆ECU,车载盒(T-Box)、机顶盒ECU、网络设备(如路由器、无线接入点等)ECU、嵌入式设备的ECU,或其他消费终端类电子产品的ECU。同样适用于通用的ECU/MCU等硬件资源(Flash和RAM)少的前提下需要保证升级的可靠性的场景。The ECU upgrade scenario of this application can be applied to vehicle ECUs, vehicle-mounted boxes (T-Box), set-top box ECUs, network equipment (such as routers, wireless access points, etc.) ECUs, embedded equipment ECUs, or other consumer terminal electronics. product ECU. It is also suitable for scenarios where the reliability of the upgrade needs to be ensured under the premise of few hardware resources (Flash and RAM) such as general ECU/MCU.
【升级电子设备的方法的第一实施例】[The first embodiment of a method for upgrading an electronic device]
下面参照图2示出的流程图,对本申请升级电子设备的方法第一实施例进行介绍。其中,该第一实施例中,电子设备包括一存储器,例如可为Flash存储器或EEPROM等,该存储器包括第一分区和第二分区,所述第一分区存储有加载程序(Loader),所述加载程序(Loader)具有升级模块,所述第二分区存储有应用程序(App),在一些实施例中,所述存储器还包括第三分区,存储引导程序(Boot)。其中,根据存储的内容的不同,第一、二、三分区在后文也称为Loader分区、App分区和Boot分区。Referring to the flowchart shown in FIG. 2 , the following describes the first embodiment of the method for upgrading an electronic device of the present application. Wherein, in the first embodiment, the electronic device includes a memory, such as Flash memory or EEPROM, etc., the memory includes a first partition and a second partition, the first partition stores a loader (Loader), the A loader (Loader) has an upgrade module, the second partition stores an application program (App), and in some embodiments, the memory further includes a third partition that stores a boot program (Boot). Among them, the first, second, and third partitions are also referred to as Loader partitions, App partitions, and Boot partitions hereinafter, according to different stored contents.
其中,在第一实施例中,所述电子设备为电子控制单元ECU。当对该电子设备进行升级时,如图2所示,该升级电子设备的方法包括下述步骤:Wherein, in the first embodiment, the electronic device is an electronic control unit ECU. When the electronic device is upgraded, as shown in Figure 2, the method for upgrading the electronic device includes the following steps:
S210:启动所述第一分区的加载程序,通过第一分区的加载程序的升级模块,将所述加载程序复制到第二分区形成备份的加载程序;S210: Start the loader of the first partition, and copy the loader to the second partition to form a backup loader through an upgrade module of the loader of the first partition;
在一些实施例中,当电子设备开机或重启后,可通过所述引导程序(即Boot程序)引导的方式进入本步骤。其中,可以在电子设备启动时,按下特定的按键或按键组合,进入Boot引导过程,并在进入Boot引导过程时,引导运行第一分区的Loader。In some embodiments, after the electronic device is powered on or restarted, this step can be entered by means of the boot program (ie, the Boot program). Wherein, when the electronic device is started, a specific key or key combination can be pressed to enter the Boot boot process, and when the Boot boot process is entered, the Loader of the first partition can be booted to run.
S220:启动所述第二分区的备份的加载程序,由所述备份的加载程序的升级模块更新所述第一分区的加载程序;S220: Start the backup loader of the second partition, and update the loader of the first partition by an upgrade module of the backup loader;
其中,可以采用将更新用的加载程序文件刷写入第一分区的方式来实现第一分区的加载程序的更新。Wherein, the update of the loader of the first partition may be implemented by brushing the loader file for updating into the first partition.
在一些实施例中,当执行完步骤S210后,可使电子设备重启,并在重启后通过所述引导程序引导的方式进入本步骤,例如执行完步骤S210后,可设置启动标志位对应第二分区,当重启后由Boot根据启动标志位引导运行第二分区的备份的Loader。In some embodiments, after step S210 is performed, the electronic device can be restarted, and after restarting, the step can be entered by means of the bootstrap program. For example, after step S210 is performed, a startup flag can be set corresponding to the second Partition, when restarted, Boot will guide and run the backup Loader of the second partition according to the startup flag.
S230:启动所述第一分区更新后的加载程序,由所述更新后的加载程序的升级模块更新所述第二分区的应用程序(即App程序)。S230: Start the updated loader of the first partition, and update the application program (ie, the App program) of the second partition by an upgrade module of the updated loader.
其中,可以采用将更新用的应用程序文件刷写入第二分区的方式来实现第二分区的应用程序的更新。Wherein, the update of the application program in the second partition may be implemented by brushing the application program file for updating into the second partition.
在一些实施例中,当执行完步骤S220后,可使电子设备重启,并在重启后通过所述引导程序引导的方式进入本步骤,例如执行完步骤S220后,可设置启动标志位对应第一分区,当重启后由Boot根据启动标志位引导运行第一分区的更新后的Loader。In some embodiments, after step S220 is performed, the electronic device can be restarted, and the step can be entered into this step by means of the bootstrap program after the restart. For example, after step S220 is performed, a startup flag can be set corresponding to the first Partition, after restarting, Boot will run the updated Loader of the first partition according to the startup flag.
由上可以看出,该方法采用了一个Loader分区和一个App分区,相对于现有技术来说不存在冗余的分区,因此减少了对存储资源的消耗。并且,通过上述步骤S210和S220进行Loader分区更新的时候,由于通过步骤S210设置了备份Loader的步骤,实现了升级过程中的Loader分区的临时双备份,防止升级时异常导致Loader或App损坏无法继续升级或恢复的问题,提高了升级过程中的可靠性。It can be seen from the above that this method adopts one Loader partition and one App partition, and there is no redundant partition compared to the prior art, thus reducing the consumption of storage resources. In addition, when the Loader partition is updated through the above steps S210 and S220, since the step of backing up the Loader is set through the step S210, the temporary double backup of the Loader partition during the upgrade process is realized, preventing the Loader or App from being damaged due to abnormality during the upgrade. Upgrade or restore issues, improving reliability during upgrades.
当本步骤执行完毕后,此时电子设备已经完成了应用程序的更新和加载程序的更新。当再次重新启动电子设备后,通过引导程序引导运行第二分区中的更新后的应用程序,完成电子设备的启动,例如执行完步骤S230后,可设置启动标志位对应第二分区,当重启后由Boot根据启动标志位引导运行第二分区的更新后的App。After this step is completed, the electronic device has completed the update of the application program and the update of the loading program. When the electronic device is restarted again, the updated application program in the second partition is guided to run through the bootstrap program to complete the startup of the electronic device. For example, after step S230 is performed, the startup flag can be set to correspond to the second partition. The updated App of the second partition is booted and run by Boot according to the startup flag.
在本实施例中,当上述各个步骤中出现运行异常的步骤时,重新运行出现异常的步骤,以解决异常问题。在其他一些实施例中,无论在哪一步骤出现异常,也可以都返回步骤S210。而本实施例仅需重新运行出现异常的步骤,因此,无需返回第一步骤,从而无需重复正常的步骤,避免了步骤的冗余,因而恢复升级过程速度更快。In this embodiment, when an abnormal operation occurs in each of the above steps, the abnormal step is re-executed to solve the abnormal problem. In some other embodiments, no matter in which step an exception occurs, step S210 may also be returned. However, this embodiment only needs to re-run the abnormal step. Therefore, there is no need to return to the first step, so that the normal steps do not need to be repeated, and the redundancy of the steps is avoided, so the recovery and upgrade process is faster.
在一些实施例中,上述更新用的加载程序文件或应用程序文件由下述之一方式提供:In some embodiments, the above-mentioned update loader file or application file is provided by one of the following ways:
由与电子设备可通过通信网络连接的软件升级服务器提供,该软件升级服务器通常布设在网络侧,电子设备通过无线通信网络,如通过无线接入点接入互联网,或通过5G或4G网络接入互联网后,连接到网络侧的软件升级服务器,获取相应更新用文件;It is provided by a software upgrade server that can be connected to the electronic device through a communication network. The software upgrade server is usually arranged on the network side. The electronic device is connected to the Internet through a wireless communication network, such as through a wireless access point, or through a 5G or 4G network. After the Internet, connect to the software upgrade server on the network side to obtain the corresponding update files;
或者,由与所述电子设备接口连接的外部存储装置提供,例如USB存储介质,可预先将相应的更新用文件下载并存储到该外部存储装置中,插入电子设备对应接口以提供给电子设备;Alternatively, provided by an external storage device connected to the electronic device interface, such as a USB storage medium, the corresponding update file can be downloaded and stored in the external storage device in advance, and inserted into the corresponding interface of the electronic device to provide the electronic device;
或者,由与电子设备通信连接的用户终端,例如可通过无线、如WIFI或蓝牙,或通过数据线连接的用户手机、PAD等,该用户终端可与软件升级服务器通信连接,从软件升级服务器获取相应的更新用文件,并提供给电子设备。Alternatively, a user terminal that is communicatively connected to the electronic device, such as a user mobile phone, PAD, etc., that can be connected wirelessly, such as WIFI or Bluetooth, or a data cable, can be connected to the software upgrade server in communication, and obtained from the software upgrade server. Corresponding update documents are made available to the electronic device.
在一些实施例中,对Loader分区的Loader或App分区的App的更新的过程可以采用文件增量更新的方式进行。In some embodiments, the process of updating the Loader in the Loader partition or the App in the App partition may be performed in a file incremental update manner.
【升级电子设备的方法的第一具体实施方式】[The first specific embodiment of the method for upgrading electronic equipment]
下面,已本申请应用于ECU的具体实施方式为例进行说明,该升级具体是升级该ECU的Flash。该实施例中,如图3A所示分配ECU的Flash至少包括如下分区:Hereinafter, the specific implementation manner in which the present application has been applied to an ECU is taken as an example for description, and the upgrade is specifically to upgrade the Flash of the ECU. In this embodiment, as shown in FIG. 3A, the Flash allocated to the ECU includes at least the following partitions:
Boot分区,其中具有引导程序,将引导程序简称为Boot,引导程序可以根据一定的条件,如某标志位,或App启动是否正常等,判断启动App还是启动Loader分区的升级程序。为了保证ECU可靠性,该引导程序需可尽量简单稳定,Boot分区通常不需更新。The Boot partition has a boot program, which is referred to as Boot for short. The boot program can determine whether to start the App or the upgrade program of the Loader partition according to certain conditions, such as a certain flag or whether the App starts normally. In order to ensure the reliability of the ECU, the boot program should be as simple and stable as possible, and the Boot partition usually does not need to be updated.
Loader分区,其中部署软件升级程序,将软件升级程序简称为Loader,可支持Flash中各分区数据的下载和刷新。The Loader partition, in which the software upgrade program is deployed, and the software upgrade program is referred to as Loader for short, can support the download and refresh of data in each partition in the Flash.
App分区,其中具有应用程序App。App partition, which has application App.
其他(Other)分区,可包括存储参数的分区等,为确保ECU更新前后这些参数的完整性,这些分区在ECU更新过程中不需更新。Other (Other) partitions may include partitions for storing parameters, etc. In order to ensure the integrity of these parameters before and after the ECU update, these partitions do not need to be updated during the ECU update process.
下面,基于上述Flash的分区,参见图3B示出的本申请提供的升级ECU的方法的一具体实施方式的流程图,图3C示出的该具体实施方式中各分区升级的示意图,对该具体实施方式进行说明,该具体实施方式中,以更新Loader分区和App分区为例进行说明,包括以下步骤:Next, based on the partition of the above-mentioned Flash, referring to the flowchart of a specific embodiment of the method for upgrading an ECU provided by the present application shown in FIG. 3B , the schematic diagram of each partition upgrade in the specific embodiment shown in FIG. The embodiment is described. In this specific embodiment, the update of the Loader partition and the App partition is taken as an example to illustrate, including the following steps:
S310:当通过Boot引导启动Loader分区的Loader后,通过Loader中的升级模块将Loader分区数据复制到App分区中,形成备份Loader。此时App分区存储的App将无法正常使用。S310: After booting the Loader of the Loader partition through Boot, copy the Loader partition data 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.
此时如果出现通信中断或者断电异常,下次Boot启动后,重新启动Loader分区的Loader,继续或重新执行本步骤。If the communication is interrupted or the power outage is abnormal, restart the Loader in the Loader partition after the next Boot startup, and continue or perform this step again.
为了描述方面,本实施例中将Loader分区中的Loader称为Loader0,将在App分区中的备份Loader称为Loader1。For the purpose of description, in this embodiment, the Loader in the Loader partition is called Loader0, and the backup Loader in the App partition is called Loader1.
S320:启动App分区中的Loader1。其中,可以通过ECU重启后,通过Boot引导实现Loader1的启动,例如切换前设置Loader的启动标志位为当前未运行的Loader,这样在Boot重启后,会启动另一Loader。S320: Start Loader1 in the App partition. Among them, after the ECU is restarted, the Loader1 can be started through the Boot boot. For example, before switching, set the Loader's startup flag to the currently not running Loader, so that after the Boot restarts, another Loader will be started.
S330:通过Loader1中的升级模块从软件升级服务器下载新版本的Loader文件包,并将新版本Loader文件包刷写到Loader分区。若刷写过程出现异常,下次Boot启动后,重新启动当前的Loader1,并继续或重新执行本步骤。S330: Download the Loader file package of the new version from the software upgrade server through the upgrade module in Loader1, and flash the Loader file package of the new version to the Loader partition. If an exception occurs during the flashing process, restart the current Loader1 after the next Boot startup, and continue or perform this step again.
S340:刷写Loader分区后,启动Loader分区里的Loader0,此时的Loader0已经被更新。启动Loader0的方式可参照步骤S320里的描述,不再赘述。S340: After flashing the Loader partition, start Loader0 in the Loader partition. At this time, Loader0 has been updated. For the method of starting Loader0, reference may be made to the description in step S320, and details are not repeated here.
S350:使用Loader0中的升级模块刷写更新App分区,包括从软件升级服务器下载App文件包,并据此刷写App分区。若刷写过程出现异常,下次Boot启动后,重 新启动当前的Loader0,并继续或重新执行本步骤。S350: Use the upgrade module in Loader0 to flash and update the App partition, including downloading the App file package from the software upgrade server, and flash the App partition accordingly. If the flashing process is abnormal, after the next Boot startup, restart the current Loader0, and continue or perform this step again.
当对App分区刷写结束后,则升级结束,此时Loader分区与App分区都被更新,并当ECU重启后,则通过Boot引导App分区的App的正常启动。When the flashing of the App partition is completed, the upgrade is completed. At this time, both the Loader partition and the App partition are updated, and when the ECU is restarted, the normal startup of the App in the App partition is guided by Boot.
另外需要说明的是,如果是仅针对App分区更新,则可以仅涉及上述步骤S350,不再赘述。另外需要说明的是,上述是以App分区为例进行说明,不难理解,如果存在其他分区,且在不影响该分区数据的情况下,上述S310中的Loader分区数据也可以复制到其他分区实现上述双Loader的过程。In addition, it should be noted that if the update is only for the App partition, only the above step S350 may be involved, and details are not repeated here. In addition, it should be noted that the above description takes the App partition as an example. It is not difficult to understand that if there are other partitions, and the data of the partition is not affected, the Loader partition data in the above S310 can also be copied to other partitions. The process of the above dual Loader.
其中,上述是以升级过程中从软件升级服务器下载所需Loader文件包和App文件包。在一些实施例中,也可以从通过接口连接的外设,如通过USB接口连接的存储有上述文件包的外部存储器中获取相应文件包。在另外一些实施例中,也可以从无线连接的终端,如通过蓝牙、WIFI等近距离连接的手机或PAD中获取相应的文件包。并且,当所述更新采用增量更新的方式时,这里所述的文件包可以仅涉及需要更新的增量部分。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 may also be acquired from a peripheral device connected through an interface, such as an external memory connected through a USB interface that stores the above-mentioned file package. In other embodiments, the corresponding file package may also be obtained from a wirelessly connected terminal, such as a mobile phone or a PAD connected in a short distance through Bluetooth, WIFI, or the like. Moreover, when the update adopts the way of incremental update, the file package described here may only involve the incremental part that needs to be updated.
【本申请升级电子设备的装置的实施例】[Example of the Apparatus for Upgrading Electronic Equipment in the Application]
如图4所示,本申请还提供了相应的一种升级电子设备的装置的实施例,关于该装置的有益效果或解决的技术问题,可以参见与各装置分别对应的方法中的描述,或者参见发明内容中的描述,此处不再一一赘述。As shown in FIG. 4 , the present application also provides a corresponding embodiment of a device for upgrading electronic equipment. For the beneficial effects or technical problems solved by the device, reference may be made to the description in the method corresponding to each device, or Refer to the descriptions in the Summary of the Invention, which will not be repeated here.
在该升级电子设备的装置的实施例中,该电子设备包括存储器,所述存储器包括第一分区和第二分区,所述第一分区存储有加载程序,所述加载程序具有升级模块,所述第二分区存储有应用程序;该装置包括: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, the loader has an upgrade module, the The second partition stores application programs; the device includes:
第一复制模块410,用于启动所述第一分区的加载程序,由所述加载程序的升级模块将所述加载程序复制到所述第二分区形成备份的加载程序;The first copying module 410 is used to start the loading program of the first partition, and the upgrade module of the loading program copies the loading program to the second partition to form a backup loading program;
第一更新模块420,用于启动所述第二分区的备份的加载程序,由所述备份的加载程序的升级模块更新所述第一分区的加载程序;a first update module 420, configured to start a backup loader of the second partition, and update the loader of the first partition by an upgrade module of the backup loader;
第二更新模块430,用于启动所述第一分区更新后的加载程序,由所述更新后的加载程序的升级模块更新所述第二分区的应用程序。The second update module 430 is configured to start the updated loader of the first partition, and update the application program of the second partition by the update module of the updated loader.
在一些实施例中,所述第一更新模块420的所述更新第一分区的加载程序包括将更新用的加载程序文件刷写入第一分区;所述第二更新模块430的所述更新第二分区的应用程序包括将更新用的应用程序文件刷写入第二分区。In some embodiments, the updating of the loader of the first partition of the first update module 420 includes writing a loader file for updating into the first partition; the update of the second update module 430 The application program of the second partition includes writing the application file for updating into the second partition.
在一些实施例中,所述更新用的加载程序文件或应用程序文件由下述之一设备提供:软件升级服务器、与所述电子设备接口连接的外部存储装置、或与电子设备通信连接的用户终端。In some embodiments, the update loader file or application file is provided by one of the following devices: a software update server, an external storage device interfaced with the electronic device, or a user communicatively connected to the electronic device terminal.
在一些实施例中,还包括一引导模块440,所述启动所述第一分区的加载程序、启动所述第二分区的备份的加载程序、或启动所述第一分区更新后的加载程序,是通过启动或重启电子设备后由所述引导模块引导的方式实现。In some embodiments, a booting module 440 is further included, for starting the loader of the first partition, starting the loader of the backup of the second partition, or starting the updated loader of the first partition, It is realized by booting by the boot module after starting or restarting the electronic device.
在一些实施例中,当各个模块出现运行异常时,重新运行该模块。In some embodiments, when each module runs abnormally, the module is re-run.
在一些实施例中,所述电子设备为电子控制单元。In some embodiments, the electronic device is an electronic control unit.
【本申请计算设备的实施例】[Embodiment of the computing device of the present application]
图5是本申请实施例提供的一种计算设备900的结构性示意性图。该计算设备900包括:处理器910、存储器920、通信接口930。FIG. 5 is a schematic structural diagram of a computing device 900 provided by an embodiment of the present application. The computing device 900 includes: a processor 910 , a memory 920 , and a communication interface 930 .
应理解,图5中所示的计算设备900中的通信接口930可以用于与其他设备之间进行通信。It should be understood that the communication interface 930 in the computing device 900 shown in FIG. 5 may be used to communicate with other devices.
其中,该处理器910可以与存储器920连接。该存储器920可以用于存储该程序代码和数据。因此,该存储器920可以是处理器910内部的存储单元,也可以是与处理器910独立的外部存储单元,还可以是包括处理器910内部的存储单元和与处理器910独立的外部存储单元的部件。Wherein, the processor 910 can be connected with the memory 920 . The memory 920 may be used to store the program codes and data. Therefore, the memory 920 may be a storage unit within the processor 910 , or may be an external storage unit independent of the processor 910 , or may include a storage unit within the processor 910 and an external storage unit independent of the processor 910 . part.
可选的,计算设备900还可以包括总线。其中,存储器920、通信接口930可以通过总线与处理器910连接。总线可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。Optionally, computing device 900 may also include a bus. The memory 920 and the communication interface 930 may be connected to the processor 910 through a bus. The bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus or the like. The bus can be divided into an address bus, a data bus, a control bus, and the like.
应理解,在本申请实施例中,该处理器910可以采用中央处理单元(central processing unit,CPU)。该处理器还可以是其它通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(Application specific integrated circuit,ASIC)、现成可编程门矩阵(field programmable gate Array,FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。或者该处理器910采用一个或多个集成电路,用于执行相关程序,以实现本申请实施例所提供的技术方案。It should be understood that, in this embodiment of the present application, the processor 910 may adopt a central processing unit (central processing unit, CPU). The processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), ready-made programmable gate arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. Alternatively, the processor 910 uses one or more integrated circuits to execute related programs to implement the technical solutions provided by the embodiments of the present application.
该存储器920可以包括只读存储器和随机存取存储器,并向处理器910提供指令和数据。处理器910的一部分还可以包括非易失性随机存取存储器。例如,处理器910还可以存储设备类型的信息。The memory 920 , which may include read-only memory and random access memory, provides instructions and data to the processor 910 . A portion of processor 910 may also include non-volatile random access memory. For example, the processor 910 may also store device type information.
在计算设备900运行时,所述处理器910执行所述存储器920中的计算机执行指令执行上述方法的操作步骤。When the computing device 900 is running, the processor 910 executes the computer-executable instructions in the memory 920 to execute the operation steps of the above method.
应理解,根据本申请实施例的计算设备900可以对应于执行根据本申请各实施例的方法中的相应主体,并且计算设备900中的各个模块的上述和其它操作和/或功能分别为了实现本实施例各方法的相应流程,为了简洁,在此不再赘述。It should be understood that the computing device 900 according to an embodiment of the present application may correspond to a corresponding subject in executing the methods according to the various embodiments of the present application, and the above-mentioned and other operations and/or functions of each module in the computing device 900 are for the purpose of realizing the present application, respectively. For the sake of brevity, the corresponding processes of each method in the embodiment will not be repeated here.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize 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. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执 行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。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 alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时用于执行一种升级电子设备的方法,该方法包括上述各个实施例所描述的方案中的至少之一。Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, is used to execute a method for upgrading an electronic device, and the method includes the methods described in the foregoing embodiments. at least one of the options.
本申请实施例的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是,但不限于,电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The computer storage medium of the embodiments of the present application may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination of the above. More specific examples (a non-exhaustive list) of computer readable storage media include: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), Erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer-readable signal medium may include a propagated data signal in baseband or as part of a carrier wave, with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括、但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言或其组合来编写用于执行本申请操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的 软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations of the present application may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, but also conventional Procedural programming language - such as the "C" language or similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or wide area network (WAN), or may be connected to an external computer (eg, through the Internet using an Internet service provider) connect).
注意,上述仅为本申请的较佳实施例及所运用的技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明的构思的情况下,还可以包括更多其他等效实施例,均属于本发明的保护范畴。Note that the above are only the preferred embodiments of the present application and the applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present application has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention, all of which belong to protection scope of the present invention.

Claims (14)

  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, the loader has an upgrade module, the The second partition stores application programs, and the method includes:
    启动所述第一分区的加载程序,由所述加载程序的升级模块将所述加载程序复制到所述第二分区形成备份的加载程序;Start the loader of the first partition, and copy the loader to the second partition to form a backup loader by the upgrade module of the loader;
    启动所述第二分区的备份的加载程序,由所述备份的加载程序的升级模块更新所述第一分区的加载程序;Start the backup loader of the second partition, and update 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 program of the second partition is updated by an upgrade module of the updated loader.
  2. 根据权利要求1所述的方法,其特征在于:The method of claim 1, wherein:
    所述更新所述第一分区的加载程序包括将更新用的加载程序文件刷写入所述第一分区;和/或The updating of the loader of the first partition includes writing a loader file for updating into the first partition; and/or
    所述更新所述第二分区的应用程序包括将更新用的应用程序文件刷写入所述第二分区。The updating the application program of the second partition includes writing the application program file for updating into the second partition.
  3. 根据权利要求2所述的方法,其特征在于,The method of claim 2, wherein:
    所述更新用的加载程序文件或应用程序文件由下述之一设备提供:The updated loader file or application file is provided by one of the following devices:
    可与所述电子设备通信连接的软件升级服务器、可与所述电子设备接口连接的外部存储装置、或可与所述电子设备通信连接的用户终端。A software upgrade server that can be connected in communication with the electronic device, an external storage device that can be interfaced with the electronic device, or a user terminal that can be connected in communication with the electronic device.
  4. 根据权利要求1所述的方法,其特征在于,所述存储器还包括第三分区,存储有引导程序;The method according to claim 1, wherein the memory further comprises a third partition storing a boot program;
    所述启动所述第一分区的加载程序、启动所述第二分区的备份的加载程序、或启动所述第一分区更新后的加载程序,是通过启动或重启所述电子设备后由所述引导程序引导的方式实现。Said starting the loader of the first partition, starting the loader of the backup of the second partition, or starting the updated loader of the first partition by starting or restarting the electronic device by the It is implemented in the way of bootstrap.
  5. 根据权利要求1所述的方法,其特征在于,当下述之一的步骤中出现运行异常的步骤时,重新运行该步骤:The method according to claim 1, characterized in that, when an abnormal operation occurs in one of the following steps, the step is re-run:
    启动所述第一分区的加载程序,由所述加载程序的升级模块将所述加载程序复制到所述第二分区形成备份的加载程序的步骤;Steps of starting the loading program of the first partition, and copying the loading program to the second partition by the upgrade module of the loading program to form a backup loading program;
    启动所述第二分区的备份的加载程序,由所述备份的加载程序的升级模块更新所述第一分区的加载程序的步骤;A step of starting the backup loader of the second partition, and updating the loader of the first partition by an upgrade module of the backup loader;
    启动所述第一分区更新后的加载程序,由所述更新后的加载程序的升级模块更新所述第二分区的应用程序的步骤。The step of starting the updated loader of the first partition, and updating the application program of the second partition by an upgrade module of the updated loader.
  6. 根据权利要求1所述的方法,其特征在于,所述电子设备为电子控制单元。The method of claim 1, wherein the electronic device is an electronic control unit.
  7. 一种升级电子设备的装置,其特征在于,该电子设备包括存储器,所述存储器包括第一分区和第二分区,所述第一分区存储有加载程序,所述加载程序具有升级模块,所述第二分区存储有应用程序;该装置包括:An apparatus 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, the loader has an upgrade module, the The second partition stores application programs; the device includes:
    第一复制模块,用于启动所述第一分区的加载程序,由所述加载程序的升级模块将所述加载程序复制到所述第二分区形成备份的加载程序;a first copying module, used for starting the loading program of the first sub-region, and the upgrading module of the loading program copies the loading program to the second sub-region to form a backup loading program;
    第一更新模块,用于启动所述第二分区的备份的加载程序,由所述备份的加载程序的升级模块更新所述第一分区的加载程序;a first update module, configured to start a backup loader of the second partition, and update the loader of the first partition by an upgrade module of the backup loader;
    第二更新模块,用于启动所述第一分区更新后的加载程序,由所述更新后的加载程序的升级模块更新所述第二分区的应用程序。The second update module is used for starting the updated loader of the first partition, and the application program of the second partition is updated by the update module of the updated loader.
  8. 根据权利要求7所述的装置,其特征在于:The device according to claim 7, wherein:
    所述第一更新模块的所述更新所述第一分区的加载程序包括将更新用的加载程序文件刷写入所述第一分区;和/或The loader of the first update module for updating the first partition includes writing a loader file for updating into the first partition; and/or
    所述第二更新模块的所述更新所述第二分区的应用程序包括将更新用的应用程序文件刷写入所述第二分区。The updating of the application program of the second partition of the second update module includes writing an application program file for updating into the second partition.
  9. 根据权利要求8所述的装置,其特征在于,The device of claim 8, wherein:
    所述更新用的加载程序文件或应用程序文件由下述之一设备提供:The updated loader file or application file is provided by one of the following devices:
    可与所述电子设备通信连接的软件升级服务器、可与所述电子设备接口连接的外部存储装置、或可与所述电子设备通信连接的用户终端。A software upgrade server that can be connected in communication with the electronic device, an external storage device that can be interfaced with the electronic device, or a user terminal that can be connected in communication with the electronic device.
  10. 根据权利要求7所述的装置,其特征在于,还包括引导模块,所述启动所述第一分区的加载程序、启动所述第二分区的备份的加载程序、或启动所述第一分区更新后的加载程序,是通过启动或重启所述电子设备后由所述引导模块引导的方式实现。The apparatus according to claim 7, further comprising a booting module for starting a loader of the first partition, starting a loader of a backup of the second partition, or starting an update of the first partition The latter loading program is realized by the way of booting by the boot module after starting or restarting the electronic device.
  11. 根据权利要求7所述的装置,其特征在于,The device of claim 7, wherein:
    当各个所述模块之一出现运行异常时,重新运行该模块。When one of the modules runs abnormally, the module is re-run.
  12. 根据权利要求7所述的装置,其特征在于,所述电子设备为电子控制单元。The apparatus according to claim 7, wherein the electronic device is an electronic control unit.
  13. 一种计算设备,其特征在于,包括:A computing device, comprising:
    通信接口;Communication Interface;
    至少一个处理器,其与所述通信接口连接;以及at least one processor connected to the communication interface; and
    至少一个存储器,其与所述处理器连接并存储有程序指令,所述程序指令当被所述至少一个处理器执行时使得所述至少一个处理器执行权利要求1-6任一所述的方法。at least one memory connected to the processor and storing program instructions which, when executed by the at least one processor, cause the at least one processor to perform the method of any one of claims 1-6 .
  14. 一种计算机可读存储介质,其上存储有程序指令,其特征在于,所述程序指令当被计算机执行时使得所述计算机执行权利要求1-6任一所述的方法。A computer-readable storage medium having program instructions stored thereon, wherein the program instructions, when executed by a computer, cause the computer to execute the method of any one of claims 1-6.
PCT/CN2022/079081 2021-03-08 2022-03-03 Method and apparatus for upgrading electronic device WO2022188690A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110251116.2 2021-03-08
CN202110251116.2A CN115061713A (en) 2021-03-08 2021-03-08 Method and device for upgrading electronic equipment

Publications (1)

Publication Number Publication Date
WO2022188690A1 true WO2022188690A1 (en) 2022-09-15

Family

ID=83197413

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/079081 WO2022188690A1 (en) 2021-03-08 2022-03-03 Method and apparatus for upgrading electronic device

Country Status (2)

Country Link
CN (1) CN115061713A (en)
WO (1) WO2022188690A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024087234A1 (en) * 2022-10-29 2024-05-02 华为技术有限公司 Method and apparatus for updating software, and intelligent device
WO2024108456A1 (en) * 2022-11-24 2024-05-30 华为技术有限公司 Controller upgrading method, and apparatus
CN117270914B (en) * 2023-11-17 2024-04-16 西安第六镜网络科技有限公司 System upgrading method, device, equipment and medium of terminal equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140136826A1 (en) * 2012-11-13 2014-05-15 Electronics & Telecommunications Research Institute Method and apparatus for updating boot loader
CN106250196A (en) * 2016-08-12 2016-12-21 上海金脉电子科技有限公司 The method updating vehicle-mounted boot loader by CAN communication
CN109857426A (en) * 2018-12-27 2019-06-07 百度在线网络技术(北京)有限公司 Bootloader method for updating program, device, electronic equipment and storage medium
CN110209420A (en) * 2019-08-01 2019-09-06 潍柴动力股份有限公司 A kind of method and device updating bootstrap loader
CN111338661A (en) * 2018-12-03 2020-06-26 厦门雅迅网络股份有限公司 Method for reversely upgrading BOOT of application program and storage medium
CN112181452A (en) * 2020-09-08 2021-01-05 安徽鸿创新能源动力有限公司 Method for updating software of motor controller of electric vehicle

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140136826A1 (en) * 2012-11-13 2014-05-15 Electronics & Telecommunications Research Institute Method and apparatus for updating boot loader
CN106250196A (en) * 2016-08-12 2016-12-21 上海金脉电子科技有限公司 The method updating vehicle-mounted boot loader by CAN communication
CN111338661A (en) * 2018-12-03 2020-06-26 厦门雅迅网络股份有限公司 Method for reversely upgrading BOOT of application program and storage medium
CN109857426A (en) * 2018-12-27 2019-06-07 百度在线网络技术(北京)有限公司 Bootloader method for updating program, device, electronic equipment and storage medium
CN110209420A (en) * 2019-08-01 2019-09-06 潍柴动力股份有限公司 A kind of method and device updating bootstrap loader
CN112181452A (en) * 2020-09-08 2021-01-05 安徽鸿创新能源动力有限公司 Method for updating software of motor controller of electric vehicle

Also Published As

Publication number Publication date
CN115061713A (en) 2022-09-16

Similar Documents

Publication Publication Date Title
WO2022188690A1 (en) Method and apparatus for upgrading electronic device
CN111796856B (en) Differential upgrading method and device, storage medium and computer equipment
US10303459B2 (en) Electronic system with update control mechanism and method of operation thereof
WO2021115477A1 (en) Program upgrade method and apparatus, electronic device and storage medium
US10437580B2 (en) Software updating methods and systems
US20110302572A1 (en) Embedded network device and firmware upgrading method
CN102334100A (en) Program update device, program update method, and information processing device
CN112631625B (en) System upgrading method and device for embedded equipment and embedded equipment
CN110874237A (en) Software upgrading method, device, terminal and readable storage medium
US10642623B1 (en) Preserving firmware settings during firmware updates
CN108897576A (en) A method of the quick start BOOT based on ARM chip
WO2024007800A1 (en) Cloud terminal system upgrade method and apparatus, and cloud terminal and storage medium
CN111913753A (en) Method and system for changing starting mode in cloud migration of windows system
CN110286953B (en) Method and device for starting embedded system, embedded device and storage medium
CN112148339A (en) Dual-core chip and program updating method thereof
CN106933604B (en) System upgrading method and device
US9495146B2 (en) Host and method of upgrading connection manager of dongles
CN114035831B (en) CPLD upgrading method, system and computer readable storage medium
CN111338661A (en) Method for reversely upgrading BOOT of application program and storage medium
CN114546455A (en) MCU software upgrading method and device for double partitions
US20120185686A1 (en) Method, Apparatus and Computer Program for Loading Files During a Boot-Up Process
CN213751050U (en) Dual-core chip
CN117827547B (en) Method and system for recovering touch abnormality of vehicle-mounted display screen, electronic equipment and medium
CN116909609B (en) Software upgrading method and device of vehicle-mounted intelligent equipment and vehicle-mounted intelligent equipment
CN113553085B (en) Method, device, equipment and storage medium for online upgrading of embedded operating system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22766216

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22766216

Country of ref document: EP

Kind code of ref document: A1