A software upgrading method, device, equipment and storage medium
By adding external storage to the electronic controller and using boot files to switch partition software types, the problem of AB partition electronic controllers being unable to be upgraded seamlessly was solved, enabling seamless differential upgrades and rollback protection, and improving the user experience.
Patent Information
- Application Number
- CN202411783040.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2044-12-05
AI Technical Summary
The electronic controllers in the AB partitions cannot achieve seamless upgrades after differential upgrades, resulting in a poor software upgrade experience.
An external storage device is added to the electronic controller. The latest version of the software is generated by using a differential package and the current version of the software. The boot file of the internal storage is used to switch the software type between the inactive partition and the active partition to achieve differential upgrade or full upgrade, ensuring that the software type of the active partition and the external storage is consistent.
It enables seamless software upgrades during differential upgrades, reduces hardware costs, and provides rollback protection for inactive partitions, improving the user experience of remote upgrades.
Smart Images

Figure CN119829109B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicle terminal, in particular to a software upgrading method and device, equipment and storage medium. BACKGROUND
[0002] AB partition refers to that the entire software system (including the operating system) is divided into A and B two independent partitions, and the software system can be switched between the A partition and the B partition. The differential upgrade is to calculate the difference package according to the current version and the target version of the vehicle, and the difference package is sent to the vehicle end and installed with the current version.
[0003] The electronic controller (Electronic Control Unit, ECU) realizes no-sense writing through AB partition, which greatly improves the experience of remote upgrade, but with the rapid increase of software volume of cockpit and intelligent driving, differential upgrade is inevitable. For the AB partition electronic controller, the difference package is placed in the B partition, and the version restoration needs to be restored based on the software version of the A partition. Since the software of the AB partition is not the same, after the ECU supports differential upgrade, no-sense upgrade cannot be realized. SUMMARY
[0004] Therefore, the present application provides a software upgrading method, device, equipment and storage medium to solve the problem that the AB partition electronic controller cannot realize no-sense upgrade after supporting differential upgrade.
[0005] In a first aspect, a software upgrading method is provided, which 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 active partition and an inactive partition. The method includes the following steps:
[0006] In response to the electronic controller receiving a difference package of software to be upgraded, the difference package is saved to the external memory;
[0007] According to the software type of the software to be upgraded in the active partition and the external memory, the upgrading mode of the software to be upgraded is determined, and the software type includes the current version software;
[0008] When the upgrading mode of the software to be upgraded is differential upgrade, the latest version software is generated in the external memory according to the difference package and the current version software;
[0009] Based on the boot file of the internal memory, the latest version software in the external memory is switched from the inactive partition to the active partition;
[0010] According to the running state of the latest version software in the active partition, the software type in the external memory and the active partition is determined, so as to facilitate the next software upgrade.
[0011] According to an implementable manner in the embodiments of the present application, the upgrade mode of the software to be upgraded is determined according to the activated partition and the software type of the software to be upgraded in the external memory, and the upgrade mode of the software to be upgraded comprises:
[0012] When the activated partition and the software type of the software to be upgraded in the external memory are the same, the upgrade mode of the software to be upgraded is determined as differential upgrade;
[0013] When the activated partition and the software type of the software to be upgraded in the external memory are different, the upgrade mode of the software to be upgraded is determined as full upgrade.
[0014] According to an implementable manner in the embodiments of the present application, the latest version 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 switching comprises:
[0015] The latest version software in the external memory is copied to the non-activated partition;
[0016] The software type of the software to be upgraded in the non-activated partition and the activated partition is switched according to the boot file of the internal memory, so as to switch the latest version software in the external memory to the activated partition.
[0017] According to an implementable manner in the embodiments of the present application, the software type of the software to be upgraded in the non-activated partition and the activated partition is switched according to the boot file of the internal memory, and the switching comprises:
[0018] The latest version software in the non-activated partition is switched to the activated partition according to the boot file of the internal memory;
[0019] The current version software in the activated partition is switched to the non-activated partition.
[0020] According to an implementable manner in the embodiments of the present application, the software type in the external memory and the activated partition is determined according to the running state of the latest version software in the activated partition, and the determining comprises:
[0021] If the activated partition runs the latest version software abnormally, the software type in the activated partition and the external memory is restored from the latest version software to the current version software.
[0022] According to an implementable manner in the embodiments of the present application, the latest version software in the activated partition and the external memory is restored to the current version software, and the restoring comprises:
[0023] The current version software in the non-activated partition is rolled back with the latest version software in the activated partition, so as to restore the latest version software in the activated partition to the current version software;
[0024] The current version software in the activated partition is synchronized to the external memory, so as to restore the latest version software in the external memory to the current version software.
[0025] According to an implementable manner in the embodiments of the present application, the software types in the external memory and the active partition are determined according to the running state of the latest version software in the active partition, including:
[0026] If the active partition runs the latest version software normally, it is determined that the software types in the external memory and the active partition are both the latest version software.
[0027] In a second aspect, a software upgrading device is provided, which is arranged in an electronic controller, the electronic controller including an internal memory and an external memory additionally arranged outside the internal memory, the internal memory including an active partition and an inactive partition; the device includes:
[0028] 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;
[0029] A determining module, configured to determine an upgrading manner of the software to be upgraded according to software types of the software to be upgraded in the active partition and the external memory, the software types including a current version software;
[0030] A generating module, configured to generate the latest version software in the external memory according to the differential package and the current version software when the upgrading manner of the software to be upgraded is differential upgrading;
[0031] A switching module, configured to switch the latest version software in the external memory from the inactive partition to the active partition based on a boot file of the internal memory;
[0032] The determining module is further configured to determine the software types in the external memory and the active partition according to a running state of the latest version software in the active partition, so as to facilitate next software upgrading.
[0033] In a third aspect, a computer device is provided, including:
[0034] at least one processor; and
[0035] a memory in communication connection with the at least one processor; wherein
[0036] the memory stores computer instructions executable 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 execute the method involved in the first aspect.
[0037] In a fourth aspect, a computer readable storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a computer to execute the method involved in the first aspect.
[0038] According to the technical content provided in the embodiments 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, the upgrade mode of the software to be upgraded is determined according to the activation partition and the software type of the software to be upgraded in the external memory, the software type includes the current version software, when the upgrade mode of the software to be upgraded is differential upgrade, the latest version software is generated in the external memory according to the differential package and the current version software, the latest version software in the external memory is switched from the non-activation partition to the activation partition based on the boot file of the internal memory, and the software type in the external memory and the activation partition is determined according to the running state of the latest version software in the activation partition, so as to facilitate the next software upgrade. By adding the external memory outside the internal memory of the electronic controller for storing the same version software as the activation partition, the hardware cost is low, the differential upgrade process can be performed without feeling, and at the same time, the non-activation partition can provide rollback guarantee for the activation partition, and the user experience of remote upgrade is improved. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 The structure block diagram of the electronic controller in an embodiment is shown in FIG. 1.
[0040] Figure 2 The application environment diagram of the software upgrade method in an embodiment is shown in FIG. 2.
[0041] Figure 3 The flowchart of the software upgrade method in an embodiment is shown in FIG. 3.
[0042] Figure 4 The structure block diagram of the software upgrade device in an embodiment is shown in FIG. 4.
[0043] Figure 5 The schematic structure diagram of the computer device in an embodiment is shown in FIG. 5. DETAILED DESCRIPTION
[0044] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0045] The AB partition is to divide the storage space of the ECU into two independent areas, i.e. A area and B area. The 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] A and B zones store different software versions, which differ in content. This difference allows the ECU to selectively load and execute the software version of one of the zones at runtime. If the currently running software version (e.g. A zone) has problems or needs to be updated, the ECU can switch to the software version of the other zone (e.g. B zone) to continue running. This provides the ability of fault recovery, ensuring the normal operation of the vehicle is not affected. Through AB partitioning, the ECU can achieve seamless software upgrades. During the upgrade process, the new software version can be downloaded and stored in the unused zone (e.g. B zone), and then switched to the new version for running at the appropriate time.
[0047] The differential upgrade is to compare the differences between the old and new 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, i.e. a differential packet. After the ECU receives the differential packet, it is stored in the unused zone, i.e. B zone. The version restoration needs to be based on the old version software of A partition, and this process may involve file replacement, modification or addition, etc. After applying the differential packet, version verification is performed, and after verification, the ECU can switch to the new version software for running, i.e. switch to B zone. Usually, it is done at the appropriate time such as vehicle shutdown, restart or specific maintenance period, and 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 AB partitioning is performed during the normal operation of the vehicle, it cannot achieve no-sense upgrade.
[0048] For ease of understanding, first describe the system to which the present application is applicable. The software upgrade method provided by the present application can be applied to, for example Figure 1As shown in the electronic controller, wherein the electronic controller 100 comprises an internal memory 111 and an external memory 112 added outside the internal memory 111, the internal memory 111 is a partitioned memory, comprising an active partition 111-1 and an inactive partition 111-2, the active partition 111-1 corresponds to the A partition, and the inactive partition 111-2 corresponds to the B partition, and 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, determine the upgrading mode 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 software type comprises the current version software, and when the upgrading mode of the software to be upgraded is differential upgrading, generate the latest version software according to the differential package and the current version software. The external memory 112, the active partition 111-1 and the inactive partition 111-2 are used to store any version software of the software to be upgraded in the upgrading 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, which comprises the latest version software. The electronic controller 100 is used to copy the latest version 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 type in the external memory 112 and the active partition 111-1 according to the running state of the latest version software in the active partition 111-1, so as to facilitate the next software upgrading.
[0049] In the system architecture as shown in the figure, Figure 2 In the system architecture as shown in the figure, the vehicle 200 comprises a vehicle terminal 210, and the electronic controller 100 can be arranged in the vehicle terminal 210, wherein the vehicle terminal 210 can be, but is not limited to, various personal computers, notebook computers connected with the vehicle.
[0050] Figure 3 A flowchart of a software upgrading method provided by the embodiment of the application, which can be executed by the electronic controller 100 as shown in the figure. Figure 1 As shown in the figure, the method can comprise the following steps: Figure 3 As shown in the figure, the method can comprise 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 to-be-upgraded software can be software related to the vehicle, 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 adopted. When differential upgrade is adopted, a differential package is obtained by performing differential calculation according to the current version and the target version of the vehicle in advance. The calculation process of the differential package is to generate file snapshots of the current version and the target version, to determine the differential part by comparing the files of the two versions, to identify the differential part by using the file snapshots, and to generate the differential package.
[0053] After the electronic controller receives the differential package of the to-be-upgraded software, the to-be-upgraded software is differentially upgraded, the differential package is saved to the external storage, the software type in the external storage is consistent with the software type in the active partition, and the latest version software is restored based on the differential package and the current version software. Saving the differential package to the external storage can ensure that the latest version software is restored, that is, the software in the active partition and the non-active partition is different, and that the current version software in the active partition can be differentially upgraded.
[0054] S320, according to the software type of the to-be-upgraded software in the active partition and the external storage, determining the upgrade mode of the to-be-upgraded software.
[0055] The software type can include the current version software and the latest version software, and the current version software is an old version software compared with the latest version software. The upgrade mode includes 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 to-be-upgraded software, differential upgrade cannot be performed, and full upgrade can be performed.
[0056] S330, when the upgrade mode of the to-be-upgraded software is differential upgrade, generating the latest version software in the external storage according to the differential package and the current version software.
[0057] S340, based on the boot file of the internal storage, switching the latest version software in the external storage from the non-active partition to the active partition.
[0058] The boot file contains necessary information and instructions for starting the operating system, such as the file address of the software package, and is mainly responsible for loading the operating system to ensure that the system can correctly perform the boot process and can determine the system partition.
[0059] When differential upgrade is performed, the latest version software in the external storage is first copied to the non-active partition, and then the partition pointed to by the boot file is switched, the switching between the active partition and the non-active partition is completed, the software type of the active partition is updated to the latest version software, and differential upgrade is realized.
[0060] S350, according to the running state of the latest version software in the active partition, determining the software type in the external memory and the active partition, so as to facilitate the next software upgrade.
[0061] After the software to be upgraded completes the upgrade, the latest version software may not run normally, and the running state thereof affects the next software upgrade. In order to ensure that each software upgrade can be performed normally, the software type in the external memory and the active partition needs to be determined according to the running state of the latest version software. If the software type in the external memory and the active partition cannot accurately complete the software upgrade, the software type needs to be adjusted.
[0062] By additionally arranging the external memory outside the internal memory of the electronic controller to store the same version software as the active partition, the hardware cost is low, and in the meanwhile, it ensures that the differential upgrade process can be performed without sensing and ensures that the non-active partition can provide rollback protection for the active partition, thereby improving the user experience of remote upgrade.
[0063] As an implementable manner, 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, comprising:
[0064] When the software type of the software to be upgraded in the active partition and the external memory is the same, the upgrade mode of the software to be upgraded is determined as differential upgrade.
[0065] When the software type of the software to be upgraded in the active partition and the external memory is different, the upgrade mode of the software to be upgraded is determined as full upgrade.
[0066] When the software type of the software to be upgraded in the active partition and the external memory is the same, it indicates that the old version software matching the differential package exists in the external memory, and differential upgrade can be performed, and the upgrade mode of the software to be upgraded is determined as differential upgrade.
[0067] When the software type of the software to be upgraded in the active partition and the external memory is different, it indicates that the old version software matching the differential package does not exist in the external memory, and differential upgrade cannot be performed, and the upgrade mode of the software to be upgraded is determined as full upgrade. By judging whether the software type of the software to be upgraded in the active partition and the external memory is the same, the upgrade mode of the software to be upgraded can be determined, so as to ensure that the software type of the software to be upgraded in the active partition and the external memory is the same when the next differential upgrade is performed. Especially when the software version is rolled back, the software versions of the external memory and the active partition need to be synchronized, and this process needs time. In order to avoid that the synchronization is not completed before the next differential upgrade, the differential upgrade is performed only when the software versions of the external memory and the active partition are the same.
[0068] As an implementable manner, based on the boot file of the internal memory, the latest version software in the external memory is switched from the non-activated partition to the activated partition, including:
[0069] copying the latest version software in the external memory to the non-activated partition;
[0070] switching the software types of the software to be upgraded in the activated partition and the non-activated partition according to the boot file of the internal memory, so as to switch the latest version software in the external memory to the activated partition.
[0071] Since the software running in the activated partition can be stopped according to user demand, and the software not running in the non-activated partition can be started according to user demand, the switching of the activated partition and the non-activated partition can be realized through the corresponding boot file of the internal memory, that is, the software stopped running in the activated partition can be divided to the non-activated partition, and the software started running in the non-activated partition can be divided to the activated partition.
[0072] restoring the differential package and the current version software in the external memory to the latest version software, and completing installation. After the external memory is written, the latest version software is copied to the non-activated partition. At this time, the latest version software is the software not running, and the current version software is the software running. According to the boot file of the internal memory, the software types of the software to be upgraded in the activated partition and the non-activated partition are switched, so as to realize the software upgrade or rollback in the activated partition and the non-activated partition.
[0073] Specifically, according to the file address of the software in the boot file of the internal memory, the latest version software in the non-activated partition is switched to the activated partition, and the current version software in the activated partition is switched to the non-activated partition. After the electronic controller is restarted, the software completes updating. When rollback occurs, the electronic controller needs to copy the software in the activated partition to the external memory, so as to facilitate the differential upgrade next time.
[0074] As an implementable manner, according to the running state of the latest version software in the activated partition, the software types in the external memory and the activated partition are determined, including:
[0075] If the activated partition runs the latest version software abnormally, the software types in the activated partition and the external memory are restored from the latest version software to the current version software.
[0076] If the activated partition runs the latest version software abnormally, it indicates that the software of this version cannot be used as the old version software for next software upgrade. The software types in the activated partition and the external memory are restored from the latest version software to the current version software.
[0077] Specifically, the current version of the software in the inactive partition and the latest version of the software in the active partition are rolled back, so that the latest version of the software in the active partition is restored to the current version. The current version of the software in the active partition is then synchronized to the external storage, so that the latest version of the software in the external storage is restored to the current version. At this point, the software in the active partition and the external storage is the same version, which facilitates the next differential upgrade, while the inactive partition contains the previous version, which facilitates software rollback.
[0078] As one feasible approach, the software types in the external storage and the active partition are determined based on the running status of the latest version of the software within the active partition, including:
[0079] If the latest version of the software runs normally on the active partition, it confirms that both the external storage and the software in the active partition are the latest versions.
[0080] If the latest version of the software runs normally on the active partition, it means that this version of the software can be used as the old version for the next software upgrade. The latest version of the software is kept in the external storage and the active partition to facilitate the next differential upgrade.
[0081] It should be understood that, although Figure 3 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this application, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Furthermore, Figure 3 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed 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 some of the sub-steps or stages of other steps.
[0082] Figure 4 This is a schematic diagram of a software upgrade device provided in an embodiment of this application. The device can be disposed in... Figure 1 The electronic controller 100 shown is used to perform, for example... Figure 3 The method flow is shown below. Figure 4 As shown, the software upgrade device 400 may include: a save module 410, a determine module 420, a generate module 430, and a switch module 440. The main functions of each component module are as follows:
[0083] The storage module 410 is used to save the differential packet to external storage in response to the electronic controller receiving the differential packet of the software to be upgraded;
[0084] The determining module 420 is configured to determine an upgrade mode of the software to be upgraded according to the activated partition and the software type of the software to be upgraded in the external memory, and the software type includes the current version software.
[0085] The generating module 430 is configured to generate the latest version software in the external memory according to the differential package and the current version software when the upgrade mode of the software to be upgraded is the differential upgrade.
[0086] The switching module 440 is configured to switch the latest version software in the external memory from the non-activated partition to the activated partition based on the boot file of the internal memory.
[0087] The determining module 420 is further configured to determine the software type in the external memory and the activated partition according to a running state of the latest version software in the activated partition, so as to facilitate next software upgrade.
[0088] As an implementable manner, the determining module 420 is specifically configured to determine that the upgrade mode of the software to be upgraded is the differential upgrade when the activated partition and the external memory contain the same software type of the software to be upgraded, and determine that the upgrade mode of the software to be upgraded is the full upgrade when the activated partition and the external memory contain different software types of the software to be upgraded.
[0089] As an implementable manner, the switching module 440 is specifically configured to copy the latest version software in the external memory to the non-activated partition, and switch the software type of the software to be upgraded in the non-activated partition and the activated partition according to the boot file of the internal memory, so as to switch the latest version software in the external memory to the activated partition.
[0090] As an implementable manner, the switching module 440 is specifically configured to switch the latest version software in the non-activated partition to the activated partition according to the boot file of the internal memory, and switch the current version software in the activated partition to the non-activated partition.
[0091] As an implementable manner, the determining module 420 is further specifically configured to restore the software type in the activated partition and the external memory from the latest version software to the current version software if the activated partition abnormally runs the latest version software.
[0092] As an implementable manner, the determining module 420 is specifically configured to roll back the current version software in the non-activated partition and the latest version software in the activated partition, so as to restore the latest version software in the activated partition to the current version software, and synchronize the current version software in the activated partition to the external memory, so as to restore the latest version software in the external memory to the current version software.
[0093] As an implementable manner, the determining module 420 is further specifically configured to determine that the software type in the external storage and the software type in the active partition are both the latest version software if the activation of the partition running the latest version software is normal.
[0094] It can be understood that implementing any of the methods or products of the present application does not necessarily require all the advantages described above to be achieved at the same time.
[0095] The same or similar parts among the above various embodiments can be mutually referred to, and each embodiment focuses on the difference from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.
[0096] It should be noted that the embodiments of the present application can involve the use of user data. In actual application, user-specific personal data can be used in the schemes described herein in the range allowed by applicable laws and regulations, for example, the user has given explicit consent, the user has been explicitly notified, the user has given explicit authorization, and the like.
[0097] According to the embodiments of the present application, the present application further provides a computer device and a computer readable storage medium.
[0098] As shown in Figure 5 , it 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 can include a desktop computer, a portable computer, a workstation, a personal digital assistant, a server, a mainframe computer, and other suitable computers. The mobile device can include a tablet computer, a smart phone, a wearable device, and the like.
[0099] As shown in Figure 5 , 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. 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 embodiments of the method of the present application according to computer instructions stored in the read-only memory (ROM) 502 or loaded from the storage unit 508 into the random access memory (RAM) 503. The computing unit 501 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. The computing unit 501 can include, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. In some embodiments, the method provided by the embodiments of the present application can be implemented as a computer software program, which is tangibly contained in a computer readable storage medium, such as the storage unit 508.
[0101] The RAM 503 can also store various programs and data required for the operation of the computer device 500. Part or all of the computer program can 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, the output unit 507, the storage unit 508 and the communication unit 509 in the computer device 500 can be connected to the I / O interface 505. Among them, the input unit 506 can be, such as a keyboard, a mouse, a touch screen, a microphone, etc.; the output unit 507 can be, such as 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 can also include other components necessary for normal operation. It can also only contain components necessary to implement the scheme of the present application, and does not have to contain all the components shown in the figure.
[0104] Various embodiments of the systems and techniques described here can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), an application specific standard product (ASSP), a system on a chip system (SOC), a programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof.
[0105] 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 the computer instructions, when executed by the computing unit 501 such as a processor, cause the steps involved in the embodiments of the method of the present application to be performed.
[0106] The computer-readable storage medium provided in this application can be a tangible medium that can contain or store computer instructions for performing the steps involved in the method embodiments of this application. The computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, and other forms of storage media.
[0107] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand 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 within the scope of protection of this application.
Claims
1. A software upgrade method, characterized in that, The method is applied to an electronic controller, the electronic controller including internal memory and external memory added outside the internal memory, the internal memory including active and inactive partitions; the method includes: In response to the electronic controller receiving a differential packet for the software to be upgraded, the differential packet is saved to the external storage. Based on the activated partition and the software type of the software to be upgraded in the external storage, the upgrade method of the software to be upgraded is determined, wherein the software type includes the current version of the software and the latest version of the software; When the upgrade method of the software to be upgraded is differential upgrade, the latest version of the software is generated in the external storage according to the differential package and the current version of the software; Based on the boot file in the internal memory, the latest version of the software in the external memory is switched from the inactive partition to the active partition; Based on the running status of the latest version of the software in the activated partition, determine the software type in the external storage and the activated partition to facilitate the next software upgrade; The step of determining the upgrade method of the software to be upgraded based on the active partition and the software type of the software to be upgraded in the external storage includes: when the active partition and the external storage contain the same software type of the software to be upgraded, the upgrade method of the software to be upgraded is determined to be differential upgrade; The step of determining the software type in the external storage and the active partition based on the running status of the latest version software in the active partition includes: if the active partition is abnormally running the latest version software, restoring the software type in the active partition and the external storage from the latest version software to the current version software.
2. The method according to claim 1, characterized in that, The step of determining the upgrade method for the software to be upgraded based on the activated partition and the software type of the software to be upgraded in the external storage includes: When the active partition contains a different type of software than the external storage containing the software to be upgraded, the upgrade method for the software to be upgraded is determined to be a full upgrade.
3. The method according to claim 1, characterized in that, The method of switching the latest version of the software in the external storage from the inactive partition to the active partition based on the boot file in the internal storage includes: Copy the latest version of the software from the external storage to the inactive partition; According to the boot file in the internal memory, the software type of the software to be upgraded in the inactive partition and the active partition is switched so as 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 type of the software to be upgraded in the inactive partition and the active partition according to the boot file in the internal memory includes: 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; Switch the current version of the software in the active partition to the inactive partition.
5. The method according to claim 1, characterized in that, The step of restoring the latest version of the software in the active partition and the external storage to the current version includes: 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; The current version of the software in the active partition is synchronized to the external storage, so that the latest version of the software in the external storage is restored to the current version of the software.
6. The method according to claim 1, characterized in that, The step of determining the software type in the external storage and the active partition based on the running status of the latest version of the software in the active partition includes: If the activated partition runs the latest version of the software normally, it is determined that the software type in both the external storage and the activated partition is the latest version of the software.
7. A software upgrade device, characterized in that, The device is disposed in an electronic controller, the electronic controller including an internal memory and an external memory added outside the internal memory, the internal memory including an active partition and an inactive partition; the device includes: A storage module is configured to save the differential packet to the external storage in response to the electronic controller receiving a differential packet for the software to be upgraded. The determining module is configured to determine the upgrade method of the software to be upgraded based on the active partition and the software type of the software to be upgraded in the external storage, wherein the software type includes the current version of the software and the latest version of the software; the step of determining the upgrade method of the software to be upgraded based on the active partition and the software type of the software to be upgraded in the external storage includes: when the active partition and the external storage contain the same software type of the software to be upgraded, the upgrade method of the software to be upgraded is determined to be differential upgrade; A generation module is used to generate the latest version of the software in the external storage according to the differential package and the current version of the software when the upgrade method of the software to be upgraded is differential upgrade; A switching module is used to switch the latest version of the software in the external storage from the inactive partition to the active partition based on the boot file in the internal storage; The determining module is further configured to determine the software type in the external storage and the active partition based on the running status of the latest version software in the active partition, so as to facilitate the next software upgrade; the step of determining the software type in the external storage and the active partition based on the running status of the latest version software in the active partition includes: if the active partition is abnormally running the latest version software, restoring the software type in the active partition and the external storage from the latest version software to the current version software.
8. 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 executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method of any one of claims 1-6.
9. A computer-readable storage medium storing computer instructions thereon, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Embedded software upgrading mode switching method and device, equipment and medium
CN114253574A
Firmware upgrading method and device for security chip, security chip, electronic equipment and computer readable storage medium
CN117687651A