Software over-the-air upgrading method and device, computer equipment, storage medium and computer program product

By using a dual-storage area and tag area design with resistive random access memory in the electronic control unit, combined with partitioning and fine-grained tag area settings, the problems of unstable upgrades and low storage utilization in traditional upgrade methods are solved, achieving more efficient and reliable software upgrades.

CN121807343APending Publication Date: 2026-04-07CCORE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Traditional over-the-air software upgrade methods for electronic control units are prone to software corruption due to power outages or communication interruptions in single-storage-area architectures. Dual-storage-area architectures cannot finely control the upgrade progress of partitions, resulting in unstable upgrade processes and low storage utilization.

Method used

A resistive random access memory is used, with two sets of application software storage areas and upgrade tag areas. The tag areas are divided and the tag settings are refined to record the upgrade progress information of the whole package and the partitions, so as to achieve orderly upgrade control.

Benefits of technology

It improves the stability and reliability of the upgrade process, increases storage utilization, ensures the convenience and robustness of the upgrade process, and avoids software damage and insufficient partition progress control caused by upgrade anomalies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807343A_ABST
    Figure CN121807343A_ABST
Patent Text Reader

Abstract

The invention relates to a software over-the-air upgrading method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: dividing to-be-upgraded application software into a plurality of software partitions according to an actual software structure; in response to starting upgrading of the to-be-upgraded application software, under the condition that an upgrading version meets a preset requirement and upgrading of the target upgrading label area is not started, upgrading progress information of a whole package label area in the target upgrading label area and configuration information of a partition label area are initialized, and an upgrading mark is set; according to the upgrading progress recorded in the whole package label area, the software partitions are programmed to the corresponding application software storage areas in sequence, and the upgrading progress of the whole package label area and upgrading state information of the corresponding partition label areas are synchronously updated; and after all the partitions pass the upgrading verification, switching to the corresponding application software storage area and the upgrading label area to finish version updating. By adopting the method, the overall storage utilization rate of the nonvolatile memory can be improved, and the convenience and robustness of the overall upgrading process are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of electronic control unit software upgrade, and particularly relates to a software over-the-air upgrade method and device, computer equipment, a storage medium and a computer program product. BACKGROUND

[0002] With the development of technology in the fields of automobile electronics and industrial control, the functional complexity of electronic control units is continuously improved, and the timeliness and convenience of software version iteration are increasingly required. Therefore, software over-the-air upgrade technology emerges as the times require. This technology can realize remote updating of software without physically disassembling the electronic control unit, effectively reduces the upgrade and maintenance cost, and improves the functional optimization efficiency of the product life cycle.

[0003] In the traditional technology, the electronic control unit usually uses a flash memory as a non-volatile memory, and a software over-the-air upgrade method thereof usually adopts a single storage area or a simple dual-storage area architecture. In the single storage area architecture, the software to be upgraded directly covers the current running software. Once an abnormality such as power failure or communication interruption occurs during the upgrade process, the current software will be damaged, and the electronic control unit cannot be normally started. Although the dual-storage area architecture sets a running area and an upgrade area, the upgrade state information is recorded by a single tag, which can only mark whether the upgrade of the whole software package is completed, and cannot finely control the upgrade progress of the software partition. SUMMARY

[0004] Therefore, it is necessary to provide a software over-the-air upgrade method, device, computer equipment, computer readable storage medium and computer program product capable of improving the overall storage utilization rate of the non-volatile memory and improving the convenience and robustness of the overall upgrade process.

[0005] In a first aspect, the present application provides a software over-the-air upgrade method applied to an electronic control unit, wherein the electronic control unit uses a resistive random access memory as a non-volatile memory, and the method comprises the following steps.

[0006] Two sets of corresponding configured application software storage areas and upgrade tag areas are set in the resistive random access memory, and are respectively used for storing the current running software or the application software to be upgraded and recording the upgrade state information of the corresponding storage area;

[0007] The application software to be upgraded is divided into a plurality of software partitions according to the actual software structure, the upgrade tag area comprises a whole package tag area and a partition tag area corresponding to each software partition;

[0008] In response to the application software to be upgraded starting the upgrade, in the case that the upgrade version meets preset requirements and the target upgrade label area has not started the upgrade, initializing upgrade progress information of the whole package label area and configuration information of the partition label area in the target upgrade label area, and setting an upgrade flag;

[0009] According to the upgrade progress recorded in the whole package label area in the target upgrade label area, sequentially programming the software partitions to corresponding application software storage areas, and synchronously updating the upgrade progress of the whole package label area and the upgrade state information of the corresponding partition label area;

[0010] After all the partitions are upgraded and verified, switching to the corresponding application software storage area and the upgrade label area to complete the version update.

[0011] In some embodiments of the method, the version number of the application software to be upgraded is stored at the end of the last partition of the software partitions; and the upgrade version meeting the preset requirements includes that the version number of the application software to be upgraded is higher than the version number of the currently running software, and the consistency verification of the version number of the application software to be upgraded and the currently running software passes.

