Multi-mcu platform upgrading method and system

By determining the identifier and network topology of the upgrade file in the MCU platform and combining it with CRC check, the compatibility problem of software upgrade methods across multiple MCU platforms is solved, achieving upgrade compatibility and file integrity verification for various network topologies.

CN121387325BActive Publication Date: 2026-11-24WUHAN XINGPAN COMM EQUIP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511506645.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2026-11-24
Estimated Expiration
2045-10-21

AI Technical Summary

Technical Problem

Existing software upgrade methods are incompatible with multi-MCU platforms with different network topologies, making it impossible to implement online upgrade functionality for multi-MCU platforms.

Method used

When the MCU receives the upgrade file, it determines whether the identifier belongs to itself and decides whether to forward the upgrade file based on the network topology type. The MCU identifier is generated by converting the device serial number using a CRC register and combining it with the CRC check of the file header to ensure file integrity, thus achieving compatible upgrades for different topologies.

Benefits of technology

It enables compatible upgrades for various multi-MCU network topologies and features file verification to ensure the correctness and integrity of upgrade files, thus preventing damage to the system from incompatible files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121387325B_ABST
    Figure CN121387325B_ABST
Patent Text Reader

Abstract

This invention provides a multi-MCU platform upgrade method and system. The method includes: each MCU receiving an MCU upgrade file and determining whether the MCU upgrade file belongs to itself; if the MCU upgrade file belongs to itself, writing the MCU upgrade file into the code storage area of ​​each MCU; if the MCU upgrade file does not belong to itself, determining whether each MCU should forward the MCU upgrade file according to its forwarding mode, wherein the forwarding mode of each MCU is set according to the network topology type of the MCU, including forwarding MCU upgrade files that do not belong to itself and not forwarding MCU upgrade files that do not belong to itself; if it is determined that the MCU upgrade file should be forwarded, forwarding the MCU upgrade file to the next-level MCU; otherwise, discarding the MCU upgrade file. This invention realizes internal upgrade functions for various network topologies, and is scalable, compatible with multiple network topologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software function upgrade technology, and in particular to a method and system for upgrading multiple MCU platforms. Background Technology

[0002] In product design, multiple MCU (Microcontroller Unit) devices are often used to complete the control and algorithm functions of the entire system. These multiple MCU platforms share a unified communication interface. From the user's perspective, it is not a matter of whether a specific device is implemented by one or more MCUs.

[0003] In different multiprocessor platforms, the network topologies of multiple MCUs vary. Existing software upgrade methods are incompatible with multi-MCU platforms using different network topologies. Therefore, to achieve online upgrade functionality for multiple MCUs, a multi-MCU platform upgrade method compatible with various network topologies needs to be designed. Summary of the Invention

[0004] This invention provides a multi-MCU platform upgrade method and system to address the shortcomings of existing software upgrade methods that are incompatible with multi-MCU platforms with different network topologies. It provides a multi-MCU platform upgrade method that is compatible with various network topologies and has a file verification function.

[0005] This invention provides a method for upgrading multiple MCU platforms, including: Each MCU receives the MCU upgrade file and determines whether the MCU upgrade file belongs to itself; Once it is determined that the MCU upgrade file belongs to itself, the MCU upgrade file is written to the code storage area of ​​each MCU; If it is determined that the MCU upgrade file does not belong to itself, it is determined whether each MCU should forward the MCU upgrade file according to the forwarding mode of each MCU. The forwarding mode of each MCU is set according to the network topology type of the MCU, including forwarding MCU upgrade files that do not belong to itself and not forwarding MCU upgrade files that do not belong to itself. If it is determined that the MCU upgrade file should be forwarded, the MCU upgrade file will be forwarded to the next level MCU; otherwise, the MCU upgrade file will be discarded.

[0006] According to a multi-MCU platform upgrade method provided by the present invention, the MCU identifier is located at the beginning of the code in the MCU upgrade file. Each MCU receives the MCU upgrade file and determines whether the MCU upgrade file belongs to itself, including: When each MCU receives the MCU identifier, it determines whether the MCU upgrade file belongs to itself based on the MCU identifier.

