Low-cost, efficient and reliable upgrading method and device based on single-partition MCU

By deploying Fast-DDS and XRCE-DDS agents in SOC and MCU systems, efficient and reliable upgrades of single-partition MCUs are achieved, solving the problem that single-partition MCUs cannot quickly restore the old version during the upgrade process, and improving the stability and reliability of the upgrade.

CN121900782APending Publication Date: 2026-04-21BEIJING MECHANICAL EQUIP INST
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING MECHANICAL EQUIP INST
Filing Date
2025-12-01
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

How to achieve efficient and reliable upgrade functionality while ensuring low cost for single-partition MCUs, and solve the problem that traditional single-partition MCUs cannot quickly restore the old version during the upgrade process?

Method used

Deploy Fast-DDS and XRCE-DDSAgent agents in the SOC system and XRCE-DDS in the MCU system. Communicate with XRCE-DDSAgent through Fast-DDS to query and transmit upgrade package versions, use the MD5 algorithm to verify the integrity of the upgrade package, and maintain a heartbeat keep-alive state during the upgrade process to ensure the stability and reliability of the upgrade process.

Benefits of technology

It enhances the real-time performance and stability of the upgrade process, solves the problems of data loss and system errors in single-partition MCUs during the upgrade process, realizes an efficient and reliable upgrade process, and supports version rollback to ensure system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121900782A_ABST
    Figure CN121900782A_ABST
Patent Text Reader

Abstract

The invention relates to a low-cost, efficient and reliable upgrading method and device based on a single-partition MCU, electronic equipment and a storage medium. The method comprises the following steps: deploying a Fast-DDS (Direct Digital Synthesizer) and an XRCE-DDS Agent agent in an SOC (System On Chip) system, and deploying the XRCE-DDS in an MCU (Microprogrammed Control Unit) system; the method comprises the following steps of: issuing a Bootloader entering request to an XRCE-DDS Agent through a Fast-DDS (Direct Digital Synthesizer) in an SOC (System On Chip) system, and carrying out upgrade package version query; if the version number of the upgrade package is higher than the version number of the current MCU, a request for preparing to enter an upgrade state is issued to the XRCE-DDS Agent through Fast-DDS in the SOC system, and the SOC system sends an upgrade package file to the MCU system; and the MCU system is upgraded based on the upgrade package file. According to the method, the real-time performance and the stability of the upgrading process are enhanced, the defect that version rollback cannot be efficiently carried out if errors occur in the upgrading process or upgrading package manufacturing is wrong due to the fact that an old software package cannot be backed up is overcome, and the reliability of MCU upgrading is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of embedded systems, and more specifically, to a low-cost, efficient, and reliable upgrade method, apparatus, electronic device, and computer-readable storage medium based on a single-partition MCU. Background Technology

[0002] Microcontroller units (MCUs) play a crucial role in various fields such as automotive electronics, smart home systems, medical devices, industrial automation, and aerospace due to their powerful computing capabilities, low power consumption, and miniaturization. In terms of functional structure, MCUs are mainly divided into two types: single-partition and dual-partition.

[0003] In terms of application scenarios, dual-partition MCUs can simultaneously support two independent operating system versions. This allows for system backup via the other partition while updating one, significantly improving the stability and reliability of system upgrades. Traditional single-partition MCUs, on the other hand, require system downtime for upgrades, and if the new firmware has issues, it's impossible to quickly restore the old version. The reliability advantages of dual-partition MCUs are unmatched by traditional single-partition MCUs. However, compared to dual-partition MCUs, single-partition MCUs are known for their lower manufacturing costs, power consumption, and development complexity, making them more cost-effective overall.

[0004] In applications with stringent requirements for security and reliability, such as automotive and medical equipment, many companies opt for dual-partition MCUs, sacrificing overall cost. A key area of ​​research for engineers is how to achieve the security and reliability of a dual-partition MCU while maintaining the low cost of a single-partition MCU, and simultaneously enabling efficient and rapid MCU upgrades.

[0005] In existing technical solutions, many documents use traditional methods to transmit upgrade packages. For example, CN120034850A describes an OTA upgrade system, method, and vehicle for in-vehicle instruments, which uses a wireless network mode and CRC cyclic verification to check the upgrade package and transmits it from the SOC to the MCU via UART. While this ensures the integrity of the upgrade package, the reliability and stability of the wireless network module are poor, the SPI and UART serial port transmission efficiency is low, and there is a lack of version management procedures. CN119109620A describes a network-secure MCU software upgrade method and system, which includes version management methods such as version information verification. It achieves reliable upgrades by using asymmetric algorithms to verify network security multiple times during network interaction, but the steps are cumbersome, and the overall MCU upgrade process is secure but not efficient.

