Software upgrading method and device, electronic equipment and storage medium
By flashing combined tasks and single tasks in parallel within the ECU, the problem of low ECU upgrade efficiency is solved, resulting in a faster upgrade process and a better user experience.
Patent Information
- Application Number
- CN202511013843.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-10-17
AI Technical Summary
In existing technologies, the upgrade efficiency of vehicle electronic control units (ECUs) is low, the upgrade flexibility of AB partitions is not high, and upgrades cannot be performed when the main partition is abnormal. The upgrade time is long, which affects the user experience.
By acquiring the combined task-type flashing content of the software modules in the ECU as a whole, and flashing it in parallel with the flashing content of a single task type, the flashing task of each software module is executed in parallel using an asynchronous scheduling method, thus shortening the upgrade time.
It improves the efficiency and flexibility of ECU software upgrades, shortens upgrade time, and enhances the user experience.
Smart Images

Figure CN120803497A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet of Vehicles, and more particularly, to a software upgrading method and device, an electronic device, and a storage medium. BACKGROUND
[0002] With the rapid development of automotive electronic devices, the application of Over the Air Technology (OTA) remote upgrading of software of various controllers of automobiles is more and more widespread. Based on this, the efficiency requirement of OTA upgrading of an Electronic Control Unit (ECU) in the related art is higher and higher. SUMMARY
[0003] Therefore, embodiments of the present application provide a software upgrading method, device, electronic device, and storage medium to improve the above problems.
[0004] In a first aspect, embodiments of the present application provide a software upgrading method, which includes: obtaining an upgrading software package, wherein the upgrading software package includes writing content of a software module in an Electronic Control Unit (ECU) and a writing task type of the writing content corresponding to the software module, and the writing task type includes a single task type or a combined task type; obtaining, from the upgrading software package, writing content of the combined task type corresponding to the software module as combined task content corresponding to the software module; and writing the combined task content corresponding to the software module and writing content of the single task type to the software module in parallel.
[0005] In a second aspect, embodiments of the present application provide a software upgrading device, which includes an upgrading software package obtaining module, a combined task content determining module, and a software writing module. The upgrading software package obtaining module is configured to obtain an upgrading software package, wherein the upgrading software package includes writing content of a software module in an Electronic Control Unit (ECU) and a writing task type of the writing content corresponding to the software module, and the writing task type includes a single task type or a combined task type. The combined task content determining module is configured to obtain, from the upgrading software package, writing content of the combined task type corresponding to the software module as combined task content corresponding to the software module. The software writing module is configured to write the combined task content corresponding to the software module and writing content of the single task type to the software module in parallel.
[0006] In a third aspect, an electronic device is provided, including a memory and a processor, the memory is coupled to the processor, and the memory stores instructions, when the instructions are executed by the processor, the processor executes the software upgrading method provided in the first aspect.
[0007] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores program codes, the program codes can be invoked by a processor to execute the software upgrading method provided in the first aspect.
[0008] In the scheme of the present application, the upgrading software package including the flashing content of the software module in the electronic control unit ECU and the flashing task type corresponding to the flashing content of the software module is obtained, the flashing content corresponding to the flashing task type of the software module in the upgrading software package is obtained as the combined task content corresponding to the software module, and the combined task content corresponding to the software module and the flashing content of the single task type are flashed into the software module in parallel, so that the flashing content of the combined task type corresponding to the software module is flashed into the software module as a whole, and the flashing content of the single task type corresponding to the software module is flashed into the software module in parallel, thereby shortening the time length of ECU software upgrading and improving the experience of users. BRIEF DESCRIPTION OF DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0010] Figure 1 A flowchart of a software upgrading method provided by an embodiment of the present application is shown; Figure 2 A flowchart of a software upgrading method provided by an embodiment of the present application is shown; Figure 3 A flowchart of a software upgrading method provided by an embodiment of the present application is shown; Figure 4 A module block diagram of a software upgrading device provided by an embodiment of the present application is shown; Figure 5 A block diagram of an electronic device for executing the software upgrading method according to the embodiments of the present application is shown. DETAILED DESCRIPTION
[0011] In order for those skilled in the art to better understand the scheme of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.
[0012] In order to better understand the scheme of the embodiments of the present application, the technical terms used in the embodiments of the present application will be explained first.
[0013] Real-Time Operating System (RTOS) is an operating system that can respond quickly to external events or data within a specified time.
[0014] Unified Diagnostic Services (UDS) is a diagnostic communication protocol used in the automotive electronic ECU environment, defined in the ISO 14229 standard.
[0015] Virtual Machine Monitor (VMM) is a software component responsible for managing and isolating the operation of all virtual machines and handling their connection with the hardware.
[0016] Diagnostic Over Internet Protocol (DOIP) is an Internet Protocol-based automotive diagnostic communication standard for implementing vehicle diagnostic functions through Ethernet.
[0017] Microcontroller Unit (MCU) is an integrated circuit chip that integrates microprocessors (CPU), memory (RAM, ROM), input / output interfaces, etc. on a chip, used to control single-function or simple-function devices.
[0018] Time Division Multiplexing System is an operating system that manages multiple tasks through time slice allocation. Linux, QNX, Android and other operating systems support time division multiplexing mechanism, allowing multiple tasks to run on different time slices.
[0019] Universal Bootloader (Uboot) is an open-source boot loader widely used in embedded systems.
[0020] Kernel is the core part of the operating system, responsible for managing hardware resources (such as CPU, memory, peripherals, etc.) and providing system services.
[0021] SquashFS is a compressed file system commonly used in embedded devices.
[0022] APP, in the context of embedded systems, usually refers to an application program.
[0023] NOR Flash, a type of non-volatile memory, is commonly used in embedded systems.
[0024] Bootloader is the first piece of code executed by an embedded system after power-on. After initializing the CPU and related hardware, it loads the operating system image or a hardened embedded application into memory and then jumps to the operating system space, starting the operating system to run.
[0025] Flash offset position, in the context of software flashing (usually referring to firmware or software updates), usually involves writing data to a specific location in a storage device (such as flash memory, EEPROM, etc.). offset refers to the offset from the start of the storage device, i.e. the specific location of data storage.
[0026] Image, in the context of automotive electronic control units (ECU), usually refers to firmware or software image. It is the program code and data stored in the non-volatile memory (such as flash memory) of the ECU, used to control the function and behavior of the ECU.
[0027] EMMC image usually refers to a complete copy of data extracted from an EMMC (Embedded MultiMediaCard) memory chip.
[0028] The implementation details of the technical solutions of the embodiments of the present application are described in detail as follows: The hardware for upgrading vehicle-mounted ECU is mainly divided into two categories: RTOS or operating system-free (MCU) and time-division system (LINUX / QNX / ANDROID). With the increasing demand for the safety of vehicle-mounted ECU upgrade, the related technology evolves from the need to enter the Bootloader (MCU) or Recovery partition to the AB partition only.
[0029] The AB partition upgrade with one main partition and one backup partition has become the mainstream technology of the ECU self-upgrade, and the synchronization and rollback functions are introduced to enhance the safety of the ECU upgrade, and support the parallel upgrade of the vehicle ECUs. For example, during the AB partition upgrade, the ECU is upgraded from the A partition to the B partition, and then switched to the B partition. If the self-check is successful, the ECU continues to synchronize to the A partition, otherwise, the ECU returns to the A partition to perform the rollback operation. If the ECU fails to start continuously from the A partition during the startup process, the ECU jumps to the B partition to run, at this time, the ECU can only perform the full synchronization operation and cannot perform the upgrade operation. Therefore, the AB partition upgrade has the limitation that the backup partition cannot be upgraded when the main partition is abnormal. Therefore, the AB partition upgrade has the problem of low flexibility.
[0030] The upgrade mode of the AB partition and the recovery partition, if the ECU still needs to flash other external ECUs, the self-upgrade can only be completed alone and cannot participate in the parallel upgrade of the vehicle ECUs. When only the AB partition is upgraded and the upgrade package is downloaded to the backup partition, if any partition is abnormal, the ECU cannot be upgraded until the abnormality is repaired. When the AB partition is upgraded and the upgrade package is downloaded to the data partition, after the backup partition is upgraded, the ECU needs to switch the partition and then synchronize to the main partition. The ECU can only be upgraded from the A partition, and the upgrade time is long. In addition, some software modules in the ECU (such as Uboot, Kernel, Squashfs, APP (Container), and Nor Flash) have the ability of separate self-upgrade. The self-upgrade of the software modules in the ECU generally adopts the serial upgrade mode (such as the ping-pong upgrade mode). When the ECUs are serially flashed, the software upgrade time of the ECU is the sum of the flashing times of the ECUs. Therefore, the ECU upgrade has the problem of low efficiency.
[0031] To solve the above problems, the inventors have found, after long-term research, that the software upgrade method, device, electronic equipment, and storage medium provided in the embodiments of the present application are proposed. The flashing content of the combined task type corresponding to the software module is flashed into the software module as a whole in parallel with the flashing content of the single task type corresponding to the software module, which shortens the software upgrade time of the ECU and improves the user experience. The specific software upgrade method is described in detail in the subsequent embodiments.
[0032] The embodiments related to the present application will be described below with reference to the accompanying drawings.
[0033] Please refer to Figure 1 , Figure 1 The flowchart of the software upgrade method provided in an embodiment of the present application is shown. In specific embodiments, the software upgrade method can be applied to, for example Figure 4The software upgrade device 200 and the electronic device 100 configured with the software upgrade device 200 are shown Figure 5 The specific process of the embodiment will be described below with the electronic device as an example. It can be understood that the electronic device to which the embodiment is applied can include a vehicle, a vehicle-mounted terminal, and other devices, which are not limited herein. The flow shown below will be described in detail Figure 1 The software upgrade method can specifically include the following steps: Step S110: Obtain an upgrade software package, wherein the upgrade software package includes the flashing content of a software module in an electronic control unit (ECU) and the flashing task type of the flashing content corresponding to the software module, and the flashing task type includes a single task type or a combined task type.
[0034] In some embodiments, the electronic device can obtain the upgrade software package corresponding to the ECU in the electronic device from the associated cloud or the electronic device. For example, the electronic device can obtain the upgrade software package of the ECU from the associated cloud through the OTA technology. The upgrade software package can include the flashing content (e.g., EMM image, etc.) of the software module in the ECU in the electronic device and the flashing task type of the flashing content corresponding to the software module. The software module can be understood as firmware, software program module, etc. in the ECU. The number of software modules in the ECU can be one or more, which is not limited herein. The upgrade software package can include a configuration file, which includes the flashing task type of the flashing content corresponding to the software module in the ECU. The configuration file corresponding to the upgrade software package can be set by the user independently or obtained through third-party experimental data. For example, the flashing task type of the flashing content corresponding to the software module in the ECU included in the configuration file can be set by the user independently.
[0035] The flashing task type can include a single task type or a combined task type. The flashing content of the single task type can be understood as being able to be independently flashed into the software module without being affected by the flashing of other content. Accordingly, the flashing content of the single task type can be flashed into the software module in parallel. The flashing content of the combined task type can be understood as being affected by the flashing of other content, and the flashing content of the combined task type needs to be serially flashed into the software module with the flashing content of other combined task types. In the embodiment, the flashing content of the combined task type corresponding to the software module can be regarded as a whole and flashed into the software module in parallel with the flashing content of the single task type.
[0036] In some embodiments, the upgrade package can include the flash content of each software module in the ECU. For example, the upgrade package can include the start offset, file type, and the like of each software module in the ECU.
[0037] For example, the content of the upgrade package made in the cloud can include the start offset, file type, and the like of the AB partition of each image in the ECU. The code corresponding to the upgrade package can include: default image list ={ { "path name":"llce fw.bin", "type":"nor image", "sub type":"llCE", "offset B":0x010D0000, "offset A":0x00350000, "size":0 }, { "path name":"CORTEXM S32G399 car sw.bin", "type":"nor image", "sub type":"Metha", "offset B":0x01250000, "offset A":0x004d0000, "size":0 }, } In some embodiments, after the electronic device obtains the upgrade package, the electronic device can query the currently running partition in the ECU based on the DOIP instruction. If the electronic device queries the currently running partition in the ECU based on the DOIP instruction, the electronic device can store the upgrade package in the PER storage (non-volatile storage) to upgrade the ECU software. If the electronic device does not query the currently running partition in the ECU based on the DOIP instruction, the electronic device can determine that the query of the currently running partition in the ECU fails, and can determine that the current running state of the ECU is in a risk state, and can exit the action of upgrading the ECU software to ensure the safety and effectiveness of the ECU software upgrade.
[0038] In some embodiments, the electronic device can load the installation actions of various firmware during the process of upgrading the ECU based on the upgrade software package, and select the corresponding flash offset position to flash the content in the flash partition corresponding to the ECU according to the flash content included in the configuration file in the upgrade software package.
[0039] Step S120: Obtain the flashing content of the combination task type corresponding to the software module from the upgrade software package as the combination task content corresponding to the software module.
[0040] In some embodiments, when upgrading an ECU based on an upgrade software package, an electronic device may obtain, from the upgrade software package, flash content of a combination task type corresponding to a software module as the combination task content corresponding to the software module. The combination task content may include multiple flash contents, and the multiple flash contents correspond to a sequence in which they are flashed to the software module.
[0041] Step S130: flashing the combined task content and the flashing content of the single task type corresponding to the software module into the software module in parallel.
[0042] In some embodiments, after the electronic device obtains the combined task content corresponding to the software module, it can use the entire combined task content as the flash content of a single task type corresponding to the software module, and can flash the combined task content corresponding to the software module and the flash content of the single task type into the software module in parallel, thereby realizing parallel flashing of the ECU internal software modules and shortening the duration of the ECU software upgrade.
[0043] A software upgrade method provided in an embodiment of the present application obtains an upgrade software package including the flashing content of a software module in an electronic control unit ECU and the flashing task type of the flashing content corresponding to the software module, obtains the flashing content of a combination task type corresponding to the software module from the upgrade software package as the combination task content corresponding to the software module, and flashes the combination task content corresponding to the software module and the flashing content of a single task type in parallel into the software module, thereby flashing the flashing content of the combination task type corresponding to the software module as a whole and flashing the flashing content of the single task type corresponding to the software module into the software module in parallel, thereby shortening the ECU software upgrade time and improving the user experience.
[0044] See also Figure 2 , Figure 2 The flowchart of the software upgrade method provided by an embodiment of the present application is shown. Figure 2 The process shown is described in detail, and the software upgrade method may specifically include the following steps: Step S210: obtaining an upgrade software package, wherein the upgrade software package comprises the flashing content of the software modules in the electronic control unit (ECU) and the flashing task type of the flashing content corresponding to the software modules, the flashing task type comprises a single task type or a combined task type, and the number of the software modules is multiple.
[0045] In some embodiments, the number of the software modules in the ECU can be multiple; accordingly, the upgrade software package can comprise the flashing content of each software module in the ECU and the flashing task type of the flashing content corresponding to each software module.
[0046] Step S220: obtaining the flashing content of the combined task type corresponding to the software module from the upgrade software package as the combined task content corresponding to the software module.
[0047] In some embodiments, the electronic device can obtain the flashing content of the combined task type corresponding to each of the multiple software modules in the ECU from the upgrade software package as the combined task content corresponding to each of the multiple software modules.
[0048] Step S230: performing the flashing task of each software module in parallel through asynchronous scheduling, wherein the combined task content corresponding to each software module and the flashing content of the single task type are flashed into the software module in parallel.
[0049] In some embodiments, after the electronic device determines the combined task content corresponding to each software module in the ECU and the flashing content of the single task type from the upgrade software package, the electronic device can perform the combined task content corresponding to each software module and the flashing content of the single task type into each software module in parallel through asynchronous scheduling, thereby performing the parallel flashing action through the loading of the asynchronous scheduling service, realizing the synchronous flashing of the internal software modules of the ECU running the complex operating system, shortening the time length of the ECU software OTA upgrade, and improving the user experience of the vehicle-mounted ECU OTA upgrade.
[0050] As an implementable manner, in the process of performing the flashing task of each software module in parallel by the electronic device in an asynchronous scheduling manner, the electronic device can flash each flashing content in the combined task content corresponding to the target software module into the target software module in series when flashing the combined task content corresponding to the target software module into the target software module. The process of flashing the combined task content corresponding to the target software module into the target software module is parallel to the process of flashing the flashing content of the single task type corresponding to the target software module into the target software module. The target software module can be any software module in the ECU. Thus, the set of the flashing content of the combined task type corresponding to each software module is regarded as a single task type of flashing content, and the flashing content of the single task type corresponding to each software module is flashed in parallel, so that the combined task content and the flashing content of the single task type are flashed in parallel, and the combined task content is flashed into the corresponding software module in series while the internal software modules of the ECU are synchronously flashed, thereby ensuring the effectiveness of the ECU upgrade.
[0051] In some embodiments, two running partitions can be divided in the ECU, and software modules are arranged in the two running partitions, that is, the ECU includes an AB partition, and the software modules arranged in the two running partitions are the same. In the process of flashing the combined task content corresponding to the software module and the flashing content of the single task type into the software module by the electronic device in parallel, the combined task content corresponding to the software module and the flashing content of the single task type can be flashed into the first partition in parallel, that is, for each software module in the first partition, the combined task content corresponding to each software module and the flashing content of the single task type are flashed into each software module in the first partition. The first partition is a partition that is not currently running in the ECU. Thus, the software upgrade is first performed on the partition that is not currently running in the ECU, thereby improving the flexibility and speed of the AB partition upgrade of the ECU while ensuring the normal operation of the ECU. It can also be understood that the A partition and the B partition are not prioritized during the AB partition upgrade of the ECU, and any partition can be flexibly selected for self-upgrade, thereby improving the flexibility and efficiency of the AB partition upgrade of the ECU.
[0052] In some embodiments, after the electronic device flashes the combined task content corresponding to the software module and the flashing content of the single task type into the first partition in parallel, the electronic device can switch the currently running partition in the ECU to the first partition, and can copy the content of the software module in the first partition to the corresponding software module in the second partition to synchronously upgrade the second partition when it is determined that the first partition runs successfully. The second partition is another running partition in the ECU except the first partition.
[0053] In the process, the electronic device can acquire the write identification information fed back by each software module in the first partition in parallel writing of the combined task content corresponding to each software module and the write content of the single task type to each software module in the first partition, where the write identification information can be used to represent whether the corresponding software module is successfully written. In the case where the electronic device determines that the first partition is successfully written according to the write identification information fed back by each software module in the first partition, the electronic device can switch the currently running partition of the ECU to the first partition, control the ECU to restart, and query whether the currently running partition of the ECU is the first partition after the ECU is restarted. If it is determined according to the historical running data stored in the ECU that the running partition of the ECU jumps to the first partition from the second partition, the electronic device can perform a write self-check on the first partition, save the current running state of the ECU and end the action of software upgrading of the ECU based on the upgrade software package in the case where it is determined that the write self-check is successful, and delete the upgrade software package to clean up the temporary folder. The electronic device can also copy the content in the first partition to the second partition of the ECU at an appropriate opportunity to realize synchronous upgrading, thereby improving the flexibility and efficiency of AB partition upgrading while retaining the stability and reliability of AB partition upgrading.
[0054] In some embodiments, the upgrade software package can include self-check actions corresponding to the software modules in the ECU. For example, the configuration file corresponding to the upgrade software package can include self-check actions corresponding to each software module in the ECU. The electronic device can load the self-check actions corresponding to each software module according to the configuration file corresponding to the upgrade software package. The process in which the electronic device determines that the first partition is successfully running can include, after the ECU is restarted, if it is determined that the currently running partition in the ECU is the first partition, performing the self-check actions corresponding to each software module in the first partition in parallel through asynchronous scheduling, and if it is determined that the self-check actions of each software module in the first partition are successfully performed, determining that the first partition is successfully running.
[0055] As an implementable way, the process in which the electronic device copies the content of each software module in the first partition to the corresponding software module in the second partition to perform synchronous upgrading of the second partition can include, if it is determined that the first partition is successfully running, acquiring the usage state of the ECU, and if it is determined that the usage state meets the preset state condition, copying the content of each software module in the first partition to the corresponding software module in the second partition to perform synchronous upgrading of the second partition.
[0056] The use state of the ECU can include the use state of the electronic device, for example, the electronic device is a vehicle, and the use state of the vehicle includes driving, parking, engine off, and the like. The preset state condition can be set by the user or obtained from third-party experimental data. For example, the user can set the condition to include vehicle parking and engine off. In an example, the ECU upgrade does not affect the safety of vehicle driving, and the preset state condition is vehicle parking. If the use state of the ECU is vehicle parking, it is determined that the use state meets the preset state condition, and the content of each software module in the first partition is copied to the corresponding software module in the second partition to synchronize and upgrade the second partition.
[0057] As another implementable manner, the process of copying the content of each software module in the first partition to the corresponding software module in the second partition to synchronize and upgrade the second partition can include, if it is determined that the first partition runs successfully, obtaining the current time; and if the current time is within a preset time period, copying the content of each software module in the first partition to the corresponding software module in the second partition to synchronize and upgrade the second partition.
[0058] The preset time period can be set by the user or obtained from third-party experimental data. For example, the user can set the preset time period to be from 12 a.m. to 5 a.m. in the night, considering that it does not affect the safety of vehicle driving. Thus, the content of each software module in the first partition is copied to the corresponding software module in the second partition to synchronize and upgrade the second partition in the night, improving the safety of vehicle use and user experience.
[0059] For example, refer to Figure 3, which shows a flowchart of a software upgrading method provided by an embodiment of the present application. The electronic device can include a flasher, a diagnostic middleware, and an ECU. The ECU can be divided into two running partitions (e.g., A core and M core), and the software modules in the two running partitions are the same. The A core can include an A core self-upgrading module and an A core file system. The M core can include an M core self-upgrading module and an M core file system. The electronic device can obtain an upgrade software package from the cloud through OTA, and can verify the integrity of the files in the upgrade software package through the flasher. If the integrity of the files in the upgrade software package is verified through the flasher, the flasher can send the upgrade software package to the A core self-upgrading module in the A core of the ECU that is not currently running, decrypt the upgrade software package through the A core self-upgrading module, verify the integrity of the files in the decrypted upgrade software package, and send the upgrade software package to the A core file system in the A core if the integrity of the files in the decrypted upgrade software package is verified. The A core file system can return the verification result of the integrity of the upgrade software package to the flasher through the A core self-upgrading module.
[0060] The flasher can verify the signature of the upgrade software package through OTA if the verification result of the integrity of the upgrade software package is received. If the verification of the signature is passed, the flasher can send the upgrade software package to the A core self-upgrading module for secondary verification. If the secondary verification is passed, the flasher can send the upgrade software package to the A core file system, and the A core file system can return the result of the two verifications of the upgrade software package to the flasher through the A core self-upgrading module.
[0061] The flasher can instruct the A core self-upgrading module to install the upgrade software package if the result of the two verifications of the upgrade software package is received. The A core self-upgrading module can decompress the upgrade software package to obtain an upgrade image list included in the upgrade software package. The A core self-upgrading module can query the currently running partition of the ECU through the diagnostic middleware, e.g., the M core. The diagnostic middleware can query the currently running partition of the ECU based on a DOIP instruction, and can store the upgrade software package in the PER storage (non-volatile storage) if the query is successful. If the query fails, the action of installing the upgrade software package needs to be exited to avoid upgrading the ECU in the case of a security risk, thereby improving the reliability of ECU upgrading.
[0062] Wherein, after the A-core self-upgrade module obtains the current running partition of the ECU fed back by the diagnostic middleware, it can obtain from the VMM whether the current ECU upgrade is in the OTA mode, and if so, it can correspondingly write the EMMC image in the upgrade software package to each software module in the A-core file system in parallel. Wherein, the A-core self-upgrade module can load each firmware installation action, and can select according to the type of the configuration file whether it is a single action (parallel writing can be performed) or a Composite Action (internal serial, external parallel), and select the corresponding writing offset position for the current non-running partition of the ECU, and can load an asynchronous scheduling service to execute the parallel writing action. Wherein, after the A-core self-upgrade module correspondingly writes the EMMC image in the upgrade software package to each software module in the A-core file system, it can perform content writing on the A-core file system through the diagnostic middleware to enter an extended session, a secure access 27 service, a pre-writing precondition check, an entered session, a secure access 27 service, and a writing counter write. Wherein, the A-core self-upgrade module can also, in the process of writing on the A-core file system through the diagnostic middleware, implement cyclic erasing of the content of the flash in the A-core file system, cyclic writing and checking of the A-core file system, and writing of the programming date of the A-core file system through the diagnostic middleware.
[0063] Wherein, after the A-core file system is successfully written, the A-core self-upgrade module can switch the current running partition of the ECU to the A-core through the diagnostic middleware, and restart the ECU. Wherein, the A-core self-upgrade module can also, after restarting, query whether the current running partition of the ECU is the A-core, and in the case that the running partition of the ECU is switched from the A-core to the M-core, verify whether the version of the content stored in the A-core self-upgrade module is correct and whether the running state of the A-core self-upgrade module is good based on the self-checking action included in the upgrade software package (for example, a corresponding Verify action can be loaded according to the upgrade package configuration file, an asynchronous scheduling service is continuously loaded, and a parallel self-checking action is executed), and in the case that the version of the content stored in the A-core self-upgrade module is correct and the running state of the A-core self-upgrade module is good (self-checking is successful), the work of ECU upgrade through the writing machine control is ended, and the current state of the A-core can be saved and the temporary folder can be cleaned up.
[0064] Wherein, after each ECU startup, the electronic device can query the ECU upgrade state, and if it is found that the ECU has been upgraded but has not been synchronized, it can trigger the ECU to perform a non-inductive synchronization action at an appropriate time according to the trigger synchronization time that has been deeply learned and in combination with the current external conditions. Thus, the self-upgrade of the vehicle-mounted domain control ECU is realized, the stability and reliable operation of the AB partition upgrade are retained, the flexibility and speed of the AB partition are improved, and the ECU upgrade time is shortened.
[0065] The software upgrading method provided by the embodiment of the present application is compared with the software upgrading method shown in the prior art. Figure 1 In the embodiment, the number of software modules in the ECU can be multiple, and the software upgrading method can be used to perform the flashing task of each software module in parallel through asynchronous scheduling, wherein the combined task content corresponding to each software module and the flashing content of the single task type are flashed into each software module in parallel, so that the synchronization flashing of the internal software modules of the ECU running the complex operating system is realized, the time length of the ECU software upgrading is shortened, and the user experience is improved.
[0066] Please refer to Figure 4 , Figure 4 The module block diagram of the software upgrading device provided by the embodiment of the present application is shown. The software upgrading device 200 is applied to the electronic device described above, and the following will be described in detail with respect to the flow shown in Figure 4 The software upgrading device 200 includes an upgrading software package acquisition module 210, a combined task content determination module 220, and a software flashing module 230, wherein: The upgrading software package acquisition module 210 is used to acquire an upgrading software package, wherein the upgrading software package includes the flashing content of a software module in an electronic control unit (ECU) and the flashing task type of the flashing content corresponding to the software module, and the flashing task type includes a single task type or a combined task type.
[0067] The combined task content determination module 220 is used to acquire the flashing content of the combined task type corresponding to the software module from the upgrading software package as the combined task content corresponding to the software module.
[0068] The software flashing module 230 is used to flash the combined task content corresponding to the software module and the flashing content of the single task type into the software module in parallel.
[0069] Further, the software flashing module 230 can include a combined task content flashing unit, wherein: The combined task content flashing unit is used to flash each flashing content in the combined task content corresponding to the software module into the software module in series when the combined task content corresponding to the software module is flashed into the software module, and the process of flashing the combined task content into the software module is parallel to the process of flashing the flashing content of the single task type into the software module.
[0070] Further, the number of software modules is multiple, and the software flashing module 230 can include a parallel flashing unit, wherein: The parallel flashing unit is configured to perform the flashing task of each software module in parallel through asynchronous scheduling, and the combined task content and the single task type flashing content corresponding to each software module are flashed into each software module in parallel.
[0071] Further, two running partitions are divided in the ECU, and the software module is arranged in each of the two running partitions. The software flashing module 230 can include a software flashing first unit, wherein: The software flashing first unit is configured to flash the combined task content and the single task type flashing content corresponding to the software module into a first partition in parallel, and the first partition is a partition that is not currently running in the ECU.
[0072] Further, after the combined task content and the single task type flashing content corresponding to the software module are flashed into the first partition in parallel, the software upgrading device 200 can further include a running partition switching unit and a content synchronization unit, wherein: The running partition switching unit is configured to switch the currently running partition in the ECU to the first partition.
[0073] The content synchronization unit is configured to copy the content of the software module in the first partition to the corresponding software module in a second partition to synchronously upgrade the second partition if it is determined that the first partition runs successfully, and the second partition is another running partition in the ECU except the first partition.
[0074] Further, the self-checking action corresponding to the software module in the ECU is included in the upgrading software package, and before the content of the software module in the first partition is copied to the corresponding software module in the second partition to synchronously upgrade the second partition if it is determined that the first partition runs successfully, the software upgrading device 200 can further include a self-checking action execution unit and a self-checking success unit, wherein: The self-checking action execution unit is configured to execute the self-checking action corresponding to the software module in the first partition if the currently running partition in the ECU is the first partition after the ECU is restarted.
[0075] The self-checking success unit is configured to determine that the first partition runs successfully if the self-checking action of the software module in the first partition is executed successfully.
[0076] Further, the content synchronization unit can include a synchronization condition detection unit, a first synchronization unit, and a second synchronization unit, wherein: The synchronization condition detection unit is configured to acquire a usage state of the ECU and a current time if it is determined that the first partition runs successfully.
[0077] The first synchronization unit is configured to copy content of the software module in the first partition to a corresponding software module in the second partition to perform synchronous upgrade on the second partition if the usage state meets a preset state condition.
[0078] The second synchronization unit is configured to copy content of the software module in the first partition to a corresponding software module in the second partition to perform synchronous upgrade on the second partition if the current time is within a preset time period.
[0079] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described devices and modules can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0080] In several embodiments provided in the present application, the coupling between the modules can be electrical, mechanical or other forms of coupling.
[0081] In addition, each functional module in each embodiment of the present application can be integrated in one processing module, or each module can exist physically alone, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module.
[0082] Please refer to Figure 5 which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 can be a vehicle, a vehicle-mounted terminal, a server, a computer or the like, which has processing capability. The electronic device 100 in the present application can include one or more of the following components: a processor 110, a memory 120 and one or more application programs, wherein the one or more application programs can be stored in the memory 120 and configured to be executed by the one or more processors 110, and the one or more programs are configured to perform the method described in the foregoing method embodiments.
[0083] The processor 110 can include one or more processing cores. The processor 110 connects various parts within the vehicle 100 by various interfaces and lines, performs various functions of the vehicle 100 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Alternatively, the processor 110 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 110 can be integrated with a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes operating systems, user interfaces, and application programs; the GPU is responsible for rendering and drawing the content to be displayed; and the modem is used for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 110, but can be implemented separately by a communication chip.
[0084] The memory 120 can include a random access memory (RAM) and can also include a read-only memory (ROM). The memory 120 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 can include a program storage area and a data storage area, wherein the program storage area can store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing each of the method embodiments described below, etc. The data storage area can also store data created by the electronic device 100 in use (such as a phone book, audio and video data, chat record data, etc.).
[0085] In this embodiment, the computer-readable medium stores program codes, which can be called and executed by the processor to perform the methods described in the above method embodiments.
[0086] The computer-readable storage medium can be an electronic, magnetic, optical, or other physical storage device that stores executable computer program code. The computer-readable storage medium can alternatively or additionally include a non-transitory computer-readable storage medium. The computer-readable storage medium has a storage space for storing program code that executes any of the method steps described above. The program code can be read from or written to one or more computer program products. The program code can be compressed, for example, in a suitable form.
[0087] In the present application, multiple refers to two or more.
[0088] In the present application, unless specifically limited otherwise, the terms "mounting", "connected", "connection" should be understood broadly, for example, can be fixedly connected, can be detachably connected, or integrally connected; can be mechanically connected, can be electrically connected; can be directly connected, can be indirectly connected through an intermediate medium, can be internal communication of two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0089] The terms "first", "second", "third", "fourth" and the like (if any) in the present application are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.
[0090] In the present application, the term "and / or" is only a description of the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in the present application generally represents an "or" relationship between the front and rear associated objects.
[0091] If not specifically stated, all steps of the present application can be performed in sequence or randomly. For example, the method comprises steps A and B, which means that the method can comprise steps A and B performed in sequence, or steps B and A performed in sequence. For example, the method can further comprise step C, which means that step C can be added to the method in any order, for example, the method can comprise steps A, B and C, or steps A, C and B, or steps C, A and B, etc.
[0092] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A software upgrade method, characterized in that: The method comprises: Obtain an upgrade software package, wherein the upgrade software package includes the flashing content of the software module in the electronic control unit ECU and the flashing task type corresponding to the flashing content of the software module, wherein the flashing task type includes a single task type or a combined task type; Obtaining, from the upgrade software package, the flashing content of the combined task type corresponding to the software module as the combined task content corresponding to the software module; The combined task content and the flashing content of the single task type corresponding to the software module are flashed into the software module in parallel.
2. The method according to claim 1, characterized in that The step of flashing the combined task content and the single task type flashing content corresponding to the software module to the software module in parallel includes: When the combined task content corresponding to the software module is flashed into the software module, each flash content in the combined task content corresponding to the software module is flashed into the software module serially, wherein the process of flashing the combined task content into the software module is parallel to the process of flashing the flash content of a single task type into the software module.
3. The method according to claim 1, characterized in that There are multiple software modules, and the step of flashing the combined task contents and the flashing contents of the single task types corresponding to the software modules to the software modules in parallel includes: The flashing task of each software module is executed in parallel by asynchronous scheduling, wherein the combined task content and the flashing content of a single task type corresponding to each software module are flashed into each software module in parallel.
4. The method according to any one of claims 1 to 3, characterized in that The ECU is divided into two running partitions, and the software module is provided in both running partitions. The flashing of the combined task content and the flashing content of the single task type corresponding to the software module to the software module in parallel includes: The combined task content and the flashing content of the single task type corresponding to the software module are flashed in parallel into the first partition, wherein the first partition is a partition that is not currently running in the ECU.
5. The method according to claim 4, characterized in that After flashing the combined task content and the single task type flashing content corresponding to the software module into the first partition in parallel, the method further includes: Switching the currently running partition in the ECU to the first partition; If it is determined that the first partition runs successfully, the content of the software module in the first partition is copied to the corresponding software module in the second partition to synchronously upgrade the second partition, wherein the second partition is another running partition in the ECU except the first partition.
6. The method according to claim 5, characterized in that The upgrade software package includes a self-test action corresponding to the software module in the ECU, and before copying the content of the software module in the first partition to the corresponding software module in the second partition if it is determined that the first partition has run successfully, so as to synchronously upgrade the second partition, further includes: After the ECU is restarted, if the currently running partition in the ECU is the first partition, perform a self-test action corresponding to the software module in the first partition; If the self-check action of the software module in the first partition is successfully executed, it is determined that the first partition is running successfully.
7. The method according to claim 5, characterized in that If it is determined that the first partition runs successfully, copying the content of the software module in the first partition to the corresponding software module in the second partition to synchronously upgrade the second partition includes: If it is determined that the first partition runs successfully, obtaining the usage status and current time of the ECU; If the usage status satisfies a preset status condition, copying the content of the software module in the first partition to the corresponding software module in the second partition to synchronously upgrade the second partition; and / or If the current time is within a preset time period, the content of the software module in the first partition is copied to the corresponding software module in the second partition, so as to synchronously upgrade the second partition.
8. A software upgrade device, characterized in that: The device comprises: An upgrade software package acquisition module is used to acquire an upgrade software package, wherein the upgrade software package includes the flashing content of the software module in the electronic control unit ECU and the flashing task type corresponding to the flashing content of the software module, and the flashing task type includes a single task type or a combined task type; a combined task content determination module, configured to obtain, from the upgrade software package, a flashing content of the combined task type corresponding to the software module as the combined task content corresponding to the software module; The software flashing module is used to flash the combined task content and the flashing content of a single task type corresponding to the software module into the software module in parallel.
9. An electronic device, characterized in that: include: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 7.