[0007] According to a multi-MCU platform upgrade method provided by the present invention, determining whether the MCU upgrade file belongs to itself includes: The MCU identifier in the MCU upgrade file is compared with the MCU identifier pre-stored in each MCU. If the MCU identifier in the MCU upgrade file matches the MCU identifier pre-stored in each MCU, it is known that the MCU upgrade file belongs to itself; If the MCU identifier in the MCU upgrade file is inconsistent with the MCU identifier pre-stored in each MCU, it is known that the MCU upgrade file does not belong to itself.

[0008] According to a multi-MCU platform upgrade method provided by the present invention, the MCU identifier is obtained in advance through the following steps: Convert the device serial number of the MCU into a byte sequence; The byte sequence is converted using a CRC register to obtain an MCU identifier, wherein the number of bytes in the MCU identifier is less than the number of bytes in the byte sequence.

[0009] According to a multi-MCU platform upgrade method provided by the present invention, the byte sequence is converted using a CRC register to obtain an MCU identifier, including: Initialize the 16-bit CRC register; The index value is obtained by performing an XOR operation between the high 8 bits of the current CRC register and each byte in the byte sequence. Shift the current CRC register left by 8 bits; The index value is used to look up the table to obtain a 16-bit value; XOR the value of the CRC register after left shift with the value obtained from the table lookup to get the new value of the CRC register; After all bytes in the byte sequence have been processed using the CRC register, the value of the CRC register is the MCU identifier.

[0010] According to a multi-MCU platform upgrade method provided by the present invention, after writing the MCU upgrade file into the code storage area of ​​each MCU, the method further includes: Based on the file length in the header of the MCU upgrade file, obtain the CRC calculation value of the MCU upgrade file; The calculated CRC value is compared with the file CRC in the file header, and the MCU upgrade file is determined to pass the CRC check based on the comparison result. If the MCU upgrade file passes the CRC check, run the MCU upgrade file. If the MCU upgrade file fails the CRC check, wait for the MCU upgrade file to be received or wait for a new MCU upgrade file to be received.

[0011] According to a multi-MCU platform upgrade method provided by the present invention, after determining whether each MCU forwards the MCU upgrade file based on the forwarding flag of each MCU, the method further includes: When the network topology is in internal bus mode, each MCU will not forward upgrade files that do not belong to it. When the network topology is an internal tree structure, the forwarding mode of an MCU with a lower level is to forward upgrade files that do not belong to itself; the forwarding mode of an MCU without a lower level is not to forward upgrade files that do not belong to itself. When the network topology is a hybrid of internal bus mode and internal tree mode, the forwarding mode of the MCU in the tree branch structure is set according to the internal tree mode, and the forwarding mode of the MCU connected to the bus but not located in the tree branch structure is set according to the internal bus mode.

[0012] This invention also provides a multi-MCU platform upgrade system, comprising: The first judgment module is used for each MCU to receive the MCU upgrade file and determine whether the MCU upgrade file belongs to itself; The writing module is used to write the MCU upgrade file into the code storage area of ​​each MCU when it is determined that the MCU upgrade file belongs to itself; The second judgment module is used to determine whether each MCU should forward the MCU upgrade file if it is determined that the MCU upgrade file does not belong to itself, based on the forwarding mode of each MCU. The forwarding mode of each MCU is set according to the network topology type of the MCU, including forwarding the MCU upgrade file that does not belong to itself and not forwarding the MCU upgrade file that does not belong to itself. The processing module is used to forward the MCU upgrade file to the next-level MCU if it is determined that the MCU upgrade file should be forwarded; otherwise, the MCU upgrade file should be discarded.