[0006] Therefore, one or more methods are needed to solve the above problems.

[0007] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0008] The purpose of this disclosure is to provide a low-cost, efficient, and reliable upgrade method, apparatus, electronic device, and computer-readable storage medium based on a single-partition MCU, thereby overcoming at least to some extent one or more problems caused by the limitations and defects of related technologies.

[0009] According to one aspect of this disclosure, a low-cost, efficient, and reliable upgrade method based on a single-partition MCU is provided, comprising:

[0010] Deploy Fast-DDS and XRCE-DDSAgent agents in the SOC system, and deploy XRCE-DDS in the MCU system;

[0011] The upgrade package version is queried by sending a request to the XRCE-DDSAgent via Fast-DDS in the SOC system to enter the bootloader;

[0012] If the upgrade package version number is higher than the current MCU version number, the SOC system sends a request to XRCE-DDSAgent via Fast-DDS to prepare to enter the upgrade state, and the SOC system sends the upgrade package file to the MCU system.

[0013] The MCU system is upgraded based on the aforementioned upgrade package file.

[0014] In one exemplary embodiment of this disclosure, the method further includes:

[0015] The XRCE-DDSAgent agent deployed in the SOC system serves as a protocol converter between the Fast-DDS deployed in the SOC system and the XRCE-DDS deployed in the MCU system.

[0016] In one exemplary embodiment of this disclosure, the method further includes:

[0017] The MCU system is activated to ensure a heartbeat keep-alive state with the XRCE-DDSAgent agent;

[0018] The MCU new version upgrade package processed by the Md5 algorithm is stored in the preset storage path of the SOC system;

[0019] Run the SOC system to extract the upgrade package version information stored in the preset upgrade package storage path;

[0020] In the SOC system, a request to enter the Bootloader is sent to the XRCE-DDSAgent via Fast-DDS;

[0021] The XRCE-DDSAgent forwards the bootloader entry request to the XRCE-DDS in the MCU;

[0022] The MCU system receives the request, enters the Bootloader, and responds with a successful Bootloader entry status.

[0023] The SOC system sends a query request for the current MCU version to the XRCE-DDSAgent via Fast-DDS.

[0024] The MCU system receives a version query request, reads the version information at the specified address, and responds with a version number.

[0025] After receiving the current MCU version number, the SOC system compares it with the version number extracted from the upgrade package. If the upgrade package version number is higher than the current MCU version number, the upgrade process continues, and the upgrade package version number is sent to XRCE-DDS.

[0026] In one exemplary embodiment of this disclosure, the method further includes:

[0027] If the upgrade package version number is equal to or lower than the current MCU version number, the upgrade process will be terminated, and a request to terminate the Bootloader and enter the APP will be sent to XRCE-DDS.

[0028] In one exemplary embodiment of this disclosure, the method further includes:

[0029] The MCU system receives the upgrade package version number, erases the original version number at the corresponding address, writes the new upgrade package version number, and responds to the SOC system with a version number writing success status.

[0030] In the SOC system, a request to prepare to enter the upgrade state is sent to the XRCE-DDSAgent via Fast-DDS;

[0031] Upon receiving the request, the MCU system responded that it was ready to receive the upgrade package.

[0032] After receiving a response from the MCU system indicating that it is ready for upgrade, the SOC system sends an upgrade package file to the MCU system via serial port using the XYModem protocol.

[0033] After the upgrade package file is transmitted, the MCU system uses the same Md5 algorithm to process the content of the received upgrade package file, calculates a new hash value, and compares it with the Md5 hash value carried in the upgrade package file to determine the completeness of the upgrade package file.

[0034] After confirming the integrity of the upgrade package file, the MCU system erases the original APP content at the corresponding address and writes the new APP content into the upgrade package file. After successful writing, it responds to the SOC system with an upgrade success status.

[0035] After confirming that the MCU system upgrade is complete, the SOC system sends an APP entry request to XRCE-DDSAgent, switching from the Bootloader state to the APP running state;

[0036] Upon receiving the request, the MCU system restarts and enters the running state, running the contents of the upgraded version package.

[0037] In one exemplary embodiment of this disclosure, the method further includes:

[0038] Once the SOC system confirms that the MCU system has successfully upgraded, it will back up the current upgrade package from the upgrade package storage path to the preset upgrade package backup path.

[0039] In one exemplary embodiment of this disclosure, the method further includes:

[0040] If communication or upgrade fails, the backup file in the preset upgrade package backup path is read, and the MCU system is restored based on the backup file.