[0012] In some embodiments of the method, the upgrade progress information recorded in the whole package label area includes at least one of the total number of software partitions and the serial number of the currently successfully upgraded partition; the configuration information of the partition label area includes at least one of the number of the corresponding software partition, the programming start address, and the programming length; and the upgrade state information includes at least one of the upgrade start flag and the upgrade completion flag of the corresponding software partition.

[0013] In some embodiments of the method, the method further includes:

[0014] In the case that an interruption occurs during the upgrade, when the upgrade is started next time, the serial number of the currently successfully upgraded partition recorded in the whole package label area in the target upgrade label area is directly read, and the programming and the upgrade state updating are continued from the next software partition of the serial number until the version update is completed.

[0015] In some embodiments of the method, the method further includes:

[0016] The integrity of the software partition corresponding to the serial number is verified, and when the verification passes, the upgrade is continued from the next partition; and when the verification fails, the upgrade progress information of the target upgrade label area is cleared, and the upgrade is restarted from the first software partition.

[0017] In some embodiments of the method, the response to the application software to be upgraded starting the upgrade, in the case that the upgrade version meets preset requirements and the target upgrade label area has not started the upgrade, initializing the upgrade progress information of the whole package label area and the configuration information of the partition label area in the target upgrade label area, and setting the upgrade flag, includes:

[0018] reading the upgrade mark bit of the whole package tag area in the target upgrade tag area, if the upgrade mark bit is a preset initial value and the configuration information of the partition tag area is not written into valid data, determining that the upgrade is not started; wherein the preset initial value is 0 or a null value, and the valid data is a combination of a partition number, a programming start address and a programming length in a preset format.

[0019] According to a second aspect of the embodiments of the present disclosure, a software over-the-air upgrade device is provided. The device comprises:

[0020] A first module is configured to set two sets of application software storage areas and upgrade tag areas corresponding to configurations in the resistive random access memory, and store current running software or to-be-upgraded application software and record upgrade state information of the corresponding storage areas, respectively.

[0021] A second module is configured to divide the to-be-upgraded application software into a plurality of software partitions according to an actual software structure, and the upgrade tag area comprises a whole package tag area and a partition tag area corresponding to each software partition.

[0022] A third module is configured to, in response to the to-be-upgraded application software starting upgrade, initialize upgrade progress information of the whole package tag area and configuration information of the partition tag area in the target upgrade tag area, and set the upgrade mark in the case that the upgrade version meets preset requirements and the target upgrade tag area has not started upgrade.

[0023] A fourth module is configured to sequentially program the software partitions to the corresponding application software storage area according to the upgrade progress recorded in the whole package tag area in the target upgrade tag area, and synchronously update the upgrade progress of the whole package tag area and the upgrade state information of the corresponding partition tag area.

[0024] A fifth module is configured to switch to the corresponding application software storage area and upgrade tag area after all the partition upgrades are verified, and complete version update.

[0025] According to a third aspect of the embodiments of the present disclosure, a computer device is provided. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the software over-the-air upgrade method when executing the computer program.

[0026] According to a fourth aspect of the embodiments of the present disclosure, a computer readable storage medium is provided. The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the software over-the-air upgrade method.

[0027] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided. The computer program product comprises a computer program which, when executed by a processor, implements the software over-the-air upgrade method described above.

[0028] The software over-the-air upgrade scheme provided by the embodiments of the present application can make full use of the characteristics of the resistive random access memory, adopt the configuration design of two sets of application software storage areas and upgrade tag area, and realize the orderly control of the upgrade process by combining software partition division and fine tag area setting. The scheme can not only avoid the risk of software damage caused by upgrade exceptions under the single storage area architecture, but also solve the problem of being unable to fine control the partition upgrade progress under the traditional dual storage area architecture, significantly improve the stability and reliability of the upgrade process, and improve the storage utilization rate of the resistive random access memory, making the upgrade process more convenient and robust.

[0029] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0030] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure, and do not constitute an undue limitation on the present disclosure.

[0031] Figure 1 A flowchart of a software over-the-air upgrade method according to an exemplary embodiment is shown;

[0032] Figure 2 A structure block diagram of an electronic control unit according to an exemplary embodiment is shown;

[0033] Figure 3 A tag area diagram according to an exemplary embodiment is shown;

[0034] Figure 4 A specific flowchart of a software over-the-air upgrade method according to an exemplary embodiment is shown;

[0035] Figure 5 A structure block diagram of a software over-the-air upgrade device according to an exemplary embodiment is shown;

[0036] Figure 6 An internal structure diagram of a computer device according to an exemplary embodiment is shown. DETAILED DESCRIPTION

[0037] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the 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.

