CN117785253A - OTA upgrading method, code mirror image loading processing method, system and vehicle - Google Patents

OTA upgrading method, code mirror image loading processing method, system and vehicle Download PDF

Info

Publication number
CN117785253A
CN117785253A CN202311833898.6A CN202311833898A CN117785253A CN 117785253 A CN117785253 A CN 117785253A CN 202311833898 A CN202311833898 A CN 202311833898A CN 117785253 A CN117785253 A CN 117785253A
Authority
CN
China
Prior art keywords
partition
area
upgrade
code
storage
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202311833898.6A
Other languages
Chinese (zh)
Inventor
车龙
莫映功
李志新
吴怀仁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Automobile Group Co Ltd
Original Assignee
Guangzhou Automobile Group Co Ltd
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 Guangzhou Automobile Group Co Ltd filed Critical Guangzhou Automobile Group Co Ltd
Priority to CN202311833898.6A priority Critical patent/CN117785253A/en
Publication of CN117785253A publication Critical patent/CN117785253A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an OTA upgrading method, which comprises the following steps: after entering an OTA upgrade mode, acquiring a system partition for upgrading in Flash, wherein the system partition for upgrading is at least provided with an IPL guide area; acquiring an address management file from the OTA upgrade package, and refreshing the address management file to an IPL guide area; obtaining corresponding latest storage address information of the code area and the data area according to the mirror image storage address information of each software code in the address management file; and acquiring a corresponding software code image from the upgrade package, and refreshing the corresponding software code image to the latest storage address of the code area in sequence. The invention also discloses a corresponding mirror image loading method, a corresponding mirror image loading system and a corresponding vehicle. The invention can dynamically update the Flash layout, manage each image file address of the code region, realize safer failure rollback operation, improve the safety and not limit the upgrading times.

Description