[0041] In one aspect of this disclosure, a low-cost, high-efficiency, and reliable upgrade device based on a single-partition MCU is provided, comprising:

[0042] The system deployment module is used to deploy Fast-DDS and XRCE-DDSAgent agents in SOC systems and XRCE-DDS in MCU systems.

[0043] The upgrade package query module is used to query the upgrade package version by sending a request to the XRCE-DDSAgent via Fast-DDS to enter the bootloader in the SOC system;

[0044] The upgrade package transmission module is used to send a request to XRCE-DDSAgent via Fast-DDS in the SOC system to prepare to enter the upgrade state if the upgrade package version number is higher than the current MCU version number, and the SOC system sends the upgrade package file to the MCU system.

[0045] The system upgrade module is used to upgrade the MCU system based on the upgrade package file.

[0046] In one aspect of this disclosure, an electronic device is provided, comprising:

[0047] Processor; and

[0048] A memory storing computer-readable instructions that, when executed by the processor, implement the method according to any one of the preceding claims.

[0049] In one aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the method according to any one of the preceding claims.

[0050] This disclosure discloses an exemplary embodiment of a low-cost, efficient, and reliable upgrade method for a single-partition MCU. The method includes: deploying Fast-DDS and XRCE-DDSAgent agents in a System-on-Chips (SOC) system, and deploying XRCE-DDS in the MCU system; querying the upgrade package version by sending a bootloader entry request via Fast-DDS to the XRCE-DDSAgent in the SOC system; if the upgrade package version number is higher than the current MCU version number, sending a request to prepare for upgrade state via Fast-DDS to the XRCE-DDSAgent in the SOC system, and then sending the upgrade package file to the MCU system; and performing the upgrade based on the upgrade package file. This disclosure enhances the real-time performance and stability of the upgrade process, overcoming the shortcoming of not being able to back up old software packages, which prevents efficient version rollback if the upgrade process fails or the upgrade package is incorrectly created, thus greatly improving the reliability of MCU upgrades.

[0051] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0052] The above and other features and advantages of this disclosure will become more apparent from the detailed description of exemplary embodiments thereof with reference to the accompanying drawings.

[0053] Figure 1 A flowchart is shown for a low-cost, efficient, and reliable upgrade method based on a single-partition MCU according to an exemplary embodiment of the present disclosure;

[0054] Figure 2 A structural block diagram of a low-cost, high-efficiency, and reliable upgrade device based on a single-partition MCU is shown according to an exemplary embodiment of the present disclosure;

[0055] Figure 3 A schematic block diagram of a low-cost, high-efficiency, and reliable upgrade device based on a single-partition MCU is shown according to an exemplary embodiment of the present disclosure;

[0056] Figure 4 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown schematically;

[0057] Figure 5 The illustration shows a schematic diagram of a computer-readable storage medium according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0058] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.

[0059] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of the specific details described, or other methods, components, materials, apparatuses, steps, etc., can be employed. In other instances, well-known structures, methods, apparatuses, implementations, materials, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0060] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, or in one or more software-hardened modules, or in different network and / or processor devices and / or microcontroller devices.

[0061] In this example embodiment, a low-cost, efficient, and reliable upgrade method based on a single-partition MCU is first provided; see reference. Figure 1 As shown, this low-cost, efficient, and reliable upgrade method based on a single-partition MCU may include the following steps:

[0062] Step S110: Deploy Fast-DDS and XRCE-DDS Agent in the SOC system, and deploy XRCE-DDS in the MCU system;

[0063] Step S120: In the SOC system, a request to enter the bootloader is sent to the XRCE-DDS Agent via Fast-DDS to query the upgrade package version.

[0064] Step S130: If the upgrade package version number is higher than the current MCU version number, the SOC system sends a request to the XRCE-DDS Agent via Fast-DDS to prepare to enter the upgrade state, and the SOC system sends the upgrade package file to the MCU system.

[0065] Step S140: The MCU system upgrades based on the upgrade package file.

[0066] This disclosure discloses an exemplary embodiment of a low-cost, efficient, and reliable upgrade method for a single-partition MCU. The method includes: deploying Fast-DDS and an XRCE-DDS Agent in a System-on-Chips (SOC) system, and deploying XRCE-DDS in the MCU system; querying the upgrade package version by sending a bootloader entry request via Fast-DDS to the XRCE-DDS Agent in the SOC system; if the upgrade package version number is higher than the current MCU version number, sending a request to prepare for upgrade mode via Fast-DDS to the XRCE-DDS Agent in the SOC system, and then sending the upgrade package file to the MCU system; and performing the upgrade based on the upgrade package file. This disclosure enhances the real-time performance and stability of the upgrade process, overcomes the shortcoming of not being able to back up old software packages, which prevents efficient version rollback if the upgrade process fails or the upgrade package is incorrectly created, and greatly improves the reliability of MCU upgrades.