[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the multi-MCU platform upgrade method as described above.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-MCU platform upgrade method as described above.

[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the multi-MCU platform upgrade method as described above.

[0016] The multi-MCU platform upgrade method and system provided by this invention enables internal upgrade functions for various multi-MCU network topologies by determining whether the MCU upgrade file belongs to itself when each MCU receives the MCU upgrade file. The MCU upgrade file that belongs to itself is saved, and the MCU upgrade file that does not belong to itself is forwarded according to the network topology type. At the same time, it has scalability and can be compatible with multiple MCU network topologies. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 This is one of the flowcharts illustrating the multi-MCU platform upgrade method provided by the present invention; Figure 2 This is the second flowchart illustrating the multi-MCU platform upgrade method provided by the present invention; Figure 3 This is the third flowchart of the multi-MCU platform upgrade method provided by the present invention; Figure 4 This is a schematic diagram of the storage format of the MCU upgrade file for a single MCU in the multi-MCU platform upgrade method provided by the present invention; Figure 5 This is a schematic diagram illustrating the storage format of MCU upgrade files for multiple MCUs in the multi-MCU platform upgrade method provided by this invention; Figure 6 This is one of the schematic diagrams of the integrity verification process in the multi-MCU platform upgrade method provided by the present invention; Figure 7 This is the second schematic diagram of the integrity verification process in the multi-MCU platform upgrade method provided by the present invention; Figure 8 This is a schematic diagram of the internal bus mode in the multi-MCU platform upgrade method provided by the present invention; Figure 9This is a schematic diagram of the internal tree-like pattern in the multi-MCU platform upgrade method provided by the present invention; Figure 10 This is a schematic diagram of the internal hybrid mode in the multi-MCU platform upgrade method provided by the present invention; Figure 11 This is a schematic diagram of the structure of the multi-MCU platform upgrade system provided by the present invention; Figure 12 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0020] The following is combined with Figure 1 The present invention describes a multi-MCU platform upgrade method, comprising: Step 101: Each MCU receives the MCU upgrade file and determines whether the MCU upgrade file belongs to itself; Step 102: If it is determined that the MCU upgrade file belongs to itself, write the MCU upgrade file into the code storage area of ​​each MCU; Step 103: If it is determined that the MCU upgrade file does not belong to itself, determine whether each MCU should forward the MCU upgrade file according to the forwarding mode of each MCU. The forwarding mode of each MCU is set according to the network topology type of the MCU, including forwarding MCU upgrade files that do not belong to itself and not forwarding MCU upgrade files that do not belong to itself. Step 104: If it is determined that the MCU upgrade file should be forwarded, the MCU upgrade file shall be forwarded to the next level MCU; otherwise, the MCU upgrade file shall be discarded.

[0021] When each MCU receives an MCU upgrade file, it determines whether the upgrade file belongs to it, i.e., whether it is intended for its own operation. Upgrade files belonging to it are written to its own code storage area for execution. Upgrade files not belonging to it are forwarded based on the network topology of the multiprocessor platform. These functions can be implemented using a general bootloader architecture.

[0022] This embodiment enables internal upgrade functions for various multi-MCU network topologies by determining whether the MCU upgrade file belongs to itself when it receives the MCU upgrade file. If the MCU upgrade file belongs to itself, it is saved. If the MCU upgrade file does not belong to itself, it is forwarded according to the network topology type. At the same time, it has scalability and can be compatible with various MCU network topologies.

[0023] Based on the above embodiments, in this embodiment, the MCU identifier is located at the beginning of the code in the MCU upgrade file. Each MCU receives the MCU upgrade file and determines whether the MCU upgrade file belongs to itself, including: When each MCU receives the MCU identifier, it determines whether the MCU upgrade file belongs to itself based on the MCU identifier.

[0024] To determine if an MCU upgrade file is compatible with the MCU receiving it, an MCU identifier is located at the beginning of the code in the upgrade file, which can be included in the file header. The MCU identifier is specific to the MCU in the system; different MCUs have different identifiers. This data is positioned at the beginning of the code area, so that when the program code is sent, the data transmission is usually completed within the first few communication frames. This allows for advance determination of whether the sent data is compatible with the current MCU.

[0025] Because the program code is generated through compilation, splicing or modifying the code in this way will either cause a CRC error in the entire file or prevent the transmission of correct code identification data. The advantage of this is that problems and failures that may occur during the upgrade process can be identified in advance, allowing the upgrade to be stopped without disrupting the current system operation.

[0026] Based on the above embodiments, this embodiment determines whether the MCU upgrade file belongs to itself, including: The MCU identifier in the MCU upgrade file is compared with the MCU identifier pre-stored in each MCU. If the MCU identifier in the MCU upgrade file matches the MCU identifier pre-stored in each MCU, it is known that the MCU upgrade file belongs to itself; If the MCU identifier in the MCU upgrade file is inconsistent with the MCU identifier pre-stored in each MCU, it is known that the MCU upgrade file does not belong to itself.

[0027] like Figure 2As shown, each MCU receives the file length and MCU identifier of the MCU upgrade file, and compares the received MCU identifier with the MCU identifier pre-stored in each MCU.

[0028] If the two match, it is known that the MCU upgrade file belongs to itself. The received data is decrypted and written into the code storage area of ​​the current MCU, and data continues to be received until the entire MCU upgrade file is sent.

[0029] If the two are inconsistent, it is known that the MCU upgrade file does not belong to itself. Based on the current MCU's forwarding mode, it is determined whether to forward the MCU upgrade file that does not belong to itself. If forwarding is required, the current MCU forwards the received data to the next-level MCU; if forwarding is not required, the file header offset value of the next MCU upgrade file is calculated based on the file length to receive the file length and MCU identifier of the next MCU upgrade file.

[0030] Based on the above embodiments, the MCU identifier in this embodiment is obtained in advance through the following steps: Convert the device serial number of the MCU into a byte sequence; The byte sequence is converted using a CRC (Cyclic Redundancy Check) register to obtain the MCU identifier, the number of bytes in the MCU identifier being less than the number of bytes in the byte sequence.

[0031] Each MCU has an internal device serial number. For example, to ensure differentiation at the factory, the device serial number is unique. It may be a long string of data, which is time-consuming to compare and also occupies a lot of storage space.

[0032] To reduce the number of comparisons, the MCU identifier can be defined as 16 bits, or 2 bytes of storage. Therefore, the device serial number needs to be converted into a 16-bit MCU identifier, a process performed using a 16-bit CRC register. To reduce the complexity of CRC calculations, a lookup table method is used.

[0033] Based on the above embodiments, this embodiment uses a CRC register to convert the byte sequence to obtain the MCU identifier, including: Initialize the 16-bit CRC register; Perform an XOR operation between the high 8 bits of the current CRC register (CRC>>8) and each byte B in the byte sequence to obtain the index value Index; Shift the current CRC register left by 8 bits (CRC << 8); Using the index value, a table lookup is performed to obtain the 16-bit value table[Index]. XOR the left-shifted CRC register value with the value obtained from the table lookup to get the new CRC register value: CRC = (CRC << 8) ^ table[Index]; After all bytes in the byte sequence have been processed by the CRC register in sequence, the value of the CRC register is the final checksum, which is the MCU identifier. Thus, a string of data is converted into 16-bit data through the CRC register method.

[0034] The lookup table used for indexing employs a CRC lookup table, which is a pre-computed table for quickly calculating CRC values. Each row of the table corresponds to one bit of the input data. The steps for generating the lookup table are as follows: 1. Initialization: Create an array for each possible input byte (e.g., 256 possible input bytes for an 8-bit data width).

[0035] 2. Calculate the CRC value for each line: For each possible input byte, calculate the CRC value for all possible combinations of it with the polynomial.

[0036] 3. Store the results: Store each calculated CRC value in the corresponding array location.

[0037] The CRC register is used to convert the byte sequence corresponding to the device serial number to obtain the MCU identifier. For example, the device serial number of an MCU is a 22-byte ASCII string, "MCU1_20250912_08_01_07", with a corresponding byte sequence of [77, 67, 85, 49, 95, 50, 48, 50, 53, 48, 57, 49, 50, 95, 48, 56, 95, 48, 49, 95, 48, 55]. The result obtained by converting it through the CRC register is 0x9EC5 (40645). This allows a string of data to be converted into 2 bytes for comparison.

[0038] The communication data includes the MCU identifier 0x9EC5. When the MCU receives the MCU identifier, it first retrieves the internally stored device serial number, then calculates the corresponding MCU identifier, and compares this calculated value with the data 0x9EC5 in the communication data frame. If they are equal, it indicates that this part of the code is correct and can be used with this MCU; if they are not equal, the code is discarded, and the host should stop sending data, as the upgrade file may be faulty. The specific process is as follows... Figure 3 As shown.

[0039] Based on the above embodiments, this embodiment, after writing the MCU upgrade file into the code storage area of ​​each MCU, further includes: Based on the file length in the header of the MCU upgrade file, obtain the CRC calculation value of the MCU upgrade file; The calculated CRC value is compared with the file CRC in the file header, and the MCU upgrade file is determined to pass the CRC check based on the comparison result. If the MCU upgrade file passes the CRC check, the MCU upgrade file will be run. During software startup, a program integrity check will be performed; only correct and complete programs will be started.

[0040] If the MCU upgrade file fails the CRC check, wait for the MCU upgrade file to be received or wait for a new MCU upgrade file to be received.

[0041] The storage format of the MCU upgrade file for a standalone MCU is as follows: Figure 4 As shown, the storage format of MCU upgrade files for multiple MCUs is as follows: Figure 5 As shown. Each MCU upgrade file adds a header to the beginning of the original binary file. The header includes at least three parts: the length of the entire file, the CRC checksum of the entire file, and the corresponding MCU identifier.

[0042] An MCU identifier can be pre-set for each different MCU in the system, so that different MCUs have different identification flags.

[0043] like Figure 6 As shown, a CRC check is performed on the MCU upgrade file based on the file length and CRC value in the file header. The CRC check confirms whether the received upgrade program data is complete and correct.

[0044] If the MCU upgrade file passes the CRC check, then run the MCU upgrade file; if the MCU upgrade file fails the CRC check, it means that the MCU upgrade file is incomplete or incorrect.

[0045] like Figure 7 As shown, if the MCU upgrade file fails the CRC check, it can be further determined whether the MCU has received all the MCU upgrade files. If not all the MCU upgrade files have been received, then the MCU upgrade files will continue to be received; if all the MCU upgrade files have been received, it means that the MCU upgrade files are incorrect.

[0046] Based on the above embodiments, this embodiment, after determining whether each MCU should forward the MCU upgrade file according to the forwarding flag of each MCU, further includes: When the network topology is in internal bus mode, each MCU will not forward upgrade files that do not belong to it. When the network topology is an internal tree structure, the forwarding mode of an MCU with a lower level is to forward upgrade files that do not belong to itself; the forwarding mode of an MCU without a lower level is not to forward upgrade files that do not belong to itself. When the network topology is a hybrid of internal bus mode and internal tree mode, the forwarding mode of the MCU in the tree branch structure is set according to the internal tree mode, and the forwarding mode of the MCU connected to the bus but not located in the tree branch structure is set according to the internal bus mode.

[0047] Different forwarding modes are set for different multi-MCU network topologies, thereby enabling internal upgrade functions for various multi-MCU network topologies.

[0048] For example, Figure 8 In the internal bus mode, the forwarding mode of MCU1 is set to not forward code data that does not belong to itself, the forwarding mode of MCU2 is set to not forward code data that does not belong to itself, the forwarding mode of MCU3 is set to not forward code data that does not belong to itself, and the forwarding mode of MCU4 is set to not forward code data that does not belong to itself.

[0049] Figure 9 In the internal tree-structured mode, MCU1's forwarding mode is set to forward code data that does not belong to it, MCU2's forwarding mode is set to not forward code data that does not belong to it, and MCU3's forwarding mode is set to not forward code data that does not belong to it.

[0050] Figure 10 In the internal hybrid mode of internal bus mode and internal tree mode, the forwarding mode of MCU1 is set to not forward code data that does not belong to itself, the forwarding mode of MCU2 is set to not forward code data that does not belong to itself, the forwarding mode of MCU3 is set to forward code data that does not belong to itself, the forwarding mode of MCU4 is set to not forward code data that does not belong to itself, and the forwarding mode of MCU5 is set to not forward code data that does not belong to itself.

[0051] The multi-MCU platform upgrade system provided by the present invention is described below. The multi-MCU platform upgrade system described below can be referred to in correspondence with the multi-MCU platform upgrade method described above.

[0052] like Figure 11 As shown, the system includes a first judgment module 1101, a writing module 1102, a second judgment module 1103, and a processing module 1104, wherein: The first judgment module 1101 is used for each MCU to receive the MCU upgrade file and determine whether the MCU upgrade file belongs to itself; The writing module 1102 is used to write the MCU upgrade file into the code storage area of ​​each MCU when it is determined that the MCU upgrade file belongs to itself; The second judgment module 1103 is used to determine whether each MCU should forward the MCU upgrade file according to the forwarding mode of each MCU when it is determined that the MCU upgrade file does not belong to itself. The forwarding mode of each MCU is set according to the network topology type of the MCU, including forwarding the MCU upgrade file that does not belong to itself and not forwarding the MCU upgrade file that does not belong to itself. The processing module 1104 is used to forward the MCU upgrade file to the next level MCU if it is determined that the MCU upgrade file should be forwarded; otherwise, the MCU upgrade file should be discarded.

[0053] This embodiment enables internal upgrade functions for various multi-MCU network topologies by determining whether the MCU upgrade file belongs to itself when it receives the MCU upgrade file. If the MCU upgrade file belongs to itself, it is saved. If the MCU upgrade file does not belong to itself, it is forwarded according to the network topology type. At the same time, it has scalability and can be compatible with various MCU network topologies.

[0054] Figure 12 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 12As shown, the electronic device may include a processor 1210, a communications interface 1220, a memory 1230, and a communication bus 1240. The processor 1210, communications interface 1220, and memory 1230 communicate with each other via the communication bus 1240. The processor 1210 can call logic instructions in the memory 1230 to execute a multi-MCU platform upgrade method. This method includes: each MCU receiving an MCU upgrade file and determining whether the MCU upgrade file belongs to itself; if it is determined that the MCU upgrade file belongs to itself, writing the MCU upgrade file into the code storage area of ​​each MCU; if it is determined that the MCU upgrade file does not belong to itself, determining whether each MCU should forward the MCU upgrade file according to its forwarding mode. The forwarding mode of each MCU is set according to the network topology type of the MCU, including forwarding MCU upgrade files that do not belong to itself and not forwarding MCU upgrade files that do not belong to itself; if it is determined to forward the MCU upgrade file, forwarding the MCU upgrade file to the next-level MCU; otherwise, discarding the MCU upgrade file.

[0055] Furthermore, the logical instructions in the aforementioned memory 1230 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0056] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the multi-MCU platform upgrade method provided by the above methods. The method includes: each MCU receiving an MCU upgrade file and determining whether the MCU upgrade file belongs to itself; if it is determined that the MCU upgrade file belongs to itself, writing the MCU upgrade file into the code storage area of ​​each MCU; if it is determined that the MCU upgrade file does not belong to itself, determining whether each MCU should forward the MCU upgrade file according to its forwarding mode, wherein the forwarding mode of each MCU is set according to the network topology type of the MCU, including forwarding MCU upgrade files that do not belong to itself and not forwarding MCU upgrade files that do not belong to itself; if it is determined that the MCU upgrade file should be forwarded, forwarding the MCU upgrade file to the next level MCU; otherwise, discarding the MCU upgrade file.