[0038] In some embodiments of the present disclosure, the execution of the software over-the-air upgrade method can be controlled by a unified controller or by multiple controllers. These controllers can include controllers of local terminals or controllers of remote servers. In some embodiments, the software over-the-air upgrade control process can be completed by the controller of the local terminal and the controller of the server together. The local terminal described in the present disclosure can include, but is not limited to, various robot devices, vehicle-mounted devices, personal computers, notebook computers, smart phones, tablet computers, wearable devices, medical devices, VR (Virtual Reality) virtual devices, etc. The server described can be a server, a server cluster, a distributed system, a cloud processing platform, a server containing a blockchain node, and a combination of the above devices. The controller described in the present disclosure can include various control units capable of realizing logical processing functions, including but not limited to CPU (Central Processing Unit), PLC (Programmable Logic Controller), ECU (Electronic Control Unit), MCU (Microcontroller Unit), FPGA (Field Programmable Gate Array), CPLD (Complex Programmable logic device), and other controllers composed of one or more logical function units, chips, etc.

[0039] In some embodiments of the present disclosure, a software over-the-air upgrade method is provided, which is applied to an electronic control unit with a resistive random access memory (RRAM) as a non-volatile memory, such as Figure 1 As shown, the method comprises the following steps:

[0040] S20, setting two sets of corresponding configuration application software storage areas and upgrade tag areas in the resistive random access memory, respectively used for storing current running software or application software to be upgraded and recording upgrade state information of the corresponding storage areas.

[0041] The resistive random access memory is a new type of non-volatile memory, which does not need to perform a pre-erase operation before writing data and supports direct overwrite programming to the same address. This feature breaks many restrictions of traditional storage media on programming operations and provides an important basis for the optimization of the software over-the-air upgrade process.

[0042] Electronic control unit generally refers to a core control component of an electronic system, which is widely used in the fields of automobile electronics and industrial control, and plays an important role in controlling the operation of various devices and realizing specific function logic. Timely upgrading of the internal software of the electronic control unit is crucial for performance optimization and function expansion of the device. Software over-the-air upgrade generally refers to a technology for updating software version through remote communication without physically disassembling the electronic control unit, which can effectively reduce the upgrade and maintenance cost and improve the function optimization efficiency of the product throughout its life cycle.

[0043] Application software storage area generally refers to a storage area set in resistive random access memory for storing currently running software or application software to be upgraded. Two sets of corresponding configurations are adopted to ensure the stability of system operation during upgrading. Upgrade tag area generally refers to an area set in correspondence with the application software storage area for recording various state information of software upgrading in the corresponding storage area.

[0044] In some embodiments, with reference to Figure 2 Two sets of storage areas (A / B areas) with the same structure and corresponding configurations are planned and divided in the resistive random access memory, which are used as two sets of application software storage areas and upgrade tag areas. One set of application software storage area is used to store the currently running software, and the corresponding upgrade tag area records the relevant upgrade state information of the running software. The other set of application software storage area is reserved for storing application software to be upgraded, and the corresponding upgrade tag area is used to record various state data of the software to be upgraded during the upgrading process. Through this double set of configuration design, the integrity of the currently running software can be maintained during the upgrading process, and the system can be prevented from failing to operate normally due to abnormal upgrading.

[0045] S22, the application software to be upgraded is divided into a plurality of software partitions according to the actual software structure, and the upgrade tag area includes a whole package tag area and a partition tag area corresponding to each software partition.

[0046] The whole package tag area mainly records the total number of software partitions, the serial number of the partition that has been successfully upgraded, and other progress information related to whole package upgrading, as well as key state identifiers such as upgrade start markers. The partition tag area corresponds to each software partition one by one, and records the configuration information of the corresponding software partition, such as the number, programming start address and programming length, as well as the upgrade state information such as the upgrade start marker and the upgrade completion marker.

[0047] The to-be-upgraded application software is analyzed in structure, and is divided into several software partitions according to actual software structure characteristics such as function module division and code logical correlation. Meanwhile, the whole package tag area and the partition tag area are further set in the upgrade tag area. The whole package tag area is used for recording the upgrade progress related information of the whole package software, and the partition tag area is in one-to-one correspondence with each software partition, so that the upgrade state of each software partition can be accurately recorded. The partition design is not limited by the erase granularity of the random access memory, and can be flexibly divided according to the actual situation of the software, so as to improve the utilization efficiency of the storage resources.

[0048] S24, in response to the to-be-upgraded application software starting upgrade, initializing the upgrade progress information of the whole package tag area and the configuration information of the partition tag area in the target upgrade tag area, and setting the upgrade flag, when the upgrade version meets the preset requirements and the target upgrade tag area has not started upgrade.

[0049] When the upgrade start instruction of the to-be-upgraded application software is received, the upgrade version is first checked, the version number of the to-be-upgraded application software stored at the end of the last software partition is read, and the version number is compared with the version number of the currently running software. At the same time, the consistency of the version numbers is checked to confirm that the to-be-upgraded version is higher than the currently running version and the consistency check is passed. Then, the state of the target upgrade tag area is checked, the upgrade flag bit of the whole package tag area is read, if the flag bit is the preset initial value, and the configuration information of the partition tag area is not written into valid data in the preset format, it is determined that the target upgrade tag area has not started upgrade. Under the premise that the upgrade version meets the preset requirements and the target upgrade tag area has not started upgrade, the upgrade progress information of the whole package tag area in the target upgrade tag area is initialized and set, the basic data such as the total number of software partitions is determined, and the number, programming start address and programming length of each software partition in the partition tag area are configured. The upgrade flag is set, and the initialization preparation before upgrade is completed.

