FOTA upgrading method and system based on Flash SWAP chip

By presetting the partition table and the address mapping of the OTA hardware unit, combined with the flash diagnostic protocol and the software update configuration manager, the problems of address discontinuity and flash failure in the chip Flash SWAP FOTA upgrade method are solved, and new energy vehicle software is realized and the convenience and efficiency of system upgrades.

CN118778985AInactive Publication Date: 2024-10-15ZHONGKE YICHUANG (GUANGZHOU) TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410991149.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing FOTA upgrade method using chip Flash SWAP has inconvenient problems, especially when the program flash process may fail or the external power supply is abnormal, resulting in the loss of controller functions, and the traditional processing method requires forced code blocks to be divided into Secondly, the compatible addresses are discontinuous, which makes software upgrade cumbersome.

Method used

By presetting the partition table, including the first address block, the second address block, the third address block and the fourth address block, in increments by physical address, and switching between OTA configuration 1 and configuration 2, the OTA hardware unit is used for address Mapping ensures the continuity of program access addresses, uses the flash diagnostic protocol and software update configuration manager to manage software data, and realizes the distribution and policy formulation of software upgrade packages.

Benefits of technology

It avoids the problem of discontinuous addresses allocated by software programs, reduces software code matching work, improves the convenience and efficiency of new energy vehicle software and system upgrades, and ensures the integrity and robustness of the program when flashing fails.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118778985A_ABST
    Figure CN118778985A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of FOTA upgrading, and discloses an FOTA upgrading method and system based on a Flash SWAP chip, and the method comprises the steps: presetting a partition table which comprises a first address block, a second address block, a third address block and a fourth address block, and the physical addresses of the first address block, the second address block, the third address block and the fourth address block are gradually increased from small to large; when 1 is configured according to OTA, the software program accesses the second address block and the third address block, and the address accessed by the software program and the physical addresses of the second address block and the third address block form mapping; when 2 is configured according to OTA, the software program accesses the second address block and the third address block, and the address accessed by the software program and the physical addresses of the first address block and the fourth address block form mapping. The method has the advantages that the application program has continuous, complete and maximized space, extra software code matching work is not needed, and the software and system upgrading efficiency of the new energy vehicle is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of FOTA upgrade, and in particular to a FOTA upgrade method and system based on a Flash SWAP chip. Background Art

[0002] With the rapid development of new energy vehicles, OTA (Over-The-Air, on-board controller software air upgrade) technology allows manufacturers to remotely update the vehicle's software and system through wireless networks, fix vulnerabilities and improve functions in a timely manner to improve the safety and reliability of the vehicle, while helping new energy vehicles maintain the latest functions and performance, thereby enhancing their competitiveness and market appeal. Among them, OTA technology includes FOTA (Firmware-Over-The-Air, embedded on-board controller software air upgrade) technology, which is applied to the remote upgrade of embedded software and systems of new energy vehicles. However, in order to ensure the safety and reliability of the upgrade, it is often necessary to establish a complete security mechanism and process to prevent malicious attacks and data leakage. As a software component resident in memory, the main function of the bootloader Bootloader is to enable the ECU to have online reprogrammability. All programmable ECUs that support application refresh should store the bootloader in a boot storage area. It should execute the bootloader until a complete set of applications and application data are refreshed. Once the ECU receives the information that the software refresh is about to start, the program control inside the ECU will be switched, so that the Bootloader will be executed again.

[0003] At present, the existing technology only meets the basic flashing requirements, but does not consider the failure problems that occur during the program flashing process. For example, when the program itself is abnormal, or when the external power supply of the controller is abnormal during the flashing process, the controller function will be lost. In addition, for the design scheme using chip Flash SWAP, it usually only considers a single bank. For chips with two or more banks, the banks that can be supported are often adjacent to each other from the perspective of chip design. This will cause the allocation address of the software program to be discontinuous. The traditional processing method is that software development needs to force the code block to be divided into two to be compatible with this shortcoming, which will cause some additional matching and adaptation work for the software. For example, when the software is updated and iterated, it is often necessary to readjust the code allocated to the two divided blocks to ensure the internal consistency of the program; when the software is burned and upgraded, an additional block of address segment must be processed, which causes certain cumbersomeness and brings inconvenience to the software and system upgrade of new energy vehicles.