[0057] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the multi-MCU platform upgrade method provided by the above methods. The method includes: each MCU receiving an MCU upgrade file and determining whether the MCU upgrade file belongs to itself; if it is determined that the MCU upgrade file belongs to itself, writing the MCU upgrade file into the code storage area of ​​each MCU; if it is determined that the MCU upgrade file does not belong to itself, determining whether each MCU should forward the MCU upgrade file according to its forwarding mode. The forwarding mode of each MCU is set according to the network topology type of the MCU, including forwarding MCU upgrade files that do not belong to itself and not forwarding MCU upgrade files that do not belong to itself; if it is determined that the MCU upgrade file should be forwarded, forwarding the MCU upgrade file to the next-level MCU; otherwise, discarding the MCU upgrade file.

[0058] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0059] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0060] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for upgrading multiple MCU platforms, characterized in that, include: Each MCU receives the MCU upgrade file and determines whether the MCU upgrade file belongs to itself; Once it is determined that the MCU upgrade file belongs to itself, the MCU upgrade file is written to the code storage area of ​​each MCU; If it is determined that the MCU upgrade file does not belong to itself, it is determined whether each MCU should forward the MCU upgrade file according to the forwarding mode of each MCU. The forwarding mode of each MCU is set according to the network topology type of the MCU, including forwarding MCU upgrade files that do not belong to itself and not forwarding MCU upgrade files that do not belong to itself. If it is determined that the MCU upgrade file should be forwarded, the MCU upgrade file will be forwarded to the next level MCU; otherwise, the MCU upgrade file will be discarded. The MCU identifier is located at the beginning of the code in the MCU upgrade file. Each MCU receives the MCU upgrade file and determines whether the MCU upgrade file belongs to itself, including: Upon receiving the MCU identifier, each MCU determines whether the MCU upgrade file belongs to itself based on the MCU identifier. Determining whether the MCU upgrade file belongs to itself includes: The MCU identifier in the MCU upgrade file is compared with the MCU identifier pre-stored in each MCU. If the MCU identifier in the MCU upgrade file matches the MCU identifier pre-stored in each MCU, it is known that the MCU upgrade file belongs to itself; If the MCU identifier in the MCU upgrade file is inconsistent with the MCU identifier pre-stored in each MCU, it is known that the MCU upgrade file does not belong to itself; The MCU identifier is obtained in advance through the following steps: Convert the device serial number of the MCU into a byte sequence; The byte sequence is converted using a CRC register to obtain an MCU identifier, wherein the number of bytes in the MCU identifier is less than the number of bytes in the byte sequence. The byte sequence is converted using a CRC register to obtain the MCU identifier, including: Initialize the 16-bit CRC register; The index value is obtained by performing an XOR operation between the high 8 bits of the current CRC register and each byte in the byte sequence. Shift the current CRC register left by 8 bits; The index value is used to look up the table to obtain a 16-bit value; XOR the value of the CRC register after left shift with the value obtained from the table lookup to get the new value of the CRC register; After all bytes in the byte sequence have been processed using the CRC register, the value of the CRC register is the MCU identifier; The step of determining whether each MCU should forward the MCU upgrade file based on its forwarding mode specifically includes: When the network topology is in internal bus mode, each MCU will not forward upgrade files that do not belong to it. When the network topology is an internal tree structure, the forwarding mode of an MCU with a lower level is to forward upgrade files that do not belong to itself; the forwarding mode of an MCU without a lower level is not to forward upgrade files that do not belong to itself. When the network topology is a hybrid of internal bus mode and internal tree mode, the forwarding mode of the MCU in the tree branch structure is set according to the internal tree mode, and the forwarding mode of the MCU connected to the bus but not located in the tree branch structure is set according to the internal bus mode.