[0050] S26, according to the upgrade progress recorded in the whole package tag area in the target upgrade tag area, the software partitions are programmed into the corresponding application software storage area in sequence, and the upgrade progress of the whole package tag area and the upgrade state information of the corresponding partition tag area are updated synchronously.

[0051] After the upgrade initialization is completed, the software partition currently requiring programming is determined according to the upgrade progress information recorded in the whole-package tag area in the target upgrade tag area. According to the division order of the software partition, each software partition is sequentially written into the corresponding application software storage area through the programming operation. During the programming process of each software partition, the upgrade progress information of the whole-package tag area is updated in real time and synchronously, for example, the serial number of the partition that has been successfully upgraded is correspondingly incremented after each software partition is successfully programmed; at the same time, the upgrade state information is updated in the partition tag area corresponding to the software partition, for example, the upgrade start flag is set when the programming starts, and the upgrade completion flag is set after the programming is completed, so as to ensure that the upgrade progress and state can be recorded in real time and accurately.

[0052] S28, after the upgrade verification of all partitions is passed, the corresponding application software storage area and upgrade tag area are switched to, and the version update is completed.

[0053] After all software partitions are programmed and written, integrity verification is performed on each software partition, and the data of each partition is verified by a data verification algorithm to determine whether the data is complete and accurate and whether there is data loss or error. After the upgrade verification of all partitions is passed, the application software storage area relied on by the system is switched from the storage area of the currently running software to the application software storage area in which the software to be upgraded is stored and the verification is completed through a system preset switching mechanism, and the corresponding upgrade tag area is also switched synchronously, thereby completing the update of the software version.

[0054] In some embodiments of the present disclosure, the characteristics of the resistive random access memory can be fully utilized, two sets of application software storage areas and upgrade tag areas are designed, combined with the division of software partitions and the fine setting of tag areas, the orderly control of the upgrade process is realized; the risk of software damage caused by upgrade exceptions in the single storage area architecture is avoided, the problem of fine control of partition upgrade progress in the traditional dual storage area architecture is solved, the stability and reliability of the upgrade process are significantly improved, and the storage utilization of the resistive random access memory is improved, so that the upgrade process is more convenient and robust.

[0055] In some embodiments of the present disclosure, the version number of the application software to be upgraded is stored at the end of the last partition of the plurality of software partitions; the upgrade version meets the preset requirement, including that the version number of the application software to be upgraded is higher than the version number of the currently running software, and the consistency verification of the version numbers of the application software to be upgraded and the currently running software is passed.

[0056] In some embodiments, the application software to be upgraded is divided into several software partitions (e.g., C1-Cn) according to the actual software structure, and the partition size can be flexibly configured according to the actual software structure, and is no longer limited by the size of the FLASH erase block. For example, even if the minimum erase unit of the existing FLASH is 256KByte, the partition division of the present application does not need to be aligned to 256KByte, but can be flexibly set according to factors such as function modules and code size. The version number is stored at the end of the last software partition (Cn), and the storage location is determined during the software partition division stage to ensure the traceability and stability of the version information.

[0057] When the application software to be upgraded starts to upgrade, the version verification operation is first performed. The processor of the electronic control unit reads the version number of the application software to be upgraded stored at the end of the last software partition in the resistive random access memory, and compares it with the version number of the currently running software to confirm that the version number of the application software to be upgraded is higher than that of the currently running software. Then, the system starts the version number consistency verification. During the verification process, the relevant feature information of the version number of the application software to be upgraded is extracted and compared with the corresponding feature information of the version number of the currently running software to ensure that they are consistent in terms of coding rules, format, etc. Only when the version number of the application software to be upgraded is higher than that of the currently running software and the version number consistency verification is passed, the system determines that the upgrade version meets the preset requirements, and then continues to promote the subsequent upgrade process; if any verification condition is not met, the upgrade process is terminated to ensure the safe operation of the electronic control unit.

[0058] In some embodiments of the present disclosure, the problems of version rollback and version incompatibility can be effectively avoided, and it is ensured that the upgraded software can be adapted to the hardware environment of the electronic control unit and the existing system configuration, thereby ensuring the effectiveness and safety of the upgrade.

[0059] In some embodiments of the present disclosure, the upgrade progress information recorded in the whole package tag area includes at least one of the total number of software partitions and the serial number of the partitions that have been successfully upgraded; the configuration information of the partition tag area includes at least one of the number of the corresponding software partition, the programming start address, and the programming length; and the upgrade status information includes at least one of the upgrade start mark and the upgrade completion mark of the corresponding software partition.