[0004] With respect to the above-mentioned related technologies, the inventors have found that the existing FOTA upgrade method using chip Flash SWAP has the problem of inconvenience. Summary of the invention

[0005] In order to improve the convenience of the FOTA upgrade method using chip Flash SWAP, the present application provides a FOTA upgrade method and system based on Flash SWAP chip.

[0006] In a first aspect, the present application provides a FOTA upgrade method based on a Flash SWAP chip.

[0007] This application is achieved through the following technical solutions:

[0008] A FOTA upgrade method based on Flash SWAP chip, comprising the following steps:

[0009] Presetting a partition table, wherein the partition table includes a first address block, a second address block, a third address block and a fourth address block, and the physical addresses of the first address block, the second address block, the third address block and the fourth address block are respectively increased in ascending order;

[0010] When OTA configuration 1 is followed, the software program accesses the second address block and the third address block, and the addresses accessed by the software program are mapped to the physical addresses of the second address block and the third address block;

[0011] When OTA configuration 2 is followed, the software program accesses the second address block and the third address block, and the addresses accessed by the software program are mapped to the physical addresses of the first address block and the fourth address block.

[0012] In a preferred example, the present application can be further configured as follows: it also includes the following steps:

[0013] Activate OTA configuration 1, the software program counter unit starts counting, and the OTA hardware unit maps the physical addresses of the second address block and the third address block of the partition table to the program access address table.

[0014] In a preferred example, the present application can be further configured as follows: it also includes the following steps:

[0015] When flashing is started, the physical addresses of the first address block and the fourth address block are flashed into the second address block and the third address block;

[0016] Determine whether the flashing is successful;

[0017] If the flashing is successful, after the backup program is enabled, OTA configuration 2 is activated, the software program counter unit starts counting, and the OTA hardware unit maps the physical addresses of the first address block and the fourth address block of the partition table to the program access address table.

[0018] In a preferred example, the present application may be further configured as follows: when the second address block and the third address block are flushed with the physical addresses of the first address block and the fourth address block, the following steps are included:

[0019] Based on the flash diagnostic protocol, the original software data in the second address block and the third address block is retained, and the software data of the backup program is received and written into the first address block and the fourth address block.

[0020] In a preferred example, the present application can be further configured as follows: it also includes the following steps:

[0021] If the flashing fails, the OTA configuration remains unchanged, the software program counter unit starts counting, and the OTA hardware unit maps the physical addresses of the second address block and the third address block of the partition table to the program access address table.

[0022] In a preferred example, the present application can be further configured as follows: it also includes the following steps:

[0023] Use software update configuration manager to manage software data, update and delete software data, and retain software data records;

[0024] Negotiate and distribute software upgrade packages with multiple software update configuration managers, and develop software upgrade strategies, including target software versions and their upgrade frequency, upgrade urgency, planned upgrade time, and assigned software update configuration managers;

[0025] Determine the upgrade priority of each target software version of each software update configuration manager;

[0026] Unify the upgrade tools and upgrade processes for each target software version;

[0027] Based on the upgrade priority, the target software version information with high priority is distributed to the equipped software update configuration manager in the order of the proposed upgrade time from small to large, so as to complete the distribution of the software upgrade package;

[0028] Feedback the distribution information of the software upgrade package to the main control module of the corresponding OTA hardware unit;

[0029] According to the distribution information, the main control module of the OTA hardware unit downloads the distributed software upgrade package.

[0030] In a second aspect, the present application provides a FOTA upgrade system based on a Flash SWAP chip.

[0031] This application is achieved through the following technical solutions:

[0032] A FOTA upgrade system based on Flash SWAP chip, comprising:

[0033] A partition table, wherein the partition table comprises a first address block, a second address block, a third address block and a fourth address block, and the physical addresses of the first address block, the second address block, the third address block and the fourth address block are respectively increased in ascending order;

[0034] a program access address table, for storing, when in accordance with OTA configuration 1, addresses accessed by software programs as physical addresses of the second address block and the third address block; and, when in accordance with OTA configuration 2, addresses accessed by software programs as physical addresses of the first address block and the fourth address block;

[0035] An OTA hardware unit, used to complete the mapping between the physical address of the partition table and the address accessed by the software program;

[0036] Software program counter unit, used to trigger and run software programs.

[0037] In a third aspect, the present application provides a computer device.

[0038] This application is achieved through the following technical solutions:

[0039] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of any one of the above-mentioned FOTA upgrade methods based on a FlashSWAP chip are implemented.

[0040] In a fourth aspect, the present application provides a controller.

[0041] This application is achieved through the following technical solutions:

[0042] A controller stores a computer program, wherein the computer program, when executed by a processor, implements the steps of any one of the above-mentioned FOTA upgrade methods based on a Flash SWAP chip.

[0043] In a fifth aspect, the present application provides a controller software.

[0044] This application is achieved through the following technical solutions:

[0045] A controller software includes a computer program, wherein when the computer program is executed by a processor, the computer program implements the steps of any one of the above-mentioned FOTA upgrade methods based on a Flash SWAP chip.

[0046] In summary, compared with the prior art, the technical solution provided by this application has at least the following beneficial effects:

[0047] A partition table is pre-set, wherein the partition table includes a first address block, a second address block, a third address block and a fourth address block, and the physical addresses of the first address block, the second address block, the third address block and the fourth address block are respectively increased in order from small to large; when OTA configuration 1 is followed, the software program accesses the second address block and the third address block, and the physical addresses of the second address block and the third address block are continuous spaces, and the addresses accessed by the software program are the physical addresses of the second address block and the third address block. At this time, the program address and the physical address are consistent; when OTA configuration 2 is followed, the software program accesses the second address block and the third address block, and the access address is still a continuous space, avoiding the existing Bo The software program allocation address designed by otloader is discontinuous, which causes additional software code matching work, bringing inconvenience to the software and system upgrade of new energy vehicles. The address accessed by the software program is the physical address of the first address block and the fourth address block. At this time, the program address and the physical address are inconsistent. Through the two physical partitioning schemes of the second address block, the third address block and the first address block, the fourth address block, combined with the OTA cross-configuration combination, the application program has a continuous, complete and maximized space, without the need for additional software code matching work, the software and system upgrade of new energy vehicles is more convenient, and the upgrade efficiency of the software and system of new energy vehicles is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A program address and physical address mapping diagram during OTA configuration 1 of a FOTA upgrade method based on a Flash SWAP chip is provided as an exemplary embodiment of the present application.

[0049] Figure 2 A program address and physical address mapping diagram during OTA configuration 2 of a FOTA upgrade method based on a Flash SWAP chip is provided as another exemplary embodiment of the present application.

[0050] Figure 3 A schematic diagram of the main process of flashing and OTA cross-configuration activation of a FOTA upgrade method based on a Flash SWAP chip is provided as another exemplary embodiment of the present application. DETAILED DESCRIPTION

[0051] This specific embodiment is merely an explanation of the present application and is not a limitation of the present application. After reading this specification, those skilled in the art may make modifications to the present embodiment without any creative contribution as needed. However, as long as it is within the scope of the claims of the present application, it shall be protected by the patent law.

[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0053] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.

[0054] The existing partitioning scheme allocates different storage areas for the running version of the software and the target version of the upgrade. The two physical partitions roll back to each other. For example, when the A partition system is operating to provide services, the B partition is refreshed. After the B partition software is flashed and verified, it is loaded into the B partition at the next restart; if the flashing error or the associated ECU refresh fails, the A partition system is still started, thereby improving the reliability of the upgrade and minimizing the time required for rollback.

[0055] The system runs in partition A by default. When a new version of the software needs to be updated, the upgrade package can be received from the OTA master control through the upgrade agent and installed directly into partition B through the installation program. The entire update process does not affect the normal function of the ECU.

[0056] The upgrade process includes:

[0057] The system runs normally in partition A, and the upgrade agent receives the upgrade package file from the OTA master control and saves it in the upgrade package cache area;

[0058] After the upgrade package is received, it will be decrypted and signed for authentication;

[0059] After receiving the OTA master installation command, the A partition installer installs the upgrade package in the cache to the B partition;

[0060] After receiving the OTA master control activation command, set the system boot flag to B partition;

[0061] After restarting the system, switch to running the newly installed software version in partition B.

[0062] The above technology only considers that multiple program versions can be switched back and forth between two system partitions at the same time, and does not consider the flash characteristics of the hardware SWAP function.