[0067] The following will further explain a low-cost, efficient, and reliable upgrade method based on a single-partition MCU in this example embodiment.

[0068] Example 1:

[0069] In step S110, Fast-DDS and XRCE-DDS Agent can be deployed in the SOC system, and XRCE-DDS can be deployed in the MCU system.

[0070] In this example embodiment, the method further includes:

[0071] The XRCE-DDS Agent deployed in the SOC system acts as a protocol converter between the Fast-DDS deployed in the SOC system and the XRCE-DDS deployed in the MCU system.

[0072] In step S120, the upgrade package version can be queried by sending a request to the XRCE-DDS Agent via Fast-DDS in the SOC system to enter the bootloader.

[0073] In this example embodiment, the method further includes:

[0074] The MCU system is activated to ensure a heartbeat keep-alive state with the XRCE-DDS Agent.

[0075] The MCU new version upgrade package processed by the Md5 algorithm is stored in the preset storage path of the SOC system;

[0076] Run the SOC system to extract the upgrade package version information stored in the preset upgrade package storage path;

[0077] In the SOC system, a request to enter the Bootloader is sent to the XRCE-DDS Agent via Fast-DDS;

[0078] The XRCE-DDS Agent forwards the Bootloader entry request to the XRCE-DDS in the MCU;

[0079] The MCU system receives the request, enters the Bootloader, and responds with a successful Bootloader entry status.

[0080] In the SOC system, a query request for the current MCU version is sent to the XRCE-DDS Agent via Fast-DDS;

[0081] The MCU system receives a version query request, reads the version information at the specified address, and responds with a version number.

[0082] After receiving the current MCU version number, the SOC system compares it with the version number extracted from the upgrade package. If the upgrade package version number is higher than the current MCU version number, the upgrade process continues, and the upgrade package version number is sent to XRCE-DDS.

[0083] In this example embodiment, the method further includes:

[0084] If the upgrade package version number is equal to or lower than the current MCU version number, the upgrade process will be terminated, and a request to terminate the Bootloader and enter the APP will be sent to XRCE-DDS.

[0085] In step S130, if the upgrade package version number is higher than the current MCU version number, the SOC system may send a request to the XRCE-DDS Agent via Fast-DDS to prepare to enter the upgrade state, and the SOC system may send the upgrade package file to the MCU system.

[0086] In this example embodiment, the method further includes:

[0087] The MCU system receives the upgrade package version number, erases the original version number at the corresponding address, writes the new upgrade package version number, and responds to the SOC system with a version number writing success status.

[0088] In the SOC system, a request to prepare to enter the upgrade state is sent to the XRCE-DDS Agent via Fast-DDS;

[0089] Upon receiving the request, the MCU system responded that it was ready to receive the upgrade package.

[0090] After receiving a response from the MCU system indicating that it is ready for upgrade, the SOC system sends an upgrade package file to the MCU system via serial port using the XYModem protocol.

[0091] After the upgrade package file is transmitted, the MCU system uses the same Md5 algorithm to process the content of the received upgrade package file, calculates a new hash value, and compares it with the Md5 hash value carried in the upgrade package file to determine the completeness of the upgrade package file.

[0092] After confirming the integrity of the upgrade package file, the MCU system erases the original APP content at the corresponding address and writes the new APP content into the upgrade package file. After successful writing, it responds to the SOC system with an upgrade success status.

[0093] After confirming that the MCU system upgrade is complete, the SOC system sends an APP entry request to the XRCE-DDS Agent, switching from the Bootloader state to the APP running state;

[0094] Upon receiving the request, the MCU system restarts and enters the running state, running the contents of the upgraded version package.

[0095] In this example embodiment, the method further includes:

[0096] Once the SOC system confirms that the MCU system has successfully upgraded, it will back up the current upgrade package from the upgrade package storage path to the preset upgrade package backup path.

[0097] In step S140, the MCU system can be upgraded based on the upgrade package file.

[0098] In this example embodiment, the method further includes:

[0099] If communication or upgrade fails, the backup file in the preset upgrade package backup path is read, and the MCU system is restored based on the backup file.

[0100] Example 2:

[0101] In this example embodiment, the present invention provides a low-cost reliable MCU upgrade method based on a single-partition MCU microcontroller unit combined with an on-chip domain control module unit of an SOC and DDS middleware, thereby overcoming, to at least a certain extent, the security and reliability problems caused by data loss and system operation errors that are prone to occur during the upgrade process of a single-partition MCU, while efficiently completing the upgrade action.