OTA upgrading method, code mirror image loading processing method, system and vehicle
Technical Field
The invention relates to the technical field of vehicle software upgrading by adopting Over-the-Air Technology (OTA), in particular to an OTA upgrading method capable of dynamically adjusting Flash Layout (Layout), a code mirror image loading processing method and system and a vehicle.
Background
Many passenger vehicles on the market are intelligent vehicles, and electronic control units (Electronic Control Unit, ECU) of the passenger vehicles are mostly upgraded by OTA. But OTA is not universal. If the earlier data storage area Layout is not designed, the later data storage area Layout gradually increases with the code amount beyond the Layout (Layout) boundary of the original design. Then during the upgrade, a erasure failure may occur, resulting in an upgrade failure, or a vehicle function being impaired, severely requiring a direct pull-back to the 4S store for processing. Therefore, many ECUs write firmware before leaving the factory, and the Layout (Layout) of the ECU Flash is rarely changed when OTA software is written later.
Fig. 1 is a schematic layout diagram of a system partition related to an ECU Flash in the prior art; in the existing layout, space reservation is respectively carried out on fixed address areas (code areas and data areas) before mass production, but as the later functions are iterated continuously, the code quantity is increased, and early planning is easy to fail; in practical application, after the upgrade is performed for several times (for example, more than 3-5 times), the reserved space is started to be used, and if the update times exceeds a certain number (for example, more than 10 times), the reserved space is basically not used enough; whereas in the prior art, the location of the data area is generally fixed for data security. If the refreshing of the code area is once out of range (beyond the boundaries of the code area and the reserved area in the original layout), the correct data cannot be obtained and the start-up is failed possibly; specifically, if the refresh area exceeds the reserved area and spans the data area, original data is lost, or running problems occur after the system is started, experience caused by the loss of user data is very bad, for example, a user sets a seat position (matched with the height of the individual), after the data is lost, the setting of the data is restored to a default position, so that the user experience is reduced, and meanwhile, the risk that the user needs to maintain due to the refresh failure exists.
In this case, when the iterative development of the code function is performed, a bottleneck is encountered, and when the original design reserved code area is not enough, the previous code needs to be fully optimized to reduce the code space, thus delaying the development period and bringing additional risk of code reconstruction.
In the prior art, the backup of the A/B surface partition of the code area is also performed to realize the rollback operation of the code area, but once the capacity difference of the codes of the new version and the old version is very large, rollback failure is easily caused; however, in the prior art, not all ECUs employ a/B-plane partition backup technology. Particularly, for a data area, since data in a data partition is continuously updated in real time, it is not significant to use an a/B-plane partition backup to switch to another partition (e.g., an a→b partition), and it may not be possible to obtain the latest parameter data of the a partition in real time. Therefore, in the prior art, for the ECU without the backup data area, once the data area is refreshed, it is not known how to recover from which address to which address segment the data area, which reduces the security of the upgrade.
Therefore, in the prior art, the Flash layout of the ECU cannot be dynamically updated in the upgrading process, so that the upgrading times are limited or the safety is reduced.
Disclosure of Invention
The technical problem to be solved by the invention is to provide an OTA upgrading method, a code mirror image loading processing method, a system and a vehicle, wherein in the OTA upgrading process, flash layout can be dynamically updated, each mirror image file address of a code region can be managed, safer failed rollback operation can be realized, safety is improved, and upgrading times are not limited.
In order to solve the above technical problems, as an aspect of the present invention, an OTA upgrading method is provided, which at least includes the following steps: after entering an OTA upgrading mode, acquiring a system partition for upgrading in Flash, wherein the system partition for upgrading is at least provided with a Boot area, an IPL (Internet protocol) guide area, a code area and a data area;
an address management file is obtained from an OTA upgrade package and refreshed to an IPL guide area of the system partition for upgrading, wherein the address management file contains the storage address information of each software code image corresponding to the upgrade;
obtaining corresponding latest storage address information of the code area according to the mirror image storage address information of each software code in the address management file;
and acquiring the corresponding software code image from the upgrade package according to the storage address information of the software code image corresponding to the upgrade, and refreshing the corresponding software code image to the corresponding latest storage address of the code area in sequence.
As another aspect of the present invention, there is also provided an OTA upgrade system, including at least:
the system comprises an upgrade partition obtaining unit, a Flash memory unit and a storage unit, wherein the upgrade partition obtaining unit is used for obtaining a system partition for upgrading in Flash after entering an OTA upgrade mode, and the system partition for upgrading is at least provided with a Boot area, an IPL guide area, a code area and a data area;
the address management file acquisition unit is used for acquiring an address management file from an OTA upgrade package and refreshing the address management file to an IPL guide area of the system partition for upgrading, wherein the address management file contains the image storage address information of each software code corresponding to the upgrading;
a layout updating unit, configured to obtain, according to each software code image storage address information in the address management file, corresponding latest storage address information of the code area;
and the image refreshing processing unit is used for acquiring the corresponding software code image from the upgrade package according to the software code image storage address information corresponding to the upgrade and refreshing the software code image to the latest storage address of the code area in sequence.
As a further aspect of the present invention, there is also provided a code image loading processing method, which at least includes the steps of:
starting a Bootload program of a Boot area of a current active partition, wherein the current active partition is at least provided with the Boot area, an IPL guide area, a code area and a data area, and at least one software code image is prestored in the code area;
loading an IPL guide area of the active partition to obtain an address management file therein, and obtaining storage address information of each software code mirror image in the code area according to the address management file;
and loading and executing each software code image stored in the code area in sequence according to the storage address information of each software code image.
As another aspect of the present invention there is also provided a computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor implements the steps of the method as described above.
As another aspect of the invention, there is also provided a vehicle having a plurality of electronic control units deployed therein, at least some of which employ steps of the method as described above for performing OTA upgrades or code image loading processing operations.
The embodiment of the invention has the following beneficial effects:
the invention provides an OTA upgrading method, a code mirror image loading processing system and a vehicle. By setting the IPL guide area, when the Boot area works, the IPL guide area is loaded first; according to the address management file in the IPL guide area, the address of the mirror image file of each code in the code area is managed, so that the Flash layout can be dynamically updated in the upgrading process, and the mirror image file of each code can be accurately loaded in operation; meanwhile, the position of the data area can be updated; thus, safe upgrading and loading operation can be realized;
by implementing the embodiment of the invention, a brand new upgrade scheme and a dynamic layout update strategy are adopted, and the method is not limited by the layout of the pre-mass production planning any more, so that the resource utilization rate of hardware and the number of later functional iterations can be obviously improved;
when the embodiment of the invention is implemented, the address management file of the IPL guide area is provided with a backup mechanism when rollback is carried out after the refresh failure, so that the version before the refresh can be truly returned to, the loss of the user data area is avoided, and the user experience is improved;
by implementing the embodiment of the invention, since the mirror image file of each code of the code area can be managed in the IPL boot area, the method can be applied to various types or more complex ECUs, and even if the ECUs are complex domain controllers, the types and the number of the firmware code formats can be more easily managed.
Drawings
For a clearer description of embodiments of the invention or of the solutions of the prior art, the drawings that are necessary for the description of the embodiments or of the prior art will be briefly described, it being apparent that the drawings in the description below are only some embodiments of the invention, from which, without inventive faculty, other drawings are obtained, still belonging to the scope of the invention, for a person skilled in the art;
FIG. 1 is a schematic layout diagram of a prior art ECU Flash system partition;
fig. 2 is a schematic flow chart of an embodiment of an OTA upgrading method according to the present invention;
FIG. 3 is a schematic layout diagram of an ECU Flash system partition according to the present invention;
FIG. 4 is a schematic diagram of the code region of FIG. 3;
FIG. 5 is a schematic flow chart of an upgrade failure rollback according to the present invention;
FIG. 6 is a more detailed schematic of the main flow of the method provided by the present invention;
fig. 7 is a schematic flow chart of another embodiment of an OTA upgrading method according to the present invention;
FIG. 8 is a schematic diagram illustrating a main flow of an embodiment of a code image loading processing method according to the present invention;
fig. 9 is a schematic structural diagram of an embodiment of an OTA upgrading system provided by the present invention;
fig. 10 is a schematic diagram of a layout update unit in fig. 9.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings, for the purpose of making the objects, technical solutions and advantages of the present invention more apparent.
Fig. 2 is a schematic diagram illustrating a main flow of an embodiment of an OTA upgrading method according to the present invention; as shown in fig. 3 to 6, in this embodiment, the method at least includes the following steps:
step S10, after entering an OTA upgrade mode, determining one of the two current system partitions in Flash as an upgrade partition, and the other as a backup partition, wherein the upgrade partition is the system partition for upgrade; wherein, the upgrade partition and the backup partition are at least provided with a Boot area, an IPL guide area, a code area and a data area;
referring to fig. 3, a layout diagram of an ECU Flash according to the present invention is shown, in this example, two system partitions, namely, a system partition a and a system partition B, are provided, each of which includes a Boot area, an IPL Boot area, a Code (Code) area, a reserved area of the Code, a data (data) area, and a reserved area of the data. Each system partition can be used for starting the ECU to work, wherein a Bootload program is arranged in the Boot area and used for starting the hierarchical ECU, and the Boot program firstly loads files in the IPL Boot area. The files in the IPL guide area are used for managing a plurality of image files (image. Bin) in the software package to be upgraded, and can also be used for managing the loading sequence of each image file when the ECU is started, so that the code of which area can be written or started can be clearly known, and the error is not easy to occur. Specifically, an address management file (JSON file) is adopted in the IPL boot area to manage the head address and the tail address of the code area, the data area and the reserved area, and the head address and the tail address information of the storage area of each mirror image file in the code area are stored;
the code area is used for storing the image files of the codes, and corresponding storage areas are planned for the image files of the codes in the invention, and it is understood that the storage range of the code area covers the storage areas corresponding to all the software code image storage addresses. As shown in fig. 4, in one example, a code region such as: encryption module HSE, big data area BDC, acceleration loading engine area LLCE, metha area, metha Calib area, switch area, etc.; it will be appreciated that in fig. 4, which is only an example of one code region, in some simple ECUs, there may be only one or two corresponding address regions;
it will be appreciated that the number of software codes per ECU is fixed, so that the order, storage location, name and type of device code image files may be information in the address management file. The storage position of each code image in the code area can be managed by only recording the current layout setting rule into the json file. For example, in one example, the json file contains: HSE.FW is placed between addresses 0x000000FF and 0x0001 FFFF in BIN file format, and switch.FW is stored at addresses 0x00020000 and 0x0002 FFFF in the format of. Ext4; the Penta file is stored in 0x0003 0000 to 0x0003 FFFF in the format of. dlb, and so on.
And the data area is used to store data information generated by the user in use of the corresponding software.
In a specific example, one of the two current system partitions in Flash is determined as an upgrade partition, and the other is determined as a backup partition, and a different method may be adopted, specifically, the step S10 may include:
under one condition, the types of the two current system partitions in Flash are dynamically determined, the active partition before updating is determined as a backup partition, and the inactive partition before updating is determined as an upgrade partition; as shown in fig. 3, in the upgrade, the system partition a is set as an upgrade partition, and the system partition B is set as a backup partition; in the next upgrade, the system partition B is set as an upgrade partition, and the system partition A is set as a backup partition; similarly, alternate switching is performed;
or in another case, determining one fixed system partition in Flash as an upgrade partition, determining the other system partition as a backup partition, and backing up all data in the upgrade partition into the backup partition before performing the upgrade. For example, in each upgrade process, system partition a is fixedly set as an upgrade partition, and system partition B is set as a backup partition, and no further alternate switching is performed; in this case, it is necessary to ensure that all data in the upgrade partition has been backed up into the spare partition before the upgrade is performed; the backup process can be completed at any time from the last successful upgrade to the previous upgrade.
Step S11, an address management file is obtained from an OTA upgrade package and refreshed into an IPL guide area of the upgrade partition, wherein the address management file contains the storage address information of each software code image corresponding to the upgrade;
step S12, corresponding latest storage address information of the code area and the data area is obtained according to the storage address information of each software code mirror image in the address management file;
in a specific example, the step includes:
storing address information according to each software code mirror image updated in the address management file,
determining the latest storage range of the code area, and determining the storage area of each software code image in the code area; the latest storage range of the code area covers the storage areas corresponding to all the software code mirror image storage addresses;
and comparing the latest end address of the code area with the initial address of the data area before adjustment according to the updated storage range of the code area, and determining whether to adjust the storage range of the data area. In a general example, the data area is immediately adjacent to the code area, if the latest end address of the code area exceeds the initial address of the data area before adjustment, it indicates that the latest code area occupies the storage space of the previous data area, and the storage range of the data area needs to be adjusted.
It will be appreciated that this includes:
and determining the latest storage range of the data area after judging that the storage range of the data area needs to be adjusted, and refreshing the content of the data area before adjustment of the system partition for upgrading to the latest storage range of the data area after adjustment. This ensures that the content of the data area is not covered during the upgrade.
And step S13, according to the software code image storage address information corresponding to the current upgrade, acquiring the corresponding software code image from the upgrade package, and refreshing the corresponding software code image to the latest storage address of the code area in sequence.
It can be understood that, because the json file is used to manage the information such as the head address, the tail address, the size, etc. of the upgrade of the plate where each code image file is located, there is a certain probability that the upgrade fails in the upgrade process, and once the upgrade fails, the management address of the old backup data area needs to be adopted, so that the original address is recovered by using the code backed up before, and thus, even if the code gets bigger than the boundary of the previous layout in the upgrade process, the state before the upgrade can be successfully recovered. The refresh recovery scheme can adopt direct switching of old partition, or can adopt copying of codes of backup partition to current running partition.
The method includes: after the OTA upgrade fails, an upgrade rollback operation is performed, which includes:
switching the state of the backup partition to an active partition, and switching the state of the upgrade partition to an inactive partition; or (b)
Acquiring a prior address management file from an IPL guide area of the backup partition, and refreshing the prior address management file to the IPL guide area of the upgrade partition; updating the layout of the code area and the data area of the upgrade partition according to the address management file, acquiring a corresponding software code image from the backup partition according to the software code image storage address information, and refreshing the corresponding software code image to the corresponding storage address area in the code area of the upgrade partition; the state of the upgrade partition is maintained as an active partition, and the state of the backup partition is maintained as an inactive partition.
The execution then loads the corresponding active partition.
More specific failure rollback procedures may be seen in fig. 5.
As shown in fig. 6, a more detailed process flow diagram in one implementation of the invention is shown. As can be seen from fig. 6, in a specific example, the method comprises the following more detailed procedure:
after the upgrade is triggered, firstly determining an upgrade partition, running a Bootload program of a Boot area in the upgrade partition, loading an IPL guide area, and brushing a new IPL.json file in an upgrade package into the upgrade partition, and switching to run the IPL file of the upgrade partition; checking to find that the first address of the IPL boot area is a brush-written Metha mirror image, obtaining the address and the type of the mirror image, extracting the Metha mirror image file from the compressed upgrade package, and writing the Metha mirror image file into the address area of the code area corresponding to the upgrade partition according to the address; and after finishing, the second image file and the third image file are sequentially and identically written until the last image file is written, and after all the image files are written. And taking the upgrading partition as an active partition, loading the running of each image file, and if the upgrading is successful, the upgrading is successful.
In the refreshing process, if the refreshing of a certain image file is unsuccessful, or the final running and loading are unsuccessful, the updating process fails, a rollback program needs to be triggered, and the previous old version IPL address information and each image file are recovered.
It will be appreciated that the method of the invention is carried out with the following advantages:
in the method, each code in the code area is laid out, so that the method can adapt to various code quantity and sizes; the method can be used for covering a simple ECU such as a door and window module or a responsible domain controller ECU such as a CCU and the like, thoroughly solves the problem that other areas are required to occupy other area spaces due to overlarge codes and the other areas are not known to move to, and can fully utilize hardware resources by implementing the method.
In the upgrading process, when failure occurs, the address management file before upgrading can be safely found, and the original software package is returned to the original address area.
Meanwhile, the defect that the data area is not dared to be easily upgraded is overcome, because the data content and the address of the loading of different application APP are different, if the offset occurs, the read data is inaccurate, and the original function cannot be realized. The method can realize the upgrading of the data area, and even if the upgrading of the data area fails, the old data can be recovered according to the old address stored in the IPL when the code rolls back.
Fig. 7 is a schematic diagram illustrating a main flow of another embodiment of an OTA upgrading method according to the present invention; in this embodiment, it is different from the embodiment shown in fig. 2 to 6 in that this embodiment is applied to ECU Flash having only one system partition. Specifically, in this embodiment, the OTA upgrade system capable of dynamically adjusting Flash layout at least includes the following steps:
step S20, after entering an OTA upgrade mode, acquiring a system partition (namely an original active partition) for upgrade in Flash, wherein the system partition for upgrade is at least provided with a Boot area, an IPL guide area, a code area and a data area;
step S21, an address management file is obtained from an OTA upgrade package and refreshed to an IPL guide area of the system partition for upgrading, wherein the address management file contains the storage address information of each software code image corresponding to the upgrading;
step S22, corresponding latest storage address information of the code area and the data area is obtained according to the storage address information of each software code mirror image in the address management file;
in a specific example, the step includes:
determining the latest storage range of the code area according to the storage address information of each software code image updated in the management address file, and determining the storage area of each software code image in the code area; the latest storage range of the code area covers the storage areas corresponding to all the software code mirror image storage addresses;
comparing the latest end address of the code area with the initial address of the data area before adjustment according to the updated storage range of the code area, and determining whether to adjust the storage range of the data area; it will be appreciated that in a general example, the data area follows the code area, and if the latest end address of the code area exceeds the initial address of the data area before adjustment, it means that the latest code area occupies the storage space of the previous data area, and the storage range of the data area needs to be adjusted.
It can be understood that, when it is determined that the storage range of the data area needs to be adjusted, the latest storage range of the data area is determined, and the content of the pre-adjustment data area of the system partition for upgrading is refreshed into the latest storage range of the adjusted data area.
Step S23, according to the software code image storage address information corresponding to the current upgrade, the corresponding software code image is obtained from the upgrade package, and is sequentially refreshed to the latest storage address of the code area.
The method comprises the following steps: after the OTA upgrade fails, an upgrade rollback operation is performed, which includes:
acquiring a prior address management file from an IPL boot zone of a system partition for upgrade; updating the layout of the code area and the data area of the system partition for upgrading according to the address management file, storing address information according to the software code image, acquiring the contents of the corresponding software code image and the data area which are backed up, and refreshing the contents into the corresponding storage address area and the data area in the code area of the system partition for upgrading.
It will be appreciated that to achieve this failed rollback operation, the address management file for the IPL boot area in the system partition (i.e., the active partition) for the upgrade, the software code image in the code area, and the contents of the data area are pre-stored in one of the backup areas in the Flash before each upgrade.
For more details, reference is made to the foregoing descriptions of fig. 2 to 6, and no further description is given here.
FIG. 8 is a schematic diagram illustrating a main flow of an embodiment of a code image loading processing method according to the present invention; in this embodiment, the method at least includes the following steps:
step S30, after the upper software system is started, a Bootload program of a Boot area of a current active partition is started, the current active partition is at least provided with the Boot area, an IPL guide area, a code area and a data area, and at least one software code image is prestored in the code area;
step S31, loading an IPL guide area of an active partition to obtain an address management file therein, and obtaining storage address information of each software code mirror image in a code area and storage range information of a data area according to the address management file;
step S32, according to the storage address information of each software code image, each software code image stored in the code area is loaded and executed in sequence.
For example, in one example, a full start-up procedure for an ECU system is: firstly, a Boot region runs a Bootload program, an IPL guide region is loaded, and the address, the size and the sequence of each code to be started are obtained according to the address management file in the IPL guide region. For example, find that the first file started is Metha, the address is to read the code segment from 0x0000FFFF (assumption), the length is 500 bytes length (assumption), then load start Metha from this load address and integrity check; when the integrity check passes, the IPL loads the next Propa program, the address field of the IPL is 0x000FFFFF, the length of the IPL is 200KB, and the IPL starts loading; after loading and checking, each program of the lower area in sequence, such as LLCE, switch and the like, is continued according to the list in the IPL boot area, and as long as the IPL finishes all loading of the code image files in the address management files and checking is passed, the whole system is completely started and normally operated.
For more details, reference is made to the foregoing descriptions of fig. 2 to 7, and no further description is given here.
Fig. 9 is a schematic structural diagram of an embodiment of an OTA upgrading system 1 according to the present invention; as shown in fig. 10, in this embodiment, the system 1 at least includes:
the upgrade partition obtaining unit 10 is configured to obtain a system partition for upgrade in Flash after entering an OTA upgrade mode, where the system partition for upgrade is at least provided with a Boot area, an IPL Boot area, a code area, and a data area;
an address management file obtaining unit 11, configured to obtain an address management file from the OTA upgrade package, and refresh the address management file to an IPL boot area of a system partition for upgrade, where the address management file includes image storage address information of each software code corresponding to the upgrade;
a layout updating unit 12, configured to obtain, according to each software code image storage address information in the address management file, corresponding latest storage address information of the code area;
the image refreshing processing unit 13 is configured to obtain a corresponding software code image from the upgrade package according to the software code image storage address information corresponding to the upgrade, and sequentially refresh the software code image into the latest storage address of the code area;
the upgrade failure processing unit 14 is configured to perform an upgrade rollback operation after the OTA upgrade fails, and specifically includes:
acquiring a prior address management file from an IPL boot zone of the system partition for upgrading; updating the layout of the code area and the data area of the system partition for upgrading according to the prior address management file, acquiring the contents of the corresponding software code image and the data area of the backup according to the software code image storage address information, and refreshing the contents into the corresponding storage address area and the data area in the code area of the system partition for upgrading.
More specifically, as shown in fig. 10, the layout updating unit 12 includes:
a code region layout updating unit 120, configured to determine, according to the storage address information of each software code image updated this time in the address management file, an latest storage range of the code region, and determine a storage region of each software code image in the code region; the latest storage range of the code area covers the storage areas corresponding to all the software code mirror image storage addresses;
a data area layout updating unit 121, configured to compare, according to the updated storage range of the code area, the latest end address of the code area with the start address of the data area before adjustment, determine whether to adjust the storage range of the data area, determine that the storage range of the data area needs to be adjusted when it is determined that the storage range of the data area needs to be adjusted, determine the latest storage range of the data area, and refresh the content of the data area before adjustment for the updated system partition into the latest storage range of the data area after adjustment.
For more details, reference is made to the foregoing description of fig. 7, and details are not repeated here.
It will be appreciated that in other examples, variations may be made to the system described in figures 9 and 10 to form a new embodiment. Specifically, in this new embodiment, the upgrade partition acquisition unit 10 is further configured to:
after entering an OTA upgrade mode, determining one of the current two system partitions in Flash as an upgrade partition, and determining the other one as a backup partition, wherein the upgrade partition is the system partition for upgrade; and the upgrading partition and the backup partition are respectively provided with at least a Boot area, an IPL guide area, a code area and a data area.
The upgrade failure processing unit 14 included in the system is configured to perform an upgrade rollback operation after the OTA upgrade fails, where the upgrade failure processing unit 14 specifically includes:
switching the state of the backup partition to an active partition, and switching the state of the upgrade partition to an inactive partition; or (b)
Acquiring a prior address management file from an IPL guide area of the backup partition, and refreshing the prior address management file to the IPL guide area of the upgrade partition; updating the layout of the code area and the data area of the upgrade partition according to the address management file, acquiring a corresponding software code image from the backup partition according to the software code image storage address information, and refreshing the corresponding software code image to the corresponding storage address area in the code area of the upgrade partition; the state of the upgrade partition is maintained as an active partition, and the state of the backup partition is maintained as an inactive partition.
For more details, reference is made to the foregoing descriptions of fig. 9, 10 and fig. 2 to 6, and no further description is given here. As another aspect of the invention, there is also provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method as described in fig. 2 to 8. For more details, reference is made to and the description of fig. 2 to 8 is incorporated in the foregoing, and no further description is given here.
As yet another aspect of the present invention, there is also provided a vehicle having disposed thereon a plurality of electronic control units, at least some of which employ the steps of the method as described in fig. 2-8 to effect OTA upgrade or code image loading processing operations. For more details, reference is made to and the description of fig. 2 to 8 is incorporated in the foregoing, and no further description is given here.
The embodiment of the invention has the following beneficial effects:
the invention provides an OTA upgrading method, a code mirror image loading processing system and a vehicle. By setting the IPL guide area, when the Boot area works, the IPL guide area is loaded first; according to the address management file in the IPL guide area, the address of the mirror image file of each code in the code area is managed, so that the Flash layout can be dynamically updated in the upgrading process, and the mirror image file of each code can be accurately loaded in operation; meanwhile, the position of the data area can be updated; thus, safe upgrading and loading operation can be realized;
by implementing the embodiment of the invention, a brand new upgrade scheme and a dynamic layout update strategy are adopted, and the method is not limited by the layout of the pre-mass production planning any more, so that the resource utilization rate of hardware and the number of later functional iterations can be obviously improved;
when the embodiment of the invention is implemented, the address management file of the IPL guide area is provided with a backup mechanism when rollback is carried out after the refresh failure, so that the version before the refresh can be truly returned to, the loss of the user data area is avoided, and the user experience is improved;
by implementing the embodiment of the invention, since the mirror image file of each code of the code area can be managed in the IPL boot area, the method can be applied to various types or more complex ECUs, and even if the ECUs are complex domain controllers, the types and the number of the firmware code formats can be more easily managed.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above disclosure is only a preferred embodiment of the present invention, and it is needless to say that the scope of the invention is not limited thereto, and therefore, the equivalent changes according to the claims of the present invention still fall within the scope of the present invention.