[0063] In view of the flash characteristics of the hardware SWAP function, an embodiment of the present application provides a FOTA upgrade method based on a Flash SWAP chip, which is applied to the design and production application of the flash function inside the automobile controller. The automobile controller can be a Bootloader. The flash function includes rollback, self-refresh, and storage partition design corresponding to OTA requirements. The main steps of the method are described as follows.

[0064] Presetting a partition table, wherein the partition table includes a first address block, a second address block, a third address block and a fourth address block, and the physical addresses of the first address block, the second address block, the third address block and the fourth address block are respectively increased in ascending order;

[0065] When OTA configuration 1 is followed, the software program accesses the second address block and the third address block, and the addresses accessed by the software program are mapped to the physical addresses of the second address block and the third address block;

[0066] When OTA configuration 2 is followed, the software program accesses the second address block and the third address block, and the addresses accessed by the software program are mapped to the physical addresses of the first address block and the fourth address block.

[0067] The embodiments of the present application are further described in detail below in conjunction with the drawings in the specification.

[0068] Reference Figure 1 The partition table includes the first address block, the second address block, the third address block and the fourth address block, which correspond to Bank A and Bank A respectively. , Area, Bank B Area and BankB , There are 4 bank blocks in the area. Each bank block includes a starting address, starting from 0x000000 and increasing in order from small to large. The size of each bank block is about 2048KB. Among them, the physical address of BankA area is 0x000000-0x1FFFFF, BankA , The physical address of the Bank A area is 0x200000-0x3FFFFF, the physical address of the Bank B area is 0x400000-0x5FFFFF, and the physical address of the Bank B area is 0x400000-0x5FFFFF. , The physical address of the area is 0x600000-0x7FFFFF.

[0069] When OTA configuration 1 is used, the software program accesses the second address block and the third address block, that is, the addresses accessed by the software program are 0x200000-0x3FFFFF and 0x400000-0x5FFFFF, which is a large continuous space of about 4096KB. The two Bank areas are adjacent, achieving the effect of continuous use of space. The address accessed by the software program maps the physical address of the second address block and the third address block. At this time, the program address and the physical address are consistent. The size and starting address of the Bank block in the figure are only examples. They can be set as needed in actual use.

[0070] Reference Figure 2 , when OTA configuration 2 is used, the software program accesses the second address block and the third address block, that is, the software program still accesses a large continuous space of 0x200000-0x3FFFFF and 0x400000-0x5FFFFF. The two Bank areas are adjacent, achieving the effect of continuous use of space. The address accessed by the software program maps the physical address of the first address block and the fourth address block. At this time, the program address and the physical address are inconsistent. The size and starting address of the Bank block in the figure are only examples. They can be set as needed in actual use.

[0071] The comparison of the OTA unit configuration combination mode and advantages and disadvantages of the OTA function of the existing chip and the OTA function based on the Flash SWAP chip of the present application is shown in Table 1 below.

[0072] Table 1

[0073]

[0074] In one embodiment, a FOTA upgrade method based on a Flash SWAP chip further includes the following steps:

[0075] Activate OTA configuration 1, the software program counter unit starts counting, and the OTA hardware unit maps the physical addresses of the second address block and the third address block of the partition table to the program access address table.

[0076] When used according to OTA configuration 1, the addresses accessed by the software program are 0x200000-0x3FFFFF and 0x400000-0x5FFFFF, which are large continuous spaces. At this time, the program address is consistent with the physical address.

[0077] Reference Figure 3 In one embodiment, a FOTA upgrade method based on a Flash SWAP chip further includes the following steps:

[0078] S1: When starting the flashing, the physical addresses of the first address block and the fourth address block are flashed into the second address block and the third address block;

[0079] S2: Determine whether the flashing is successful;

[0080] S3: If the flashing is successful, after enabling the backup program, OTA configuration 2 is activated, the software program counter unit starts counting, and the OTA hardware unit maps the physical addresses of the first address block and the fourth address block of the partition table to the program access address table.

[0081] When flashing is started, the backup / OTA software should be flashed, and the bootloader software is flashed into BankA and BankB , After the flashing is completed, the upper logic of the vehicle will decide to enable this version of the software. After the new software is enabled, OTA configuration 2 is activated, and the software program access is still 0x200000-0x3FFFFF and 0x400000-0x5FFFFF, and the program address and physical address are inconsistent. The mapping function of the program address and the physical address is completed by the hardware OTA unit. The hardware OTA unit is used to provide the application program with two consecutive bank blocks in the middle.