[0060] In some embodiments, the whole package label area is used to record the upgrade progress information, which can include the total number of software partitions and the serial number of the currently successfully upgraded partition. In the upgrade initialization stage, the system writes the total number of software partitions after the division of the application software to be upgraded into the whole package label area; as the upgrade process proceeds, the serial number of the currently successfully upgraded partition in the whole package label area is updated synchronously after the programming and verification of each software partition are completed, directly reflecting the upgrade progress of the whole package software. The partition label area corresponds to each software partition one by one, and the configuration information thereof can include the number, programming start address and programming length of the corresponding software partition. These configuration information is determined after the division of the software partition and is written into the corresponding partition label area in advance, providing basic parameters for the accurate programming of the subsequent software partition and ensuring that each software partition can be accurately written into the specified position of the resistive random access memory. The upgrade status information is recorded in real time through the partition label area, which can include the upgrade start flag and the upgrade completion flag of the corresponding software partition. When the system starts to perform programming operation on a certain software partition, the upgrade start flag of the partition label area is immediately set; after the programming of the software partition is completed and the integrity verification is passed, the upgrade completion flag is set, clearly presenting the upgrade status of each software partition and providing clear basis for the monitoring and interruption recovery of the upgrade process.

[0061] In some embodiments of the present disclosure, various types of key data in the upgrade process can be clearly and accurately recorded; clear data basis is provided for real-time monitoring of upgrade progress and accurate judgment of upgrade status, and clear clues are also provided for subsequent possible interruption recovery in the upgrade process, making the control of the upgrade process more refined and operable.

[0062] In some embodiments of the present disclosure, the method further comprises:

[0063] In the event of interruption during the upgrade process, the next time the upgrade is started, the serial number of the currently successfully upgraded partition recorded in the whole package label area in the target upgrade label area is directly read, and the programming and upgrade status updating are continued from the next software partition of the serial number until the version update is completed.

[0064] In some embodiments, after the upgrade is interrupted, the serial number of the currently successfully upgraded partition recorded in the whole package label area is retained in the resistive random access memory, ensuring that the upgrade progress information is not lost. When the upgrade process is started next time, the electronic control unit first reads the serial number of the partition stored in the whole package label area in the target upgrade label area, thereby clearly determining the termination node of the last upgrade.

[0065] Based on the read successful upgrade partition number, the system directly locates to the next software partition of the partition number, skips the completed upgrade partition, and continues to perform the programming operation from the located partition. During the programming process, the upgrade progress information of the whole package label area is updated synchronously, that is, the current successfully upgraded partition number is increased successively, and the upgrade state information of the corresponding partition label area is updated, so as to ensure that the upgrade progress and state record are consistent with the actual programming process. According to the above process, the system sequentially completes the programming and state updating operation of all subsequent software partitions, until all software partitions are upgraded, finally realizes version updating, avoids repeated upgrading caused by interruption, and improves the upgrading efficiency and robustness.

[0066] In some embodiments of the present disclosure, the whole upgrade process does not need to be restarted after interruption, and only the upgrade operation needs to be continued from the breakpoint, which greatly reduces the time cost and resource consumption caused by repeated upgrading, improves the upgrading efficiency, and enhances the ability of the upgrading process to deal with sudden abnormalities, further improving the robustness of the upgrading.

[0067] In some embodiments of the present disclosure, the method further comprises:

[0068] The software partition corresponding to the partition number is integrity checked, and when the checking is passed, the upgrade is continued from the next partition; and when the checking fails, the upgrade progress information of the target upgrade label area is cleared, and the upgrade is restarted from the first software partition.

[0069] In some embodiments, when the upgrade process is interrupted due to a sudden situation, the next time the upgrade is started, the system first reads the current successfully upgraded partition number recorded in the whole package label area of the target upgrade label area. Then, for the software partition corresponding to the partition number, an integrity checking process is started, the data of the partition is detected through a preset data checking logic, and it is confirmed whether the data is complete, tamper-free or damaged.

[0070] If the checking result shows that the software partition data is complete and meets the preset integrity requirement, it is determined that the checking is passed. The system directly locates to the next software partition of the partition number, continues to perform the programming operation, and synchronously updates the upgrade progress information of the whole package label area and the upgrade state information of the corresponding partition label area, and continues the upgrade process. If the checking process finds that the software partition data has problems such as missing, tampering or damage, resulting in checking failure, the system immediately performs the upgrade progress information clearing operation, resets the upgrade progress information of the whole package label area and the related state information of the partition label area in the target upgrade label area. Then, the upgrade process is restarted from the first software partition, and the programming, state updating and checking operations are sequentially performed, so as to ensure the upgrade quality of the whole package software and avoid affecting the running stability of the whole system due to the abnormality of part of the partition data.

[0071] In some embodiments of the present disclosure, for the partition that passes the verification, the subsequent upgrade process is continued to ensure the upgrade efficiency; for the partition that fails the verification, the upgrade is restarted by clearing the upgrade progress information to ensure that the software data after the upgrade is complete and error-free, and the abnormal software operation caused by the damaged data is avoided, further enhancing the reliability and security of the upgrade.

