Software upgrading method and device, equipment and storage medium
By adding external memory to the electronic controller and using the boot file switching software partition, the problem that the AB partition electronic controller cannot achieve sensorless upgrade after differential upgrade is solved, sensingless upgrade is achieved and rollback guarantee is provided, and user experience is improved.
Patent Information
- Application Number
- CN202411783040.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-12-05
AI Technical Summary
After the electronic controller of AB partition supports differential upgrade, it cannot achieve sensorless upgrade.
By adding external memory outside the internal memory of the electronic controller, saving and activate the same version of the software in the partition, and using the boot file to switch the software types in the inactivated partition and the activation partition, differential upgrade is achieved.
While ensuring that the differential upgrade process can be carried out invisibly, ensuring that the inactivated partition can provide rollback guarantees for the activated partition, improving the user experience of remote upgrades.
Smart Images

Figure CN119829109A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle-mounted terminal technology, and in particular to a software upgrading method, device, equipment and storage medium. Background Art
[0002] AB partition means that the entire software system (including the operating system) is divided into two independent partitions, A and B, and the software system can switch between partition A and partition B. Differential upgrade is to calculate the difference between the current version of the vehicle and the target version to obtain the differential package, which is sent to the vehicle end and restored with the current version for installation.
[0003] The electronic control unit (ECU) has achieved seamless flashing through AB partitions, which has greatly improved the experience of remote upgrades. However, with the rapid increase in the volume of cockpit and intelligent driving software, differential upgrades are imperative. For electronic controllers with AB partitions, the differential package is placed in the B partition, and the version must be restored based on the software version of the A partition. Since the software of the AB partitions is different, after the ECU supports differential upgrades, seamless upgrades cannot be achieved. Summary of the invention
[0004] Based on this, the present application provides a software upgrade method, device, equipment and storage medium to solve the problem that after the electronic controller of the AB partition supports differential upgrade, it is impossible to achieve seamless upgrade.
[0005] In a first aspect, a software upgrade method is provided, the method being applied to an electronic controller, the electronic controller comprising an internal memory and an external memory provided outside the internal memory, the internal memory comprising an activated partition and a non-activated partition; the method comprising:
[0006] In response to the electronic controller receiving the differential packet of the software to be upgraded, saving the differential packet to the external memory;
[0007] Determine the upgrade method of the software to be upgraded according to the software types of the software to be upgraded in the activation partition and the external memory, where the software types include the current version software;
[0008] When the upgrade mode of the software to be upgraded is differential upgrade, the latest version of the software is generated in the external memory according to the differential package and the current version of the software;
[0009] Based on the boot file of the internal memory, the latest version of the software in the external memory is switched from the inactive partition to the active partition;
[0010] According to the running status of the latest version of the software in the active partition, the software types in the external storage and the active partition are determined to facilitate the next software upgrade.
[0011] According to an achievable method in an embodiment of the present application, determining an upgrade method of the software to be upgraded according to the software type of the software to be upgraded in the activation partition and the external memory includes:
[0012] When the software types of the software to be upgraded contained in the activation partition and the external memory are the same, determining that the upgrade mode of the software to be upgraded is differential upgrade;
[0013] When the software types of the software to be upgraded contained in the active partition and the external memory are different, it is determined that the upgrade mode of the software to be upgraded is full upgrade.
[0014] According to an achievable method in an embodiment of the present application, based on a boot file in an internal memory, the latest version of software in an external memory is switched from an inactive partition to an active partition, including:
[0015] Copy the latest version of the software in the external storage to the inactive partition;
[0016] According to the boot file of the internal memory, the software types of the software to be upgraded in the inactive partition and the active partition are switched, so as to switch the latest version of the software in the external memory to the active partition.
[0017] According to an achievable method in an embodiment of the present application, switching the software type of the software to be upgraded in the inactive partition and the active partition according to the boot file of the internal memory includes:
[0018] According to the boot file in the internal memory, the latest version of the software in the inactive partition is switched to the active partition;
[0019] Switch the current version of the software in the active partition to the inactive partition.
[0020] According to an achievable method in an embodiment of the present application, determining the software type in the external memory and the activation partition according to the running status of the latest version of the software in the activation partition includes:
[0021] If the latest version of the software running in the activated partition is abnormal, the software type in the activated partition and the external storage device will be restored from the latest version of the software to the current version of the software.
[0022] According to an achievable method in an embodiment of the present application, restoring the latest version of software in the activation partition and the external memory to the current version of software includes:
[0023] Roll back the current version of the software in the inactive partition and the latest version of the software in the active partition, so that the latest version of the software in the active partition is restored to the current version of the software;
[0024] The current version of the software in the activation partition is synchronized to the external storage device, so that the latest version of the software in the external storage device is restored to the current version of the software.
[0025] According to an achievable method in an embodiment of the present application, determining the software type in the external memory and the activation partition according to the running status of the latest version of the software in the activation partition includes:
[0026] If the latest version of the software runs normally in the active partition, make sure that the software types in the external storage and the active partition are the latest version of the software.
[0027] In a second aspect, a software upgrade device is provided, the device is arranged in an electronic controller, the electronic controller includes an internal memory and an external memory additionally provided outside the internal memory, the internal memory includes an activated partition and a non-activated partition; the device includes:
[0028] A saving module, configured to save the differential package to an external memory in response to the electronic controller receiving the differential package of the software to be upgraded;
[0029] A determination module, used to determine the upgrade mode of the software to be upgraded according to the software types of the software to be upgraded in the activation partition and the external memory, where the software types include the current version software;
[0030] A generation module, used for generating the latest version of the software in the external memory according to the differential package and the current version of the software when the upgrade mode of the software to be upgraded is differential upgrade;
[0031] A switching module is used to switch the latest version of the software in the external memory from the inactive partition to the active partition based on the boot file of the internal memory;
[0032] The determination module is also used to determine the software types in the external memory and the activation partition according to the running status of the latest version of the software in the activation partition, so as to facilitate the next software upgrade.
[0033] In a third aspect, a computer device is provided, comprising:
[0034] at least one processor; and
[0035] a memory communicatively connected to the at least one processor; wherein,
[0036] The memory stores computer instructions that can be executed by the at least one processor, and the computer instructions are executed by the at least one processor to enable the at least one processor to perform the method involved in the first aspect above.
[0037] In a fourth aspect, a computer-readable storage medium is provided, on which computer instructions are stored, characterized in that the computer instructions are used to enable a computer to execute the method involved in the first aspect above.
[0038] According to the technical content provided by the embodiment of the present application, in response to the electronic controller receiving the differential package of the software to be upgraded, the differential package is saved to the external memory, and the upgrade mode of the software to be upgraded is determined according to the software type of the software to be upgraded in the activated partition and the external memory, and the software type includes the current version of the software. When the upgrade mode of the software to be upgraded is a differential upgrade, the latest version of the software is generated in the external memory according to the differential package and the current version of the software, and the latest version of the software in the external memory is switched from the non-activated partition to the activated partition based on the boot file of the internal memory, and the software type in the external memory and the activated partition is determined according to the running status of the latest version of the software in the activated partition, so as to facilitate the next software upgrade. By adding an external memory outside the internal memory of the electronic controller to store the same version of software as the activated partition, the hardware cost is low, and while ensuring that the differential upgrade process can be carried out without feeling, it also ensures that the non-activated partition can provide rollback protection for the activated partition, thereby improving the user experience of remote upgrade. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a block diagram of an electronic controller in one embodiment;
[0040] Figure 2 An application environment diagram of a software upgrade method in an embodiment;
[0041] Figure 3 A flowchart of a software upgrade method in one embodiment;
[0042] Figure 4 is a structural block diagram of a software upgrading device in one embodiment;
[0043] Figure 5 FIG. 4 is a schematic structural diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0044] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] AB partitioning is to divide the storage space of ECU into two independent areas, namely area A and area B. These two areas are physically or logically isolated to ensure the independence and security of data. Each area can store a complete software version and can run independently when needed.
[0046] Area A and Area B store different software versions respectively, which differ in content. This difference allows the ECU to selectively load and execute the software version in one of the areas during operation. If the currently running software version (such as Area A) has a problem or needs to be updated, the ECU can switch to the software version in another area (such as Area B) to continue running. This provides fault recovery capabilities to ensure that the normal operation of the vehicle is not affected. Through the AB partition, the ECU can achieve seamless software upgrades. During the upgrade process, the new software version can be downloaded and stored in an unused area (such as Area B), and then switched to the new version at the appropriate time.
[0047] Differential upgrade is to compare the differences between the new and old versions, and only transmit and update the changed part of the data to the target device. It is based on a differential algorithm that can accurately identify the differences between the two versions and generate a data packet containing these differences, namely a differential packet. After receiving the differential packet, the ECU stores it in an unused area, namely area B. When restoring the version, it needs to be restored based on the old version of the software in partition A. This process may involve operations such as replacing, modifying or adding files. After applying the differential package, the version is verified. After the verification passes, the ECU can switch to the new version of the software, that is, switch to area B. It is usually carried out at an appropriate time such as when the vehicle is turned off, restarted or in a specific maintenance cycle. The switching process needs to ensure the stability and reliability of the system to avoid affecting the normal operation of the vehicle. If the differential upgrade of the AB partition is performed during the normal operation of the vehicle, a senseless upgrade cannot be achieved.
[0048] For ease of understanding, the system to which this application is applicable is first described. The software upgrade method provided in this application can be applied to Figure 1The electronic controller shown. The electronic controller 100 includes an internal memory 111 and an external memory 112 added outside the internal memory 111. The internal memory 111 is a partitioned memory, including an active partition 111-1 and an inactive partition 111-2. The active partition 111-1 is equivalent to the A partition, and the inactive partition 111-2 is equivalent to the B partition. The external memory 112 can be an external flash. The electronic controller 100 is used to save the differential package to the external memory when receiving the differential package of the software to be upgraded. According to the software type of the software to be upgraded in the active partition and the external memory, the upgrade mode of the software to be upgraded is determined. The software type includes the current version of the software. When the upgrade mode of the software to be upgraded is differential upgrade, the latest version of the software is generated according to the differential package and the current version of the software. The external memory 112, the active partition 111-1 and the inactive partition 111-2 are used to store any version of the software to be upgraded during the upgrade process, wherein the active partition 111-1 is mainly used to store the software running in the system, and the inactive partition 111-2 is mainly used to store the software not running in the system, including the latest version of the software. The electronic controller 100 is used to copy the latest version of the software in the external memory 112 to the active partition 111-1 according to the boot file of the internal memory 111 and the inactive partition 111-2, and determine the software types in the external memory 112 and the active partition 111-1 according to the running status of the latest version of the software in the active partition 111-1, so as to facilitate the next software upgrade.
[0049] In such Figure 2 In the system architecture shown, the vehicle 200 includes an on-board terminal 210 , and the electronic controller 100 may be disposed in the on-board terminal 210 , wherein the on-board terminal 110 may be, but is not limited to, various personal computers and laptop computers connected to the vehicle.
[0050] Figure 3 A flowchart of a software upgrade method provided in an embodiment of the present application, the method can be performed as follows Figure 1 The electronic controller 100 shown in FIG. Figure 3 As shown, the method may include the following steps:
[0051] S310, in response to the electronic controller receiving the differential package of the software to be upgraded, saving the differential package to the external memory.
[0052] The software to be upgraded may be vehicle-related software, for example, software related to the cockpit and intelligent driving. When it is determined that the software needs to be upgraded, full upgrade and differential upgrade can be used. When differential upgrade is used, differential package is obtained by differential calculation based on the current version and target version of the vehicle in advance. The calculation process of differential package is to generate file snapshots of the current version and target version, determine the difference by comparing the files of the two versions, use file snapshots for comparison, identify the difference and generate differential package.
[0053] After the electronic controller receives the differential package of the software to be upgraded, it will perform differential upgrade on the software to be upgraded, save the differential package to the external memory, the software type in the external memory is consistent with the software type in the active partition, and the latest version of the software is restored based on the differential package and the current version of the software. Saving the differential package to the external memory can ensure that when restoring the latest version of the software, the software of the active partition and the inactive partition are different, and differential upgrade can be performed based on the current version of the software in the active partition.
[0054] S320: Determine an upgrade method for the software to be upgraded according to the activated partition and the software type of the software to be upgraded in the external memory.
[0055] The software type may include the current version software and the latest version software. The current version software is an older version software than the latest version software. The upgrade methods include differential upgrade and full upgrade. Since the generation of the latest version software needs to be based on the current version software and the differential package, if the software types in the active partition and the external storage are different versions of the software to be upgraded, differential upgrade cannot be performed, and full upgrade can be performed.
[0056] S330: When the upgrade mode of the software to be upgraded is differential upgrade, the latest version of the software is generated in the external memory according to the differential package and the current version of the software.
[0057] S340, based on the boot file in the internal memory, switching the latest version of the software in the external memory from the inactive partition to the active partition.
[0058] The boot file contains the necessary information and instructions for starting the operating system, such as the file address of the storage software package. It is mainly responsible for loading the operating system, ensuring that the system can boot correctly, and determining the system partition.
[0059] When performing a differential upgrade, first copy the latest version of the software in the external storage to the inactive partition, then switch the partition pointed to by the boot file, complete the switch between the active partition and the inactive partition, and update the software type of the active partition to the latest version of the software to achieve a differential upgrade.
[0060] S350, determining the software types in the external memory and the active partition according to the running status of the latest version of the software in the active partition, so as to facilitate the next software upgrade.
[0061] After the software to be upgraded is upgraded, the latest version of the software may not run normally, and its running status will affect the next software upgrade. To ensure that each software upgrade can proceed normally, the software type in the external storage and the active partition needs to be determined according to the running status of the latest version of the software. If the software type in the external storage and the active partition cannot accurately complete the software upgrade, the software type needs to be adjusted.
[0062] By adding an external memory outside the internal memory of the electronic controller to store the same version of software as the activated partition, the hardware cost is low. While ensuring that the differential upgrade process can be carried out seamlessly, it also ensures that the inactive partition can provide rollback protection for the active partition, thereby improving the user experience of remote upgrades.
[0063] As a feasible method, the upgrade method of the software to be upgraded is determined according to the software types of the software to be upgraded in the activated partition and the external memory, including:
[0064] When the software types of the software to be upgraded contained in the activation partition and the external memory are the same, determining that the upgrade mode of the software to be upgraded is differential upgrade;
[0065] When the software types of the software to be upgraded contained in the active partition and the external memory are different, it is determined that the upgrade mode of the software to be upgraded is full upgrade.
[0066] When the software types of the software to be upgraded contained in the active partition and the external memory are the same, it indicates that there is an old version of software matching the differential package in the external memory, and differential upgrade can be performed, and the upgrade mode of the software to be upgraded is determined to be differential upgrade.
[0067] When the software types of the software to be upgraded contained in the activation partition and the external memory are different, it indicates that there is no old version of the software matching the differential package in the external memory, and differential upgrade cannot be performed, and the upgrade method of the software to be upgraded is determined to be a full upgrade. By judging whether the software types of the software to be upgraded contained in the activation partition and the external memory are the same, the upgrade method of the software to be upgraded is determined, which can ensure that the software types of the software to be upgraded contained in the activation partition and the external memory are the same when the next differential upgrade is performed. Especially when performing a software version rollback, the software versions of the external memory and the activation partition must be synchronized, and this process takes time. In order to avoid incomplete synchronization before the next differential upgrade, differential upgrade is performed only when the software versions of the external memory and the activation partition are the same.
[0068] As an achievable method, based on the boot file of the internal memory, the latest version of the software in the external memory is switched from the inactive partition to the active partition, including:
[0069] Copy the latest version of the software in the external storage to the inactive partition;
[0070] According to the boot file of the internal memory, the software types of the software to be upgraded in the inactive partition and the active partition are switched, so as to switch the latest version of the software in the external memory to the active partition.
[0071] Since the software running in the active partition can be stopped according to user needs, and the software not running in the inactive partition can be started according to user needs, the switching between the active partition and the inactive partition can be achieved through the corresponding boot file in the internal memory. In other words, the software that is stopped in the active partition can be divided into the inactive partition, and the software that is started in the inactive partition can be divided into the active partition.
[0072] The current version of the software in the differential package and the external memory is restored to the latest version of the software and the installation is completed. After the external memory is flashed, the latest version of the software is copied to the inactive partition. At this time, the latest version of the software is the software that is not running, and the current version of the software is the running software. According to the boot file of the internal memory, the software type of the software to be upgraded in the inactive partition and the active partition is switched to achieve software upgrade or rollback in the inactive partition and the active partition.
[0073] Specifically, according to the file address of the software in the boot file of the internal memory, the latest version of the software in the inactive partition is switched to the active partition, and the current version of the software in the active partition is switched to the inactive partition. After the electronic controller restarts, the software update is completed. After the rollback occurs, the electronic controller needs to copy the software of the active partition to the external memory to facilitate the next differential upgrade.
[0074] As an achievable method, the software types in the external storage and the active partition are determined according to the running status of the latest version of the software in the active partition, including:
[0075] If the latest version of the software running in the activated partition is abnormal, the software type in the activated partition and the external storage device will be restored from the latest version of the software to the current version of the software.
[0076] If the latest version of the software runs abnormally in the activated partition, it means that the software cannot be used as the old version for the next software upgrade. The software type in the activated partition and the external storage device will be restored from the latest version of the software to the current version of the software.
[0077] Specifically, the current version of the software in the inactive partition is rolled back with the latest version of the software in the active partition, so that the latest version of the software in the active partition is restored to the current version of the software, and the current version of the software in the active partition is synchronized to the external memory, so that the latest version of the software in the external memory is restored to the current version of the software. At this time, the software in the active partition and the external memory are the same version, which is convenient for the next differential upgrade, and the inactive partition is the previous version, which is convenient for software rollback.
[0078] As an achievable method, the software types in the external storage and the active partition are determined according to the running status of the latest version of the software in the active partition, including:
[0079] If the latest version of the software runs normally in the active partition, make sure that the software types in the external storage and the active partition are the latest version of the software.
[0080] If the latest version of the software runs normally in the activated partition, it indicates that this version of the software can be used as the old version of the software for the next software upgrade. The latest version of the software is retained in the external storage and the activated partition for the next differential upgrade.
[0081] It should be understood that although Figure 3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in the application, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 3 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0082] Figure 4 A schematic diagram of a software upgrade device provided in an embodiment of the present application, which can be arranged in Figure 1 The electronic controller 100 shown is used to perform the following Figure 3 The method flow shown in Figure 4 As shown, the software upgrade device 400 may include: a storage module 410, a determination module 420, a generation module 430 and a switching module 440. The main functions of each component module are as follows:
[0083] A saving module 410 is used for saving the differential package to an external memory in response to the electronic controller receiving the differential package of the software to be upgraded;
[0084] The determination module 420 is used to determine the upgrade mode of the software to be upgraded according to the software types of the software to be upgraded in the activated partition and the external memory, where the software types include the current version software;
[0085] The generating module 430 is used to generate the latest version of the software in the external memory according to the differential package and the current version of the software when the upgrade mode of the software to be upgraded is differential upgrade;
[0086] A switching module 440, for switching the latest version of the software in the external memory from the inactive partition to the active partition based on the boot file of the internal memory;
[0087] The determination module 420 is further used to determine the software types in the external memory and the active partition according to the running status of the latest version of the software in the active partition, so as to facilitate the next software upgrade.
[0088] As an achievable method, determination module 420 is specifically used to determine that the upgrade method of the software to be upgraded is a differential upgrade when the software types of the software to be upgraded contained in the activated partition and the external memory are the same; when the software types of the software to be upgraded contained in the activated partition and the external memory are different, determine that the upgrade method of the software to be upgraded is a full upgrade.
[0089] As an implementable method, the switching module 440 is specifically used to: copy the latest version of the software in the external memory to the inactive partition; according to the boot file of the internal memory, switch the software type of the software to be upgraded in the inactive partition and the active partition to switch the latest version of the software in the external memory to the active partition.
[0090] As an implementable manner, the switching module 440 is specifically used to: switch the latest version of software in the inactive partition to the active partition according to the boot file in the internal memory; switch the current version of software in the active partition to the inactive partition.
[0091] As an implementable manner, the determination module 420 is further specifically used to: if the latest version of the software running in the activated partition is abnormal, restore the software type in the activated partition and the external memory from the latest version of the software to the current version of the software.
[0092] As an achievable method, module 420 is determined to be specifically used to: roll back the current version software in the inactive partition and the latest version software in the active partition so that the latest version software in the active partition is restored to the current version software; synchronize the current version software in the active partition to the external memory so that the latest version software in the external memory is restored to the current version software.
[0093] As an implementable manner, the determination module 420 is further specifically used to: if the activation partition runs the latest version of the software normally, determine that the software types in the external memory and the activation partition are both the latest version of the software.
[0094] It is to be understood that the implementation of any method or product of the present application does not necessarily require all of the advantages described above to be achieved at the same time.
[0095] The same or similar parts between the above embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0096] It should be noted that the embodiments of the present application may involve the use of user data. In actual applications, user-specific personal data can be used in the scheme described in this article within the scope permitted by applicable laws and regulations, provided that the applicable laws and regulations of the country are met (for example, the user's explicit consent, effective notification to the user, and the user's explicit authorization, etc.).
[0097] According to an embodiment of the present application, the present application also provides a computer device and a computer-readable storage medium.
[0098] like Figure 5 , is a block diagram of a computer device according to an embodiment of the present application. The computer device is intended to represent various forms of digital computers or mobile devices. The digital computer may include a desktop computer, a portable computer, a workbench, a personal digital assistant, a server, a mainframe computer, and other suitable computers. The mobile device may include a tablet computer, a smart phone, a wearable device, etc.
[0099] like Figure 5 As shown, the computer device 500 includes a computing unit 501, a ROM 502, a RAM 503, a bus 504, and an input / output (I / O) interface 505, and the computing unit 501, the ROM 502, and the RAM 503 are connected to each other through the bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0100] The computing unit 501 can perform various processes in the method embodiment of the present application according to the computer instructions stored in the read-only memory (ROM) 502 or the computer instructions loaded from the storage unit 508 to the random access memory (RAM) 503. The computing unit 501 can be various general and / or special processing components with processing and computing capabilities. The computing unit 501 may include, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. In some embodiments, the method provided in the embodiment of the present application can be implemented as a computer software program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 508.
[0101] The RAM 503 may also store various programs and data required for the operation of the computer device 500. Part or all of the computer program may be loaded and / or installed on the computer device 500 via the ROM 502 and / or the communication unit 509.
[0102] The input unit 506, output unit 507, storage unit 508 and communication unit 509 in the computer device 500 can be connected to the I / O interface 505. The input unit 506 can be, for example, a keyboard, a mouse, a touch screen, a microphone, etc. The output unit 507 can be, for example, a display, a speaker, an indicator light, etc. The computer device 500 can exchange information, data, etc. with other devices through the communication unit 509.
[0103] It should be noted that the device may also include other components necessary for normal operation, or may only include components necessary for implementing the solution of the present application, rather than all the components shown in the figure.
[0104] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof.
[0105] The computer instructions for implementing the method of the present application can be written in any combination of one or more programming languages. These computer instructions can be provided to the computing unit 501, so that when the computer instructions are executed by the computing unit 501 such as a processor, the steps involved in the method embodiment of the present application are executed.
[0106] The computer-readable storage medium provided in the present application may be a tangible medium that may contain or store computer instructions for executing the steps involved in the method embodiments of the present application. The computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, and other forms of storage media.
[0107] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A software upgrade method, characterized in that: The method is applied to an electronic controller, the electronic controller includes an internal memory and an external memory added outside the internal memory, the internal memory includes an activated partition and a non-activated partition; the method includes: In response to the electronic controller receiving a differential packet of software to be upgraded, saving the differential packet to the external memory; Determining an upgrade mode of the software to be upgraded according to the activation partition and the software type of the software to be upgraded in the external memory, wherein the software type includes the current version software; When the upgrade mode of the software to be upgraded is differential upgrade, generating the latest version of the software in the external memory according to the differential package and the current version of the software; Based on the boot file of the internal memory, switching the latest version of the software in the external memory from the inactive partition to the active partition; According to the running status of the latest version of the software in the active partition, the software types in the external memory and the active partition are determined to facilitate the next software upgrade.
2. The method according to claim 1, characterized in that The step of determining the upgrade mode of the software to be upgraded according to the activation partition and the software type of the software to be upgraded in the external memory includes: When the software types of the software to be upgraded contained in the activation partition and the external memory are the same, determining that the upgrade mode of the software to be upgraded is differential upgrade; When the software types of the software to be upgraded contained in the activation partition and the external memory are different, it is determined that the upgrade mode of the software to be upgraded is full upgrade.
3. The method according to claim 1, characterized in that The step of switching the latest version of the software in the external memory from the inactive partition to the active partition based on the boot file in the internal memory includes: Copying the latest version of the software in the external memory to the inactive partition; According to the boot file of the internal memory, the software types of the software to be upgraded in the inactive partition and the active partition are switched to switch the latest version of the software in the external memory to the active partition.
4. The method according to claim 3, characterized in that The step of switching the software types of the software to be upgraded in the inactive partition and the active partition according to the boot file of the internal memory includes: According to the boot file of the internal memory, the latest version of the software in the inactive partition is switched to the active partition; The current version of the software in the active partition is switched to the inactive partition.
5. The method according to claim 1, characterized in that The step of determining the software types in the external memory and the active partition according to the running status of the latest version of the software in the active partition comprises: If the activation partition runs the latest version of the software abnormally, the software types in the activation partition and the external memory are restored from the latest version of the software to the current version of the software.
6. The method according to claim 5, characterized in that The step of restoring the latest version of software in the activation partition and the external memory to the current version of software includes: Rolling back the current version of the software in the inactive partition and the latest version of the software in the active partition, so that the latest version of the software in the active partition is restored to the current version of the software; The current version software in the activation partition is synchronized to the external memory so that the latest version software in the external memory is restored to the current version software.
7. The method according to claim 5, characterized in that The step of determining the software types in the external memory and the active partition according to the running status of the latest version of the software in the active partition comprises: If the active partition runs the latest version of the software normally, it is determined that the software types in the external memory and the active partition are both the latest version of the software.
8. A software upgrade device, characterized in that: The device is arranged in an electronic controller, the electronic controller comprises an internal memory and an external memory provided outside the internal memory, the internal memory comprises an activated partition and a non-activated partition; the device comprises: a saving module, configured to save the differential package to the external memory in response to the electronic controller receiving the differential package of the software to be upgraded; A determination module, used to determine the upgrade mode of the software to be upgraded according to the activation partition and the software type of the software to be upgraded in the external memory, wherein the software type includes the current version software; A generating module, used for generating the latest version of the software in the external memory according to the differential package and the current version of the software when the upgrade mode of the software to be upgraded is differential upgrade; A switching module, used for switching the latest version of the software in the external memory from the inactive partition to the active partition based on the boot file of the internal memory; The determination module is further used to determine the software types in the external memory and the activation partition according to the running status of the latest version of the software in the activation partition, so as to facilitate the next software upgrade.
9. A computer device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores computer instructions that can be executed by the at least one processor, and the computer instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: The computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Embedded software upgrading mode switching method and device, equipment and medium
CN114253574A
OTA upgrading method and device, electronic equipment and readable storage medium
CN114816495A
OTA upgrading method and device, electronic equipment and storage medium
CN115951914A
Firmware upgrading method and device for security chip, security chip, electronic equipment and computer readable storage medium
CN117687651A
Cited By
Bus bar power supply controller software online loading method and system
CN121579048A