[0082] This solution innovatively proposes a solution of OTA cross-configuration combination combined with two physical partitions with the help of OTA hardware unit. The pre-planned FLASH physical address partition and allocation configuration combination activation can optimize the two flashing logic blocks into one flashing address block, avoiding the situation where the software program allocation address of the existing Bootloader design is discontinuous and causes additional software code matching work, so that the application has a continuous and complete maximum space without the need for additional software code matching work, making the software and system upgrade of new energy vehicles more convenient. At the same time, the FlashSWAP function of the chip is used to realize the switching of two firmwares. For the design scheme using chip Flash SWAP, it usually only considers a single Bank block. The ordinary ECU single partition structure only has BootLoader (boot program) and application partitions. When this type of structure is updated, the ECU is first switched from the currently running application partition to the Bootloader. After the current version data of the application partition is erased in the Bootloader, the new version data is received from the upgrade master and written into the application partition. After the data is verified to be correct, the ECU is restarted and switched to the application partition to run the new version of the software, which takes a relatively long time. Since there is only one application partition, it needs to be erased before upgrading, resulting in the ECU function being unusable during the upgrade process. If the update process is abnormally interrupted or fails, the function will also be unusable, which is inefficient. In addition, this type of upgrade usually needs to be performed when the vehicle is not in operation. When the number of software is large and the upgrade time is long, it is more challenging to power the vehicle's low-voltage battery, especially for fuel vehicles. This solution solves the problem of relatively long software switching time affecting the upgrade efficiency in the existing method, thereby improving the upgrade efficiency of software and systems of new energy vehicles.

[0083] In one embodiment, the OTA configuration combination mode can be set by software to complete cross-activation of OTA, so as to achieve the purpose of having a complete area that can be continuously accessed by the software program.

[0084] This solution has two physical partitions. Even if the flashing fails, only the backup APP area is flashed, and the activated APP area remains intact, which can avoid failure problems during the program flashing process.

[0085] The chip resources of this solution can be planned and used more fully, and the robustness is stronger.

[0086] This solution is suitable for applications with multiple Bank blocks that require a larger software space.

[0087] This solution solves the limitations of Dual BANK swap and similar chips, and overcomes the problem of discontinuous space allocation of existing chips, which causes inconvenience in bootloader design allocation and APP space allocation.

[0088] In one embodiment, when the second address block and the third address block are flushed with the physical addresses of the first address block and the fourth address block, the method includes:

[0089] Based on the flash diagnostic protocol, the original software data in the second address block and the third address block is retained, and the software data of the backup program is received and written into the first address block and the fourth address block.

[0090] In one embodiment, the following steps are also included:

[0091] If the flashing fails, the OTA configuration remains unchanged, the software program counter unit starts counting, and the OTA hardware unit maps the physical addresses of the second address block and the third address block of the partition table to the program access address table.

[0092] Considering the problem of failure during program flashing, the flashing diagnostic protocol UDS is used to flash BankA and BankB. , The physical address of the flashed program is changed, and the original software data in the second and third address blocks are retained. The interface includes any one or more of LIN / CAN / Ethernet. If the program itself is abnormal or the external power supply of the controller is abnormal during the flashing process, even if the flashing fails, the activated APP area is still intact, which can effectively avoid the problem of flashing failure.

[0093] UDS, or unified diagnostic service, is mainly used for off-board diagnostic equipment to connect to the in-vehicle bus through the vehicle diagnostic port, and request internal information from the controller or transmit data to the controller. The UDS protocol supports the standard process of software flashing and software upgrades, facilitating the development, testing and integration of FOTA. The FBL specification defines the software architecture that the controller must follow to implement software flashing, and defines which UDS services need to be used when flashing, as well as the sequential relationship between these services. Using these UDS for diagnostic services, the controller can be commanded to erase or retain the original software data in the memory, receive new software data and write it to the memory, and finally execute the new software program.

[0094] In one embodiment, a FOTA upgrade method based on a Flash SWAP chip further includes the following steps:

[0095] Use the Software Update Configuration Manager to manage software data, update and delete software data, and retain software data records.

[0096] The software update configuration manager (UCM) provides services for processing software update requests. UCM is responsible for updating, installing, deleting, and retaining software records on the AP, implementing software package management, and ensuring that the software on the AP is updated or modified in a safe and reliable manner.