[0102] This application provides an MCU paired with a SOC module unit, aiming to achieve a highly reliable upgrade method and process with a low-cost, low-development-complexity, and low-power single-partition MCU. Simultaneously, it deploys XRCE-DDS middleware in the MCU and Fast-DDS middleware in the SOC, using the DDS middleware as the information transmission medium between the SOC and MCU. This enhances the real-time performance and stability of the upgrade process, compensates for the inability to back up old software packages, and addresses the shortcoming of inefficient version rollback if the upgrade process fails or the upgrade package is incorrectly created. This significantly improves the reliability of MCU upgrades.

[0103] In the embodiments of this example, as Figure 2 As shown in the embodiment of this application, a system integrating a single-zone microcontroller unit (MCU) and an in-vehicle domain controller system-on-a-chip (SOC) module is provided. The system includes: a single-zone MCU module, an SOC domain controller module, a power supply module, and a personal computer (PC) display module.

[0104] The single-partition MCU module is the target of the upgrade in this embodiment. The low-cost, efficient and reliable upgrade method proposed in this embodiment improves the existing conventional upgrade process.

[0105] Furthermore, the single-partition MCU module integrates a real-time operating system (RTOS), providing multi-tasking capabilities and interrupt management capabilities to support the execution of upgrade tasks;

[0106] Furthermore, the single-partition MCU module has a sufficiently large RAM capacity, for example, at least 32KB or more. This configuration provides ample flash storage space for XRCE-DDS and other necessary software deployments;

[0107] Furthermore, the single-partition MCU module is equipped with a CPU to ensure that it can provide the corresponding processing capabilities for XRCE-DDS;

[0108] Furthermore, the single-partition MCU module has multiple communication interfaces, including but not limited to serial ports and network interfaces, providing a hardware foundation for data exchange with the SOC;

[0109] Furthermore, the XRCE-DDS communication middleware is deployed on the single-partition MCU module as the software foundation for establishing communication with its corresponding SOC module.

[0110] The on-chip domain controller module of the SOC is a key component in the advanced embedded system. It works in conjunction with the single-partition MCU module to manage high-level data processing, communication tasks, user interface operations, and complex functions.

[0111] Furthermore, the SOC module has a multi-threaded CPU, providing sufficient runtime capabilities to deploy the Fast-DDS communication middleware;

[0112] Furthermore, the SOC module has a sufficiently large RAM capacity, for example, at least 128MB or more, to provide sufficient memory for data storage and caching operations for Fast-DDS and other necessary on-chip software.

[0113] Furthermore, the SOC module has Linux or other real-time operating systems (RTOS) to provide a deployment environment for Fast-DDS and other necessary on-chip software;

[0114] Furthermore, the SOC module has an interface that matches the MCU module, providing the hardware foundation for communication between the two.

[0115] Furthermore, the SOC module deploys Fast-DDS middleware, providing the software foundation for communication with the MCU module.

[0116] The power module is connected to each sub-module to ensure the power supply and electrical signal transmission of the entire system.

[0117] The personal computer (PC) display module is used to connect the serial port between the SOC domain controller module and the MCU module, and displays the process log information generated during the overall upgrade process in real time, thereby assisting technicians in monitoring and understanding the upgrade process.

[0118] The XRCE-DDS communication middleware is a data distribution service specifically designed for resource-constrained environments such as MCUs. Based on the OMG DDS standard, it is optimized for embedded systems and, compared to ordinary DDS middleware, is more suitable for scenarios requiring low power consumption, high reliability, and real-time data transmission. It features lightweight, real-time performance, scalability, security, and interoperability, and its performance in various aspects during actual data transmission between SOCs and MCUs outperforms traditional serial methods such as UART. Especially in the field of autonomous driving, deploying XRCE-DDS in MCUs can greatly ensure the system's real-time responsiveness and safety.

[0119] Example 3:

[0120] In this example embodiment, step S2110 involves deploying Fast-DDS in the SOC system and XRCE-DDS in the MCU system. To establish a data channel between the two, an XRCE-DDS Agent needs to be additionally deployed in the SOC system, which acts as a protocol converter between them.

[0121] Step S2120: Run the MCU program to ensure that it maintains a heartbeat keep-alive state with the Agent.

[0122] Step S2130: In order to verify the integrity and consistency of the upgrade package in the future, the new version upgrade package of the MCU after processing by the Md5 algorithm is stored in a specific path of the SOC system so that the upgrade package in the path can be read and transmitted to the MCU in the subsequent upgrade process;

[0123] Step S2140: Run the SOC program to extract the upgrade package version information stored in the specific upgrade package storage path for subsequent version comparison;