[0072] In some embodiments of the present disclosure, S24 comprises:

[0073] The upgrade mark bit of the whole package tag area in the target upgrade tag area is read, and if the upgrade mark bit is a preset initial value and the configuration information of the partition tag area is not written with valid data, it is determined that the upgrade is not started; wherein the preset initial value is 0 or a null value, and the valid data is a combination of a partition number, a programming start address and a programming length in a preset format.

[0074] In some embodiments, after the system receives the upgrade start instruction of the application software to be upgraded, the upgrade mark bit of the whole package tag area in the target upgrade tag area is first read. The upgrade mark bit has a preset initial value of 0 or a null value, which is used to identify whether the upgrade is started. At the same time, the system detects the configuration information of the partition tag area in the target upgrade tag area to determine whether there is valid data. The valid data specifically refers to a combination of a partition number, a programming start address and a programming length in a preset format, and if no such required configuration information is written in the partition tag area, it is determined that there is no valid data. When it is detected that the upgrade mark bit is the preset initial value and the partition tag area is not written with valid data, the system determines that the upgrade corresponding to the target upgrade tag area is not started, and then performs the subsequent upgrade initialization related operation; if the upgrade mark bit is not the preset initial value or the partition tag area is written with valid data, it is indicated that the upgrade has been started or has been started, and the system will process according to the corresponding process to avoid the repeated initialization affecting the upgrade process.

[0075] In some examples, with reference to Figure 3, the whole package upgrade label area (Ka) is used to record the total number of application software partitions involved in this upgrade, the upgrade start marker, and the number of partitions that have been successfully upgraded so far. At the beginning of the upgrade, the number is initially 0; each time a partition is successfully upgraded, the number is incremented by 1; when the number is consistent with the total number of partitions, it indicates that the whole package upgrade has been completed. The partition upgrade label areas (K1~Kn) correspond to the software partitions (C1~Cn) one by one. Each label area Ki is used to record the key information of the corresponding partition Ci, including the software Code partition number of the partition, the upgrade start address of the partition in the RRAM, the upgrade length of the partition, and the start marker and completion marker of the software upgrade of the partition. In the RRAM, the label areas K1~Kn are stored in a fixed offset manner, that is, the start address of each partition Ki has a fixed offset relative to the base address of the label area. Therefore, during runtime, the start position of the corresponding label area Ki can be directly calculated according to the partition number, thereby realizing fast reading and writing of the label. By using the characteristic of RRAM supporting overlay programming, each type of marker and parameter information in the above label area can be updated in real time during the upgrade process, without the need for erasing operation.

[0076] In other examples, with reference to Figure 4After starting the software over-the-air upgrade, firstly, it is judged whether the software version number required to be upgraded is higher than the version stored in the RRAM. If it is less than or equal to, it is directly considered that the upgrade is completed, so as to prevent version rollback. Then, it is judged whether the upgrade start flag in the tag area Ka is set. If it has been set, it indicates that the previous upgrade is interrupted, and the main flow of the RRAM programming software partition is directly jumped. If the upgrade start flag has not been set, it indicates that it is the first upgrade, and an upgrade initialization stage is entered, including setting the current upgrade success area number to 0, initializing the upgrade tag area K1-Kn, and setting the upgrade start flag. The initialization of the upgrade tag area mainly programs the partition number, the upgrade start address and the upgrade length information of the tag area K1-Kn into the RRAM according to a fixed offset. After entering the main flow of the RRAM programming software partition, firstly, the current upgrade success partition number is obtained from the tag area Ka and is added by 1, as the first partition for starting programming. Before starting programming the RRAM in each partition, the upgrade start flag of the corresponding tag area is set, and then the corresponding application software partition is programmed to the specified RRAM address according to the upgrade start address and the upgrade length of the current partition recorded in the corresponding tag area through the RRAM programming interface. After the software in the current partition is programmed, the upgrade completion flag of the current partition is set, and the current upgrade success area number in the tag area Ka is added by 1, and then the cycle of programming the next partition is entered. Finally, when the current upgrade success area number in the tag area Ka is consistent with the total number of partitions, it indicates that the whole upgrade flow is completed. At any time during the main flow of the RRAM programming software partition, whether it is actively interrupted or accidentally interrupted, when entering the software over-the-air upgrade flow next time, the upgrade can be continued from the interrupted partition according to the current upgrade success area number in the tag area Ka until the whole application software package is upgraded.

[0077] In some embodiments of the present disclosure, the upgrade initialization error caused by ambiguous judgment criteria is avoided, the upgrade initialization operation is ensured to be performed only at the first upgrade, an accurate precondition is provided for the orderly development of the subsequent upgrade flow, and the standardization and accuracy of the upgrade process are guaranteed.