2. The multi-MCU platform upgrade method according to claim 1, characterized in that, After writing the MCU upgrade file to the code storage area of ​​each MCU, the process also includes: Based on the file length in the header of the MCU upgrade file, obtain the CRC calculation value of the MCU upgrade file; The calculated CRC value is compared with the file CRC in the file header, and the MCU upgrade file is determined to pass the CRC check based on the comparison result. If the MCU upgrade file passes the CRC check, run the MCU upgrade file. If the MCU upgrade file fails the CRC check, wait for the MCU upgrade file to be received or wait for a new MCU upgrade file to be received.

3. A multi-MCU platform upgrade system, applied to the multi-MCU platform upgrade method as described in claim 1, characterized in that, include: The first judgment module is used for each MCU to receive the MCU upgrade file and determine whether the MCU upgrade file belongs to itself; The writing module is used to write the MCU upgrade file into the code storage area of ​​each MCU when it is determined that the MCU upgrade file belongs to itself; The second judgment module is used to determine whether each MCU should forward the MCU upgrade file if it is determined that the MCU upgrade file does not belong to itself, based on the forwarding mode of each MCU. The forwarding mode of each MCU is set according to the network topology type of the MCU, including forwarding the MCU upgrade file that does not belong to itself and not forwarding the MCU upgrade file that does not belong to itself. The processing module is used to forward the MCU upgrade file to the next-level MCU if it is determined that the MCU upgrade file should be forwarded; otherwise, the MCU upgrade file should be discarded.

4. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the multi-MCU platform upgrade method as described in any one of claims 1 to 2.

5. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the multi-MCU platform upgrade method as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Method for upgrading multi-MCU (Microprogrammed Control Unit) system software on basis of single external serial port

    CN104281470A

  • Household appliance multi-MCU system online upgrading method, electronic equipment and medium

    CN111142917A