[0124] Step S2150: In the SOC program, a request to enter the Bootloader is sent to the XRCE-DDS Agent via Fast-DDS;

[0125] In step S2160, the XRCE-DDS Agent forwards the Bootloader entry request to the XRCE-DDS in the MCU;

[0126] In step S2170, the MCU receives the request, enters the Bootloader, and responds with a successful Bootloader entry status.

[0127] Step S2180: In the SOC program, a query request for the current MCU version is sent to the XRCE-DDS Agent via Fast-DDS;

[0128] In step S2190, the MCU receives a version query request, reads the version information at the specified address, and responds with a version number;

[0129] In step S2200, after receiving the current MCU version number, the SOC compares it with the version number extracted from the upgrade package. If the upgrade package version number is higher than the current MCU version number, the upgrade action continues and the upgrade package version number is sent to XRCE-DDS. If the upgrade package version number is equal to or lower than the current MCU version number, the upgrade action is terminated and a request to terminate the Bootloader and enter the APP is sent to XRCE-DDS.

[0130] In step S2210, the MCU receives the upgrade package version number, erases the original version number at the corresponding address, writes the new upgrade package version number, and sends a successful version number response to the SOC.

[0131] Step S2220: In the SOC program, a request to prepare to enter the upgrade state is sent to the XRCE-DDS Agent via Fast-DDS;

[0132] Step S2230: After receiving the request, the MCU responds that it is ready to receive the upgrade package;

[0133] Step S2240: After receiving the response that the MCU is in upgrade mode, the SOC program sends the upgrade package file to the MCU via serial port using the XYModem protocol;

[0134] Step S2250: After the upgrade package file is transmitted, the MCU uses the same Md5 algorithm to process the content of the received upgrade package file to calculate a new hash value, and compares it with the Md5 hash value carried in the upgrade package file. If the two hash values ​​are exactly the same, it indicates that the upgrade package file has not been damaged during transmission and can be upgraded.

[0135] Step S2260: After ensuring the integrity of the upgrade package file, the MCU erases the original APP content in the corresponding address and writes the new APP content in the upgrade package file. After successful writing, the MCU responds to the SOC with an upgrade success status.

[0136] Step S2270: After the SOC confirms that the MCU upgrade is complete, it sends an APP entry request to the XRCE-DDS Agent and switches from the Bootloader state to the APP running state.

[0137] In step S2280, after receiving the request, the MCU restarts and enters the running state, at which point it runs the new version upgrade package content;

[0138] Step S2290: After the SOC confirms that the MCU has been successfully upgraded, it backs up the current upgrade package from the upgrade package storage path to a specific upgrade package backup path so that the backup file can be used as a recovery basis in case of the next upgrade failure.

[0139] Specifically: In step S2300, if any step fails during steps S2110 to S2290, such as a failure in the MCU response, an upgrade rollback process is automatically initiated between the SOC and the MCU. The SOC's program reads the MCU backup package stored in a specific path on the SOC and transmits and writes the MCU backup package according to steps S2150, S2160, S2170, S2220, S2230, S2240, S2250, S2260, and S2270, completing the backup process.

[0140] In this example embodiment, based on the description of the above embodiments of the present invention, the basic method steps for achieving efficient and reliable upgrades of a single-partition MCU by combining the SOC on-chip domain control system, the MCU microcontroller system, and the DDS middleware proposed by the present invention are clarified. However, the overall process is biased towards the low level, making it inconvenient for non-technical users to perceive the status of each upgrade step during actual user-facing use of the product. Based on this, in order to improve the transparency and visualization of the present invention in practical applications, the present invention provides a preferred embodiment for reference. In the basic steps, the PC is only used to connect the serial ports of the SOC and the MCU to print upgrade process logs on the terminal for technical personnel to monitor. In a more preferred embodiment, a VUE+TypeScript front-end program is deployed on the PC. The PC and the SOC communicate using the HTTP / HTTPS protocol, integrating functions such as uploading the MCU upgrade package, viewing upgrade package version information, deleting the upgrade package, and dynamically displaying the upgrade status into the front-end page, allowing users to manage the upgrade package and monitor the upgrade process through the front-end visual interface. Specifically, the upgrade process status includes, but is not limited to: not upgraded, upgrading in progress, upgrading rollback in progress, successful upgrade, completed upgrade rollback, and failed upgrade. Furthermore, a log management function can be implemented on the front-end page, allowing the download of the upgrade process logs from both the SOC and MCU sides. The SOC logs are directly stored in a specific path within the SOC system, while the MCU log files are transmitted to the SOC via protocols such as XYModem and stored in a specific path. The front-end interface reads the corresponding path in the SOC and downloads the specific process logs, facilitating user tracking and retrospection of each upgrade process.