[0097] In one embodiment, a FOTA upgrade method based on a Flash SWAP chip further includes the following steps:

[0098] Negotiating and allocating software upgrade packages with multiple software update configuration managers to complete the distribution of the software upgrade packages;

[0099] Feedback the distribution information of the software upgrade package to the main control module of the corresponding OTA hardware unit;

[0100] According to the distribution information, the main control module of the OTA hardware unit downloads the distributed software upgrade package.

[0101] In one embodiment, the step of negotiating and distributing the software upgrade package with multiple software update configuration managers includes:

[0102] Formulate software upgrade strategies, including target software versions and their upgrade frequency, upgrade urgency, planned upgrade time, and the software update configuration manager to be equipped;

[0103] Determine the upgrade priority of each target software version of each software update configuration manager;

[0104] Unify the upgrade tools and upgrade processes for each target software version;

[0105] Based on the upgrade priority, target software version information with high priority is distributed to the equipped software update configuration manager in the order of the proposed upgrade time from small to large.

[0106] By formulating software upgrade strategies, coordinating and distributing software update packages within the vehicle among multiple UCMs, software updates and upgrades of the adaptive platform AUTOSARAP can be achieved.

[0107] As the upgraded object, the vehicle-side ECU's main function is to upgrade according to a certain protocol. The main control receives the target version data, writes the target version data into the designated storage area and guides the running of the new version software, thereby realizing the update of its own software.

[0108] In summary, a FOTA upgrade method based on Flash SWAP chip adopts OTA cross-configuration combination combined with two physical partitioning mechanisms to cross-activate the Bank block units of the hardware OTA unit respectively. The program access has a whole maximized complete space, so that the program access address is always continuous, which avoids the inconvenience of use for the application side and does not require additional software code matching work. The software and system upgrades of new energy vehicles are more convenient, and the upgrade efficiency of the software and systems of new energy vehicles is improved.

[0109] A FOTA upgrade method based on Flash SWAP chip avoids the need for users to consider the partition processing problem of two discontinuous bank addresses in application scenarios and program space planning using the OTA function. It also avoids the resulting waste of FLASH space, including the waste of alignment processing, the waste of bank head and tail marking, and the interruption of program operation, which leads to low execution efficiency.

[0110] A FOTA upgrade method based on Flash SWAP chip realizes the chip partition design and the development of hardware-swap function.

[0111] A FOTA upgrade method based on Flash SWAP chip avoids the problem of inconvenience in upgrading new energy vehicles caused by discontinuous storage areas through innovative OTA methods, allowing applications to have a whole continuous and complete area for APP development. All OTA usage addresses, switching and mapping are completed in the Bootloader, and the APP can use the OTA function seamlessly.

[0112] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0113] The embodiment of the present application also provides a FOTA upgrade system based on a Flash SWAP chip, and the FOTA upgrade system based on a Flash SWAP chip is applied to a FOTA upgrade method based on a Flash SWAP chip in the above embodiment. The FOTA upgrade system based on a Flash SWAP chip includes:

[0114] A partition table, wherein the partition table comprises a first address block, a second address block, a third address block and a fourth address block, and the physical addresses of the first address block, the second address block, the third address block and the fourth address block are respectively increased in ascending order;

[0115] a program access address table, for storing, when in accordance with OTA configuration 1, addresses accessed by software programs as physical addresses of the second address block and the third address block; and, when in accordance with OTA configuration 2, addresses accessed by software programs as physical addresses of the first address block and the fourth address block;

[0116] An OTA hardware unit, used to complete the mapping between the physical address of the partition table and the address accessed by the software program;

[0117] Software program counter unit, used to trigger and run software programs.

[0118] For the specific definition of a FOTA upgrade system based on a Flash SWAP chip, please refer to the definition of a FOTA upgrade method based on a Flash SWAP chip in the above text, which will not be repeated here.

[0119] Each module in the above-mentioned FOTA upgrade system based on Flash SWAP chip can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.

[0120] In one embodiment, a computer device is provided, which may be a server. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, any one of the above-mentioned FOTA upgrade methods based on the FlashSWAP chip is implemented.

[0121] In one embodiment, a controller is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, any one of the above-mentioned FOTA upgrade methods based on the FlashSWAP chip is implemented.