[0078] Some software over-the-air upgrade methods provided by the present disclosure can make full use of the characteristics of the RRAM, adopt the configuration design of two sets of application software storage areas and upgrade tag areas, combine software partitioning and fine tag area setting, and realize the orderly control of the upgrade process. The risk of software damage caused by upgrade exceptions under the single storage area architecture is avoided, the problem of being unable to fine control the partition upgrade progress under the traditional double storage area architecture is solved, the stability and reliability of the upgrade process are significantly improved, the storage utilization rate of the RRAM is improved, and the upgrade flow is more convenient and robust.

[0079] It can be understood that each of the foregoing method embodiments in the specification is described in a progressive manner, and the same / similar parts between each embodiment can be referred to each other, and each embodiment mainly describes the difference from other embodiments. The related parts can be referred to the description of other method embodiments.

[0080] It should be understood that, although each step in the flowchart involved in the accompanying drawings is shown in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the accompanying drawings can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with other steps or at least part of the steps or stages of other steps.

[0081] Based on the foregoing description of the software over-the-air upgrade method embodiments, the present disclosure further provides a software over-the-air upgrade apparatus for implementing the foregoing software over-the-air upgrade method. The apparatus can include a system (including a distributed system), software (application), module, component, controller, server, terminal, etc. using the method described in the embodiments of the present specification, and an apparatus combined with necessary implementation hardware. Based on the same innovative concept, the apparatus provided in one or more embodiments of the present disclosure is described in the following embodiments. Since the implementation scheme of the apparatus to solve the problem is similar to the method, the implementation of the specific apparatus in the embodiments of the present specification can be referred to the implementation of the foregoing method, and the repeated parts will not be described herein. The term "unit" or "module" used below can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and is conceived.

[0082] Figure 5 is a schematic block diagram of a software over-the-air upgrade apparatus according to an exemplary embodiment. The apparatus can be the foregoing terminal, or a server, or a module, component, device, control unit, etc. integrated in the terminal. For details, please refer to the foregoing description of the terminal. Figure 5The device 100 can include a first module 110, a second module 120, a third module 130, a fourth module 140 and a fifth module 150. The first module 110 is configured to set two sets of corresponding configuration application software storage areas and upgrade tag areas in the resistive random access memory, and the two sets of corresponding configuration application software storage areas and the upgrade tag areas are respectively used to store current running software or to-be-upgraded application software and record upgrade state information of the corresponding storage areas. The second module 120 is configured to divide the to-be-upgraded application software into a plurality of software partitions according to an actual software structure, and the upgrade tag area includes a whole package tag area and a partition tag area corresponding to each software partition. The third module 130 is configured to, in response to starting of the to-be-upgraded application software, initialize upgrade progress information of the whole package tag area and configuration information of the partition tag area in a target upgrade tag area, and set an upgrade flag, in a case where an upgrade version meets preset requirements and the target upgrade tag area is not started for upgrade. The fourth module 140 is configured to sequentially program the software partitions into corresponding application software storage areas according to upgrade progress recorded in the whole package tag area in the target upgrade tag area, and synchronously update the upgrade progress of the whole package tag area and upgrade state information of the corresponding partition tag area. The fifth module 150 is configured to switch to the corresponding application software storage area and the upgrade tag area after all partition upgrades are verified, and complete version update.

[0083] The modules in the above software over-the-air upgrade device can be implemented by software, hardware or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in a hardware form, or stored in a memory in the computer device in a software form, so as to be called and executed by the processor to perform operations corresponding to the modules.

[0084] In one embodiment, a computer device is provided, which can be a terminal. An internal structure diagram of the computer device can be as shown in FIG. 1. Figure 6 The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is configured to perform wired or wireless communication with an external terminal. The wireless communication can be achieved by WIFI, mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by the processor to implement a software over-the-air upgrade method.

[0085] Those skilled in the art can understand that Figure 6The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0086] According to the foregoing related method and device embodiment description, the present disclosure also provides a computer device including a memory and a processor, the memory stores a computer program, and the computer program is executed by the processor to implement the software over-the-air upgrade method described in any embodiment of the present specification.

[0087] According to the foregoing related method and device embodiment description, the present disclosure also provides a computer readable storage medium, when the instructions in the computer readable storage medium are executed by the processor of the computer device, the computer device can implement the software over-the-air upgrade method as described in any embodiment of the present disclosure.

[0088] According to the foregoing related method and device embodiment description, the present disclosure also provides a computer program product including a computer program, and the computer program is executed by the processor to implement the software over-the-air upgrade method described in any embodiment of the present specification.

[0089] Each of the embodiments in the present specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for hardware + program type 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 embodiment.

[0090] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. The non-volatile memory includes at least resistive random access memory, and can also include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. The volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0091] It should be noted that the above-mentioned apparatus, computer device, storage medium and computer program product, etc. according to the description of the method embodiments can also include other embodiments. The specific implementation can refer to the description of the related method embodiments. Meanwhile, the mutual combination of the features of each method and the embodiments of the apparatus, device and server constitutes new embodiments, which still belong to the scope of the embodiments covered by the present disclosure, and are not described here.