[0141] In this example embodiment, because DDS supports multiple communication modes such as point-to-point, broadcast, and multicast, and its unique content filtering mechanism reduces unnecessary data transmission, data filtering at the publisher end ensures that only data meeting specific conditions is sent to subscribers, greatly improving network efficiency. Therefore, in addition to the MCU upgrade function, other business interaction functions between the SOC and the MCU can be integrated into the Fast-DDS and XRCE-DDS communication link, maximizing the efficiency of DDS components in completing business communication between the SOC's on-chip domain control system and the MCU's microcontroller system, thereby enhancing the real-time performance and reliability of the entire system architecture. In one possible business scenario, the DDS middleware can also act as an intelligent sensor system between the SOC and the MCU. The MCU is responsible for collecting data from environmental sensors such as temperature and humidity, and performing preliminary preprocessing (e.g., filtering). The processed data is then sent to the SOC via the DDS middleware. Upon receiving the corresponding information, the SOC utilizes its powerful data processing capabilities to perform complex analysis tasks, such as anomaly detection and data analysis. The SOC then returns the processing result to the MCU via the DDS, so as to control the relevant actuators (such as fans or heaters) and thus achieve the purpose of dynamically regulating the system state.

[0142] It should be noted that although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0143] Furthermore, this example embodiment also provides a low-cost, high-efficiency, and reliable upgrade device based on a single-partition MCU. (Refer to...) Figure 3 As shown, the low-cost, high-efficiency, and reliable upgrade device 400 based on a single-partition MCU may include: a system deployment module 410, an upgrade package query module 420, an upgrade package transmission module 430, and a system upgrade module 440. Wherein:

[0144] System deployment module 410 is used to deploy Fast-DDS and XRCE-DDS Agent in SOC system and XRCE-DDS in MCU system;

[0145] The upgrade package query module 420 is used to query the upgrade package version by sending a request to enter the bootloader via Fast-DDS to the XRCE-DDSAgent in the SOC system;

[0146] The upgrade package transmission module 430 is used to send a request to enter the upgrade state to the XRCE-DDS Agent via Fast-DDS in the SOC system if the upgrade package version number is higher than the current MCU version number, and the SOC system sends the upgrade package file to the MCU system.

[0147] The system upgrade module 440 is used to upgrade the MCU system based on the upgrade package file.

[0148] The specific details of each of the above-mentioned low-cost, high-efficiency, and reliable upgrade device modules based on a single-partition MCU have been described in detail in the corresponding low-cost, high-efficiency, and reliable upgrade method based on a single-partition MCU, so they will not be repeated here.

[0149] It should be noted that although several modules or units of a low-cost, high-efficiency, and reliable upgrade device 400 based on a single-partition MCU are mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0150] Furthermore, in an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.

[0151] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented as entirely hardware embodiments, entirely software embodiments (including firmware, microcode, etc.), or embodiments combining hardware and software aspects, collectively referred to herein as “circuit,” “module,” or “system.”

[0152] The following reference Figure 4 To describe an electronic device 500 according to such an embodiment of the present invention. Figure 4 The electronic device 500 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0153] like Figure 4 As shown, the electronic device 500 is manifested in the form of a general-purpose computing device. The components of the electronic device 500 may include, but are not limited to: at least one processing unit 510, at least one storage unit 520, a bus 530 connecting different system components (including storage unit 520 and processing unit 510), and a display unit 540.

[0154] The storage unit stores program code that can be executed by the processing unit 510, causing the processing unit 510 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 510 can perform actions such as... Figure 1 Steps S110 to S140 are shown in the diagram.

[0155] Storage unit 520 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 5201 and / or cache memory 5202, and may further include a read-only memory (ROM) 5203.

[0156] Storage unit 520 may also include a program / utility 5204 having a set (at least one) program module 5205, such program module 5205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0157] Bus 530 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0158] Electronic device 500 can also communicate with one or more external devices 570 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 500, and / or with any device that enables electronic device 500 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 550. Furthermore, electronic device 500 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 560. As shown, network adapter 560 communicates with other modules of electronic device 500 via bus 530. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0159] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0160] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section above.