[0122] In one embodiment, a controller software is provided, the controller software including a computer program, and when the computer program is executed by a processor, any one of the above-mentioned FOTA upgrade methods based on the Flash SWAP chip is implemented.

[0123] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. When the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0124] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.

Claims

1. A FOTA upgrade method based on Flash SWAP chip, characterized in that: The following steps are included: Presetting a partition table, wherein the partition table includes a first address block, a second address block, a third address block and a fourth address block, and the physical addresses of the first address block, the second address block, the third address block and the fourth address block are respectively increased in ascending order; When OTA configuration 1 is followed, the software program accesses the second address block and the third address block, and the addresses accessed by the software program are mapped to the physical addresses of the second address block and the third address block; When OTA configuration 2 is followed, the software program accesses the second address block and the third address block, and the addresses accessed by the software program are mapped to the physical addresses of the first address block and the fourth address block.

2. The FOTA upgrade method based on Flash SWAP chip according to claim 1, characterized in that, The following steps are also included: Activate OTA configuration 1, the software program counter unit starts counting, and the OTA hardware unit maps the physical addresses of the second address block and the third address block of the partition table to the program access address table.

3. The FOTA upgrade method based on Flash SWAP chip according to claim 1, characterized in that, The following steps are also included: When flashing is started, the physical addresses of the first address block and the fourth address block are flashed into the second address block and the third address block; Determine whether the flashing is successful; If the flashing is successful, after the backup program is enabled, OTA configuration 2 is activated, the software program counter unit starts counting, and the OTA hardware unit maps the physical addresses of the first address block and the fourth address block of the partition table to the program access address table.

4. The FOTA upgrade method based on Flash SWAP chip according to claim 3, characterized in that, When the second address block and the third address block are flushed with the physical addresses of the first address block and the fourth address block, the method includes: Based on the flash diagnostic protocol, the original software data in the second address block and the third address block is retained, and the software data of the backup program is received and written into the first address block and the fourth address block.

5. The FOTA upgrade method based on Flash SWAP chip according to claim 4, characterized in that, The following steps are also included: If the flashing fails, the OTA configuration remains unchanged, the software program counter unit starts counting, and the OTA hardware unit maps the physical addresses of the second address block and the third address block of the partition table to the program access address table.

6. The FOTA upgrade method based on Flash SWAP chip according to any one of claims 1 to 5, characterized in that: The following steps are also included: Use software update configuration manager to manage software data, update and delete software data, and retain software data records; Negotiate and distribute software upgrade packages with multiple software update configuration managers, and develop software upgrade strategies, including target software versions and their upgrade frequency, upgrade urgency, planned upgrade time, and assigned software update configuration managers; Determine the upgrade priority of each target software version of each software update configuration manager; Unify the upgrade tools and upgrade processes for each target software version; Based on the upgrade priority, the target software version information with high priority is distributed to the equipped software update configuration manager in the order of the proposed upgrade time from small to large, so as to complete the distribution of the software upgrade package; Feedback the distribution information of the software upgrade package to the main control module of the corresponding OTA hardware unit; According to the distribution information, the main control module of the OTA hardware unit downloads the distributed software upgrade package.

7. A FOTA upgrade system based on Flash SWAP chip, characterized in that: include, A partition table, wherein the partition table comprises a first address block, a second address block, a third address block and a fourth address block, and the physical addresses of the first address block, the second address block, the third address block and the fourth address block are respectively increased in ascending order; a program access address table, for storing, when in accordance with OTA configuration 1, addresses accessed by software programs as physical addresses of the second address block and the third address block; and, when in accordance with OTA configuration 2, addresses accessed by software programs as physical addresses of the first address block and the fourth address block; An OTA hardware unit, used to complete the mapping between the physical address of the partition table and the address accessed by the software program; Software program counter unit, used to trigger and run software programs.

8. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.

9. A controller, characterized in that: The controller stores a computer program, and when the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A controller software, characterized in that, The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 6 when being executed by a processor.

Citation Information

Patent Citations

  • Software upgrading method, device, system, storage medium, electronic equipment and vehicle

    CN109561118A

  • Automobile ECU cloud software upgrading method based on TC397 microcontroller address mapping

    CN114064077A

  • Construction method and device, upgrading method and medium

    CN114764338A

  • Application program upgrading method and device, electronic equipment and storage medium

    CN116360831A

  • Chip firmware upgrading system

    CN116560700A