Claims (16)

1. An OTA upgrading method is characterized by comprising the following steps:
after entering an OTA upgrading mode, acquiring a system partition for upgrading in Flash, wherein the system partition for upgrading is at least provided with a Boot area, an IPL (Internet protocol) guide area, a code area and a data area;
an address management file is obtained from an OTA upgrade package and refreshed to an IPL guide area of the system partition for upgrading, wherein the address management file contains the storage address information of each software code image corresponding to the upgrade;
obtaining the latest storage address information corresponding to the code area according to the mirror image storage address information of each software code in the address management file;
and acquiring the corresponding software code image from the upgrade package according to the storage address information of the software code image corresponding to the upgrade, and refreshing the corresponding software code image to the corresponding latest storage address of the code area in sequence.
2. The method of claim 1, wherein the obtaining the latest storage address information corresponding to the code region from each software code image storage address information in the address management file comprises:
determining the latest storage range of the code area according to the storage address information of each software code image updated at this time in the address management file, and determining the storage area of each software code image in the code area; the latest storage range of the code area covers the storage areas corresponding to all the software code mirror image storage addresses;
and comparing the latest end address of the code area with the initial address of the data area before adjustment according to the updated storage range of the code area, and determining whether to adjust the storage range of the data area.
3. The method of claim 2, wherein determining whether to adjust the storage range of the data region further comprises:
and determining the latest storage range of the data area after judging that the storage range of the data area needs to be adjusted, and refreshing the content of the data area before adjustment of the system partition for upgrading to the latest storage range of the data area after adjustment.
4. A method as claimed in claim 3, comprising:
after the OTA upgrade fails, performing an upgrade rollback operation, including:
acquiring a prior address management file from an IPL boot zone of the system partition for upgrading; updating the layout of the code area and the data area of the system partition for upgrading according to the prior address management file, acquiring the contents of the corresponding software code image and the data area of the backup according to the software code image storage address information, and refreshing the contents into the corresponding storage address area and the data area in the code area of the system partition for upgrading.
5. A method according to any one of claims 1 to 3, characterized in that the address management file of the IPL boot area in the system partition for the upgrade, the software code image in the code area and the content of the data area are pre-stored in a backup area in the Flash before each upgrade.
6. The method of claim 1, wherein after entering the OTA upgrade mode, obtaining a system partition in Flash for upgrade, further comprises:
after entering an OTA upgrade mode, determining one of the current two system partitions in Flash as an upgrade partition, and determining the other one as a backup partition, wherein the upgrade partition is the system partition for upgrade; and the upgrading partition and the backup partition are respectively provided with at least a Boot area, an IPL guide area, a code area and a data area.
7. The method of claim 6, wherein determining one of the two current system partitions in Flash as an upgrade partition and the other as a backup partition comprises:
dynamically determining the types of two current system partitions in Flash, determining an active partition before updating as a backup partition, and determining an inactive partition before updating as an upgrade partition; or (b)
And determining one fixed system partition in Flash as an upgrade partition, determining the other system partition as a backup partition, and backing up all data in the upgrade partition into the backup partition before upgrading is executed.
8. The method as recited in claim 7, comprising:
after the OTA upgrade fails, performing an upgrade rollback operation, including:
switching the state of the backup partition to an active partition, and switching the state of the upgrade partition to an inactive partition; or (b)
Acquiring a prior address management file from an IPL guide area of the backup partition, and refreshing the prior address management file to the IPL guide area of the upgrade partition; updating the layout of the code area and the data area of the upgrade partition according to the address management file, acquiring a corresponding software code image from the backup partition according to the software code image storage address information, and refreshing the corresponding software code image to the corresponding storage address area in the code area of the upgrade partition; the state of the upgrade partition is maintained as an active partition, and the state of the backup partition is maintained as an inactive partition.
9. An OTA upgrade system, comprising at least:
the system comprises an upgrade partition obtaining unit, a Flash memory unit and a storage unit, wherein the upgrade partition obtaining unit is used for obtaining a system partition for upgrading in Flash after entering an OTA upgrade mode, and the system partition for upgrading is at least provided with a Boot area, an IPL guide area, a code area and a data area;
the address management file acquisition unit is used for acquiring an address management file from an OTA upgrade package and refreshing the address management file to an IPL guide area of the system partition for upgrading, wherein the address management file contains the image storage address information of each software code corresponding to the upgrading;
a layout updating unit, configured to obtain, according to each software code image storage address information in the address management file, corresponding latest storage address information of the code area;
and the image refreshing processing unit is used for acquiring the corresponding software code image from the upgrade package according to the software code image storage address information corresponding to the current upgrade and refreshing the corresponding software code image into the corresponding latest storage address of the code area in sequence.
10. The system of claim 9, wherein the layout update unit comprises:
a code region layout updating unit, configured to determine, according to the storage address information of each software code image updated this time in the address management file, an latest storage range of the code region, and determine a storage region of each software code image in the code region; the latest storage range of the code area covers the storage areas corresponding to all the software code mirror image storage addresses;
and the data area layout updating unit is used for comparing the latest end address of the code area with the initial address of the data area before adjustment according to the updated storage range of the code area, determining whether the storage range of the data area is adjusted, judging that the storage range of the data area needs to be adjusted, determining the latest storage range of the data area after judging that the storage range of the data area needs to be adjusted, and refreshing the content of the data area before adjustment for upgrading the system partition into the latest storage range of the data area after adjustment.
11. The system as recited in claim 10, comprising:
the upgrade failure processing unit is configured to execute an upgrade rollback operation after the OTA upgrade fails, and includes:
acquiring a prior address management file from an IPL boot zone of the system partition for upgrading; updating the layout of the code area and the data area of the system partition for upgrading according to the prior address management file, acquiring the contents of the corresponding software code image and the data area of the backup according to the software code image storage address information, and refreshing the contents into the corresponding storage address area and the data area in the code area of the system partition for upgrading.
12. The system of any of claims 8 to 10, wherein the upgrade partition acquisition unit is further to:
after entering an OTA upgrade mode, determining one of the current two system partitions in Flash as an upgrade partition, and determining the other one as a backup partition, wherein the upgrade partition is the system partition for upgrade; and the upgrading partition and the backup partition are respectively provided with at least a Boot area, an IPL guide area, a code area and a data area.
13. The system as recited in claim 12, comprising:
the upgrade failure processing unit is configured to execute an upgrade rollback operation after the OTA upgrade fails, and specifically includes:
switching the state of the backup partition to an active partition, and switching the state of the upgrade partition to an inactive partition; or (b)
Acquiring a prior address management file from an IPL guide area of the backup partition, and refreshing the prior address management file to the IPL guide area of the upgrade partition; updating the layout of the code area and the data area of the upgrade partition according to the address management file, acquiring a corresponding software code image from the backup partition according to the software code image storage address information, and refreshing the corresponding software code image to the corresponding storage address area in the code area of the upgrade partition; the state of the upgrade partition is maintained as an active partition, and the state of the backup partition is maintained as an inactive partition.
14. The code image loading processing method is characterized by at least comprising the following steps:
starting a Bootload program of a Boot area of a current active partition, wherein the current active partition is at least provided with the Boot area, an IPL guide area, a code area and a data area, and at least one software code image is prestored in the code area;
loading an IPL guide area of the active partition to obtain an address management file therein, and obtaining storage address information of each software code mirror image in the code area according to the address management file;
and loading and executing each software code image stored in the code area in sequence according to the storage address information of each software code image.
15. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 8, 14.
16. A vehicle having a plurality of electronic control units deployed therein, at least some of which perform OTA upgrades or code image loading processes using the steps of the method of any one of claims 1 to 8, 14.
CN202311833898.6A 2023-12-27 2023-12-27 OTA upgrading method, code mirror image loading processing method, system and vehicle Pending CN117785253A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311833898.6A CN117785253A (en) 2023-12-27 2023-12-27 OTA upgrading method, code mirror image loading processing method, system and vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311833898.6A CN117785253A (en) 2023-12-27 2023-12-27 OTA upgrading method, code mirror image loading processing method, system and vehicle