[0161] refer to Figure 5 As shown, a program product 600 for implementing the above-described method according to an embodiment of the present invention is described. It may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0162] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0163] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0164] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0165] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0166] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0167] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0168] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A low-cost, high-efficiency, and reliable upgrade method based on a single-partition MCU, characterized in that, The method includes: Deploy Fast-DDS and XRCE-DDS Agent in the SOC system, and deploy XRCE-DDS in the MCU system; The upgrade package version is queried by sending a request to the XRCE-DDS Agent via Fast-DDS in the SOC system to enter the bootloader; If the upgrade package version number is higher than the current MCU version number, the SOC system sends a request to the XRCE-DDS Agent via Fast-DDS to prepare to enter the upgrade state, and the SOC system sends the upgrade package file to the MCU system. The MCU system is upgraded based on the aforementioned upgrade package file.

2. The method as described in claim 1, characterized in that, The method further includes: The XRCE-DDS Agent deployed in the SOC system acts as a protocol converter between the Fast-DDS deployed in the SOC system and the XRCE-DDS deployed in the MCU system.

3. The method as described in claim 1, characterized in that, The method further includes: The MCU system is activated to ensure a heartbeat keep-alive state with the XRCE-DDS Agent. The MCU new version upgrade package processed by the Md5 algorithm is stored in the preset storage path of the SOC system; Run the SOC system to extract the upgrade package version information stored in the preset upgrade package storage path; In the SOC system, a request to enter the Bootloader is sent to the XRCE-DDS Agent via Fast-DDS; The XRCE-DDS Agent forwards the Bootloader entry request to the XRCE-DDS in the MCU; The MCU system receives the request, enters the Bootloader, and responds with a successful Bootloader entry status. In the SOC system, a query request for the current MCU version is sent to the XRCE-DDS Agent via Fast-DDS; The MCU system receives a version query request, reads the version information at the specified address, and responds with a version number. After receiving the current MCU version number, the SOC system compares it with the version number extracted from the upgrade package. If the upgrade package version number is higher than the current MCU version number, the upgrade process continues, and the upgrade package version number is sent to XRCE-DDS.

4. The method as described in claim 3, characterized in that, The method further includes: If the upgrade package version number is equal to or lower than the current MCU version number, the upgrade process will be terminated, and a request to terminate the Bootloader and enter the APP will be sent to XRCE-DDS.

5. The method as described in claim 1, characterized in that, The method further includes: The MCU system receives the upgrade package version number, erases the original version number at the corresponding address, writes the new upgrade package version number, and responds to the SOC system with a version number writing success status. In the SOC system, a request to prepare to enter the upgrade state is sent to the XRCE-DDS Agent via Fast-DDS; Upon receiving the request, the MCU system responded that it was ready to receive the upgrade package. After receiving a response from the MCU system indicating that it is ready for upgrade, the SOC system sends an upgrade package file to the MCU system via serial port using the XYModem protocol. After the upgrade package file is transmitted, the MCU system uses the same Md5 algorithm to process the content of the received upgrade package file, calculates a new hash value, and compares it with the Md5 hash value carried in the upgrade package file to determine the completeness of the upgrade package file. After confirming the integrity of the upgrade package file, the MCU system erases the original APP content at the corresponding address and writes the new APP content into the upgrade package file. After successful writing, it responds to the SOC system with an upgrade success status. After confirming that the MCU system upgrade is complete, the SOC system sends an APP entry request to the XRCE-DDS Agent, switching from the Bootloader state to the APP running state; Upon receiving the request, the MCU system restarts and enters the running state, running the contents of the upgraded version package.

6. The method as described in claim 5, characterized in that, The method further includes: Once the SOC system confirms that the MCU system has successfully upgraded, it will back up the current upgrade package from the upgrade package storage path to the preset upgrade package backup path.

7. The method as described in claim 6, characterized in that, The method further includes: If communication or upgrade fails, the backup file in the preset upgrade package backup path is read, and the MCU system is restored based on the backup file.

8. A low-cost, high-efficiency, and reliable upgrade device based on a single-partition MCU, characterized in that, The device includes: The system deployment module is used to deploy Fast-DDS and XRCE-DDS Agent in the SOC system and XRCE-DDS in the MCU system. The upgrade package query module is used to query the upgrade package version by sending a request to the XRCE-DDS Agent via Fast-DDS in the SOC system to enter the bootloader. The upgrade package transmission module is used to send a request to enter the upgrade state to the XRCE-DDS Agent via Fast-DDS in the SOC system if the upgrade package version number is higher than the current MCU version number, and the SOC system sends the upgrade package file to the MCU system. The system upgrade module is used to upgrade the MCU system based on the upgrade package file.

9. An electronic device, characterized in that, include Processor; and A memory storing computer-readable instructions that, when executed by the processor, implement the method according to any one of claims 1 to 7.

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

Citation Information

Patent Citations

  • MCU software upgrading method and system for realizing network security

    CN119109620A

  • Upgrading system and upgrading method of vehicle-mounted instrument OTA and automobile

    CN120034850A