[0092] For ease of description, the above apparatus is described in various modules with functions respectively. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in one or more software and / or hardware, and modules implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The above-described apparatus embodiments are only illustrative, for example, the division of modules or units is only a logical function division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the coupling, communication connection, etc. between the apparatuses or units shown or described can be directly and / or indirectly coupled / connected in a manner, which can be through some standard or self-defined interface, protocol, etc., and is in an electrical, mechanical or other form.

[0093] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure following the general principles thereof and including such departures from the present disclosure that come within known use or custom in the art to which the present disclosure pertains. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0094] It should be understood that the present disclosure is not limited to the precise structures herein described and illustrated above, and that various modifications and changes in the herein described embodiments can be effected without departing from the scope of the application.

Claims

1. A method for over-the-air software updates, characterized in that, Applied to an electronic control unit, wherein the electronic control unit uses resistive random access memory as non-volatile memory, the method includes: Two sets of corresponding application software storage areas and upgrade tag areas are set in the resistive random access memory, which are used to store the currently running software or the application software to be upgraded, and to record the upgrade status information of the corresponding storage area, respectively. The application software to be upgraded is divided into several software partitions according to the actual software structure. The upgrade tag area includes the whole package tag area and the partition tag area corresponding to each software partition. In response to the application software to be upgraded starting an upgrade, if the upgrade version meets the preset requirements and the target upgrade tag area has not started an upgrade, the upgrade progress information of the whole package tag area and the configuration information of the partition tag area in the target upgrade tag area are initialized, and the upgrade flag is set. Based on the upgrade progress recorded in the whole package tag area in the target upgrade tag area, the software partitions are sequentially programmed to the corresponding application software storage area, and the upgrade progress of the whole package tag area and the upgrade status information of the corresponding partition tag area are updated synchronously. After all partition upgrades pass verification, switch to the corresponding application software storage area and upgrade tab area to complete the version update.

2. The method according to claim 1, characterized in that, The version number of the application software to be upgraded is stored at the end of the last partition among the plurality of software partitions; The upgraded version meets the preset requirements, including: the version number of the application software to be upgraded is higher than the version number of the currently running software, and the consistency verification between the version numbers of the application software to be upgraded and the currently running software passes.

3. The method according to claim 1, characterized in that, The upgrade progress information recorded in the whole package label area includes at least one of the following: the total number of software partitions and the serial number of the partition that has been successfully upgraded; the configuration information in the partition label area includes at least one of the following: the number of the corresponding software partition, the programming start address, and the programming length; the upgrade status information includes at least one of the following: the upgrade start marker and the upgrade completion marker for the corresponding software partition.

4. The method according to claim 3, characterized in that, The method further includes: If an interruption occurs during the upgrade process, the next time the upgrade is started, the system will directly read the partition number that has been successfully upgraded from the whole package tag area in the target upgrade tag area, and continue to execute programming and upgrade status updates from the next software partition of the partition number until the version update is completed.

5. The method according to claim 4, characterized in that, The method further includes: Perform an integrity check on the software partition corresponding to the partition number. If the check passes, continue the upgrade from the next partition. If the check fails, clear the upgrade progress information of the target upgrade tag area and restart the upgrade from the first software partition.

6. The method according to claim 1, characterized in that, In response to the application software to be upgraded initiating an upgrade, if the upgrade version meets preset requirements and the target upgrade tag area has not initiated an upgrade, the upgrade progress information of the entire package tag area and the configuration information of the partition tag area in the target upgrade tag area are initialized, and the upgrade flag is set, including: Read the upgrade flag bit of the whole package tag area in the target upgrade tag area. If the upgrade flag bit is a preset initial value and the configuration information of the partition tag area has not been written with valid data, it is determined that the upgrade has not been started. The preset initial value is 0 or empty, and the valid data is a combination of partition number, programming start address and programming length that conforms to a preset format.

7. A software over-the-air (OTA) update device, characterized in that, The device includes: The first module is used to set up two sets of corresponding application software storage areas and upgrade tag areas in the resistive random access memory, which are used to store the currently running software or the application software to be upgraded, and record the upgrade status information of the corresponding storage area. The second module is used to divide the application software to be upgraded into several software partitions according to the actual software structure. The upgrade tag area includes a whole package tag area and a partition tag area corresponding to each software partition. The third module is used to respond to the application software to be upgraded starting the upgrade. If the upgrade version meets the preset requirements and the target upgrade tag area has not started the upgrade, the upgrade progress information of the whole package tag area and the configuration information of the partition tag area in the target upgrade tag area are initialized, and the upgrade flag is set. The fourth module is used to sequentially program the software partitions to the corresponding application software storage area according to the upgrade progress recorded in the whole package tag area in the target upgrade tag area, and synchronously update the upgrade progress of the whole package tag area and the upgrade status information of the corresponding partition tag area. The fifth module is used to switch to the corresponding application software storage area and upgrade tag area after all partition upgrade verifications have passed, thus completing the version update.

8. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, It stores a computer program thereon, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 6.