Publications (1)

Publication Number Publication Date
CN117785253A true CN117785253A (en) 2024-03-29

Family

ID=90395936

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311833898.6A Pending CN117785253A (en) 2023-12-27 2023-12-27 OTA upgrading method, code mirror image loading processing method, system and vehicle

Country Status (1)

Country Link
CN (1) CN117785253A (en)

Similar Documents

Publication Publication Date Title
US20070074201A1 (en) Method and system for updating software and computer readable recording medium storing the method
CN107678762B (en) System version upgrading method and device
CN111796856A (en) Differential upgrading method and device, storage medium and computer equipment
CN104007992A (en) Methods and devices for program updating and starting
US11126422B2 (en) Program update system, control system, mobile body, program update method, recording medium
CN112000358B (en) Upgrading method of charging pile and intelligent charging pile
US11449329B2 (en) Vehicle control device and program update system
CN111475194A (en) Software upgrading method for new energy automobile controller
CN117785253A (en) OTA upgrading method, code mirror image loading processing method, system and vehicle
CN115061713A (en) Method and device for upgrading electronic equipment
CN113805933A (en) Set top box system upgrading method and device, set top box, system and storage medium
CN116795408A (en) ECU software upgrading method and system and vehicle
CN116301973A (en) Firmware upgrading method, device, equipment and readable storage medium
JP3805195B2 (en) Program rewriting apparatus and program rewriting method
CN114035831B (en) CPLD upgrading method, system and computer readable storage medium
CN110096230A (en) A kind of updated driving data record system and method for controller
CN114895947A (en) Software upgrading method, device, equipment and storage medium of vehicle-mounted controller
CN114510375A (en) Flash chip data area dynamic sharing system and method
CN114546455A (en) MCU software upgrading method and device for double partitions
CN113467805A (en) Firmware rollback method of network equipment and related device
CN113766554A (en) Method and device for acquiring WiFi calibration data and WiFi equipment calibration test system
CN112732301A (en) Vehicle upgrading method and device
CN113672258A (en) System upgrading method and device for vehicle, computer equipment and storage medium
JP6935694B2 (en) Electronic control device
JP7266216B2 (en) Information processing device and information processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination