Motor controller software upgrade method, device, equipment and storage medium

CN116932002BActive Publication Date: 2026-09-29CHERY NEW ENERGY AUTOMOBILE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310954887.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-28
Publication Date
2026-09-29
Estimated Expiration
2043-07-28

AI Technical Summary

Technical Problem

[0004]然而,由于MCU的硬件配置及相应的MCU的软件状态众多,上述方法查询工作复杂,容易出错,可能会造成查询的硬件配置错误,写入的MCU软件升级包与实际硬件配置不匹配,导致升级出错

Benefits of technology

[0017]本公开实施例中,当MCU软件需要升级时,先获取第二MCU软件,该第二MCU软件包括多个第一代码段,多个第一代码段与多个电子器件的类型一一对应,每个第一个代码段包括对应类型的电子器件所需的参数配置。多个第一代码段中包括至少一个第二代码段,第二代码段包括至少两个子代码段,至少两个子代码段包括所在的第二代码段对应类型的电子器件的不同型号所需的参数配置。然后将第二MCU软件写入MCU的代码区,以替换第一MCU软件,即可完成MCU软件的升级。由于电机控制器的配置区存储有配置码,配置码与电子器件一一对应,用于指示对应的电子器件的型号,第二MCU软件兼容MCU的多种硬件配置,当电机控制器每次上电运行时,即可自动根据配置码指示的电子器件的型号,执行相应的参数配置。因此,该升级方法中,只需要在MCU软件中尽可能覆盖MCU电子器件对应的参数配置,即可减少查询每台MCU硬件配置的复杂过程,升级方法更加简单,同时也减少了出错的可能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116932002B_ABST
    Figure CN116932002B_ABST
Patent Text Reader

Abstract

The present disclosure provides a motor controller software upgrading method, device, equipment and storage medium, and belongs to the field of new energy automobile motor control. The method comprises: obtaining a second motor controller software, the second motor controller software comprising a plurality of first code segments, the plurality of first code segments corresponding to the types of a plurality of electronic devices one by one, each first code segment comprising parameter configurations required by electronic devices of a corresponding type, at least one second code segment being included in the plurality of first code segments, the second code segment comprising at least two sub-code segments, the at least two sub-code segments comprising parameter configurations required by different models of electronic devices of a corresponding type of the second code segment in which the at least two sub-code segments are located; and writing the second motor controller software into a code area to replace a first motor controller software. The embodiment of the present disclosure can reduce the problem of MCU software upgrading error.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of motor control for new energy vehicles, and in particular to a method, apparatus, device, and storage medium for upgrading motor controller software. Background Technology

[0002] The Motor Control Unit (MCU), or motor controller, is one of the core components of new energy vehicles. Multiple MCUs of the same model may have identical or different hardware configurations. Here, the MCU's hardware configuration refers to the types of electronic components within the MCU and the model numbers of each component. Typically, different MCUs of the same model contain the same types of electronic components, but some types may have different model numbers. When the model numbers of the electronic components differ, the MCU's software state also differs. Throughout the vehicle's lifecycle, MCU software upgrades may be necessary to optimize MCU functionality or to resolve after-sales issues.

[0003] In related technologies, the MCU software upgrade method includes: querying the hardware configuration of each MCU based on the MCU's software and hardware version number or the MCU's factory serial number, and then writing the corresponding MCU software upgrade package into the MCU based on the MCU's hardware configuration, thereby realizing the upgrade of the MCU software.

[0004] However, due to the numerous hardware configurations and corresponding software states of MCUs, the above method of querying is complex and prone to errors. It may result in incorrect hardware configurations being queried, or the written MCU software upgrade package not matching the actual hardware configuration, leading to upgrade failures. Summary of the Invention

[0005] This disclosure provides a method, apparatus, device, and storage medium for upgrading motor controller software, which can reduce errors during MCU software upgrades. The technical solution is as follows:

[0006] On one hand, a method for upgrading motor controller software is provided. The motor controller includes multiple electronic devices. The storage area of ​​the motor controller is divided into a configuration area and a code area. The configuration area stores multiple configuration codes, each corresponding to one of the multiple electronic devices. Each configuration code indicates the model of the corresponding electronic device. The code area stores first motor controller software. The method includes: obtaining second motor controller software, the second motor controller software including multiple first code segments, each first code segment corresponding to one of the types of the multiple electronic devices. Each first code segment includes parameter configurations required for the corresponding type of electronic device. The multiple first code segments include at least one second code segment, the second code segment including at least two sub-code segments, the at least two sub-code segments including parameter configurations required for different models of the electronic devices of the type corresponding to the second code segment; and writing the second motor controller software into the code area to replace the first motor controller software.

[0007] Optionally, the second code segment further includes a conditional statement, which is used to instruct the motor controller to execute the target sub-code segment among the at least two sub-code segments during operation. The target sub-code segment includes the parameter configuration required for the electronic device of the model indicated by the target configuration code, and the target configuration code is the configuration code stored in the configuration area of ​​the motor controller.

[0008] Optionally, the second motor controller software further includes a generic code segment that includes parameter configurations required for generic functions.

[0009] Optionally, the method further includes: determining whether the plurality of first code segments of the second motor controller software include parameter configurations required for the electronic devices of the model indicated by the plurality of configuration codes of the motor controller, wherein writing the second motor controller software into the code area includes: when the plurality of first code segments include parameter configurations required for the electronic devices of the model indicated by the plurality of configuration codes, writing the second motor controller software into the code area.

[0010] Optionally, the parameter configuration includes fault protection points.

[0011] On the other hand, a method for upgrading motor controller software is provided. The motor controller includes multiple electronic devices. The storage area of ​​the motor controller is divided into a configuration area and a code area. The configuration area stores multiple configuration codes, each corresponding to one of the multiple electronic devices. Each configuration code indicates the model of the corresponding electronic device. The code area stores first motor controller software. The method includes: obtaining second motor controller software, the second motor controller software including multiple first code segments, each first code segment corresponding to one of the types of the multiple electronic devices. Each first code segment includes parameter configurations required for the corresponding type of electronic device. The multiple first code segments include at least one second code segment, the second code segment including at least two sub-code segments, the at least two sub-code segments including parameter configurations required for different models of the electronic devices of the type corresponding to the second code segment; and sending the second motor controller software to an upgrade device, the upgrade device being used to write the second motor controller software into the code area.

[0012] On another front, an upgrade device for motor controller software is provided. The motor controller includes multiple electronic devices. The storage area of ​​the motor controller is divided into a configuration area and a code area. The configuration area stores multiple configuration codes, each corresponding to one of the multiple electronic devices. Each configuration code indicates the model of the corresponding electronic device. The code area stores first motor controller software. The device includes: a first acquisition module for acquiring second motor controller software, the second motor controller software including multiple first code segments, each first code segment corresponding to one of the types of the multiple electronic devices. Each first code segment includes parameter configurations required for the corresponding type of electronic device. The multiple first code segments include at least one second code segment, the second code segment including at least two sub-code segments, the at least two sub-code segments including parameter configurations required for different models of the electronic devices of the type corresponding to the second code segment; and a first execution module for writing the second motor controller software into the code area to replace the first motor controller software.

[0013] On another front, an upgrade device for motor controller software is provided. The motor controller includes multiple electronic devices. The storage area of ​​the motor controller is divided into a configuration area and a code area. The configuration area stores multiple configuration codes, each corresponding to one of the multiple electronic devices. Each configuration code indicates the model of the corresponding electronic device. The code area stores first motor controller software. The device includes: a second acquisition module for acquiring second motor controller software, the second motor controller software including multiple first code segments, each first code segment corresponding to one of the types of the multiple electronic devices. Each first code segment includes parameter configurations required for the corresponding type of electronic device. The multiple first code segments include at least one second code segment, the second code segment including at least two sub-code segments, the at least two sub-code segments including parameter configurations required for different models of the electronic devices of the type corresponding to the second code segment; and a second execution module for sending the second motor controller software to the upgrade device, the upgrade device being used to write the second motor controller software into the code area.

[0014] In another aspect, a computer device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the aforementioned method for upgrading motor controller software.

[0015] On another front, a computer-readable storage medium is provided, wherein when the instructions in the computer-readable storage medium are executed by the processor of a computer device, the computer device is enabled to execute the aforementioned method for upgrading the motor controller software.

[0016] The beneficial effects of the technical solutions provided in this disclosure are:

[0017] In this embodiment, when the MCU software needs to be upgraded, a second MCU software is first obtained. This second MCU software includes multiple first code segments, each corresponding to a type of electronic device. Each first code segment includes the parameter configuration required for the corresponding type of electronic device. The multiple first code segments include at least one second code segment, and each second code segment includes at least two sub-code segments, each containing the parameter configuration required for different models of the electronic device corresponding to its respective second code segment. Then, the second MCU software is written into the MCU's code area to replace the first MCU software, thus completing the MCU software upgrade. Since the motor controller's configuration area stores configuration codes, which correspond one-to-one with electronic devices and indicate the model of the corresponding electronic device, the second MCU software is compatible with various MCU hardware configurations. Each time the motor controller powers on, it can automatically execute the corresponding parameter configuration based on the model of the electronic device indicated by the configuration code. Therefore, in this upgrade method, it is only necessary to cover the parameter configurations corresponding to the MCU electronic devices as much as possible in the MCU software, which reduces the complex process of querying the hardware configuration of each MCU, making the upgrade method simpler and reducing the possibility of errors. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram illustrating the correspondence between an MCU electronic device, a configuration code, and a first code segment, provided in an embodiment of this disclosure.

[0020] Figure 2 This is a flowchart of an MCU software upgrade method provided in an embodiment of this disclosure;

[0021] Figure 3 This is a schematic diagram of the structure of an initial version of MCU software provided in an embodiment of this disclosure;

[0022] Figure 4 This is a schematic diagram of the structure of an upgraded version of MCU software provided in an embodiment of this disclosure;

[0023] Figure 5 This is a flowchart of another MCU software upgrade method provided in this embodiment of the disclosure;

[0024] Figure 6 This is a structural block diagram of an MCU software upgrade device provided in an embodiment of this disclosure;

[0025] Figure 7 This is a structural block diagram of another MCU software upgrade device provided in an embodiment of this disclosure;

[0026] Figure 8 This is a structural block diagram of a computer device provided in an embodiment of this disclosure. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this disclosure will be described in further detail below with reference to the accompanying drawings.

[0028] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this disclosure pertains. The words “a” or “one” and similar terms used in this patent application specification and claims do not indicate a limitation of quantity, but rather indicate the presence of at least one. The words “comprising” or “including” and similar terms mean that the element or object preceding “comprising” or “including” encompasses the element or object listed following “comprising” or “including” and its equivalents, and do not exclude other elements or objects. The words “connected” or “linked” and similar terms are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Furthermore, the character “ / ” in the specification and claims generally indicates an “or” relationship between the preceding and following objects.

[0029] An MCU can include various electronic devices, including but not limited to: the main control chip, memory connected to the main control chip, and other key components. Other key components (hereinafter referred to as electronic devices) include Insulated Gate Bipolar Transistor (IGBT) modules, Electrically Erasable Programmable Read Only Memory (EEPROM), temperature sensors, etc. The memory can be embedded in the main control chip or be a separate flash memory chip connected to the main control chip; this is not limited here.

[0030] The memory's storage area is divided into a configuration area and a code area. The code area stores the relevant software required by the MCU; the configuration area stores configuration codes that correspond one-to-one with the configuration information of the MCU's key components. This configuration information includes the identification information of each key component. The main control chip is identified by its part number, while other key components are identified by their model numbers. The MCU's model number can be represented by the main control chip's model number.

[0031] In this embodiment, the MCU includes multiple electronic devices. The MCU's storage area is divided into a configuration area and a code area. The configuration area stores multiple configuration codes, each corresponding to one of the multiple electronic devices, and each configuration code indicates the model of the corresponding electronic device. The code area stores first MCU software. The first MCU software includes multiple first code segments, each corresponding to one of the types of the multiple electronic devices. Each first code segment includes the parameter configuration required for the corresponding type of electronic device.

[0032] In some examples, for MCUs of the same model (i.e., MCUs with the same part number as their main control chip), they typically include the same type of electronic components, but each component may have a different model number, and therefore a different configuration code. The configuration code is usually represented by numbers and does not occupy a large amount of storage space. Different configuration codes simply mean different numbers in the configuration area. These configuration code numbers are usually numbered sequentially according to the appearance time of the electronic component model. For the same type of electronic component, the initial configuration code is 0 for the first model, 1 for the second, 2 for the third, and so on. The mapping relationship between the type, model, and configuration code of the electronic component can be stored on a server.

[0033] The following example illustrates this point, using the case of different model numbers for electronic component A in the MCU. Figure 1 This is a schematic diagram illustrating the correspondence between an MCU electronic device, a configuration code, and a first code segment, provided in an embodiment of this disclosure. For example... Figure 1 As shown, when electronic device A has multiple models A1, A2, and A3, the configuration code corresponding to electronic device A in the MCU's configuration area can be any of the following: A=0, A=1, or A=2. A=0 indicates that the electronic device model of the MCU is A1, A=1 indicates that the electronic device model of the MCU is A2, and A=2 indicates that the electronic device model of the MCU is A3. The required parameter configurations for these three models of electronic devices are a1, a2, and a3, respectively. Therefore, when A=0, the first code segment corresponding to A in the code area includes a1; when A=1, the first code segment corresponding to A in the code area includes a2; and when A=2, the first code segment corresponding to A in the code area includes a3.

[0034] It can be seen that when electronic device A has different models in different MCUs of the same type, the configuration code of electronic device A in the configuration area is different, and the corresponding first code segment in the code area is also different.

[0035] Similarly, the multiple electronic devices of an MCU can also include other electronic devices B, C, etc. MCUs using different models of electronic devices B and C also store configuration codes corresponding to them in their configuration area and the corresponding first code segment in their code area.

[0036] In this embodiment, the configuration code in the configuration area is pre-written into the configuration area when the MCU leaves the factory. After each MCU leaves the factory, the configuration code in its configuration area is no longer updated. When the MCU software needs to be upgraded, only the code segment in its code area is upgraded.

[0037] Optionally, the first MCU software may be pre-written into the code area when the vehicle leaves the factory, or it may be written into the code area during the last upgrade.

[0038] Figure 2 This is a flowchart illustrating a method for upgrading MCU software according to an embodiment of this disclosure. Figure 2 As shown, the method includes:

[0039] Step S101: Obtain the second motor controller software.

[0040] The second MCU software includes multiple first code segments, each corresponding to a multiple electronic device. Each first code segment includes at least one sub-code segment, which includes the parameter configuration required by the electronic device of the type corresponding to the first code segment.

[0041] The plurality of first code segments include at least one second code segment, the second code segment includes at least two sub-code segments, and the at least two sub-code segments include the parameter configurations required for different models of electronic devices of the type corresponding to the second code segment.

[0042] For different MCUs of the same model, if at least one type of electronic device exists in at least two models, then the first code segment of the second MCU software includes at least one second code segment. Since different models of electronic devices require different parameter configurations, the second code segment includes at least two sub-code segments, each containing the parameter configurations required for different models of electronic devices.

[0043] Optionally, the parameter configuration includes fault protection points. Fault protection points typically refer to the numerical points corresponding to the fault protection of electronic devices. By carrying the fault protection points of multiple models of electronic devices in the MCU software, the amount of data is small and will not occupy too much storage space of the MCU.

[0044] In this embodiment, fault protection generally includes types such as temperature protection, overvoltage and undervoltage protection, overcurrent protection, and dead time. Correspondingly, fault protection points include temperature protection thresholds, voltage protection thresholds, and current protection thresholds. A temperature protection threshold refers to the maximum and / or minimum temperature value at which the electronic device can operate normally. A voltage protection threshold refers to the maximum voltage value (which can be called an overvoltage protection threshold or overvoltage protection point) and / or the minimum voltage value (which can be called an undervoltage protection threshold or undervoltage protection point) at which the electronic device can operate normally. A current protection threshold refers to the maximum current value (which can be called an overcurrent protection threshold or overcurrent protection point) and / or the minimum current value at which the electronic device can operate normally. Dead time refers to the interval between the turn-off of one IGBT and the turn-on of another IGBT in the upper and lower bridge arms of the electronic device, mainly used to prevent the upper and lower bridge arms from conducting simultaneously.

[0045] Different types of electronic devices may have the same or different types of fault protection points. For example, the fault protection points of an IGBT module include the dead time of the upper and lower bridge arms and the overcurrent protection threshold; the fault protection point of a temperature sensor includes the maximum temperature value. The types of fault protection points for IGBT modules and temperature sensors are different.

[0046] For example, Table 1 shows the relationship between different IGBT module models and their corresponding configuration codes and code segments. Electronic device A represents the IGBT module in the MCU, electronic device A1 represents a 650V / 400A IGBT module, electronic device A2 represents a 750V / 400A IGBT module, and electronic device A3 represents a 650V / 300A IGBT module. Different MCUs using these three types of IGBTs store the corresponding configuration codes A=0, A=1, and A=2 in their configuration areas, and the corresponding first code segments in their code areas include a1, a2, and a3, respectively.

[0047] The software differences (i.e., differences in sub-code segments) between the aforementioned IGBT modules A1, A2, and A3 mainly lie in the different values ​​of the fault protection points. For an IGBT module, its fault protection points include the dead time of the upper and lower bridge arms and the overcurrent protection threshold. Therefore, in the code area, the dead time in sub-code segment a1 is set to 4.5μs, and the overcurrent protection threshold is 370A; the dead time in sub-code segment a2 is set to 3.5μs, and the overcurrent protection threshold is 370A; the dead time in sub-code segment a3 is set to 3.5μs, and the overcurrent protection threshold is 300A. Of course, other IGBT module models may also exist, such as A4, A5, A6, etc., and this disclosure does not impose any restrictions on this.

[0048] Table 1. Examples of the relationship between different IGBT module models and their corresponding configuration codes and code segments.

[0049]

[0050] Optionally, the second MCU software also includes a general-purpose code segment, which contains parameter configurations required for general functions. These general functions may include anti-runaway control, charging protection control, etc., and the general-purpose code segment does not correspond to any specific type or model of electronic device.

[0051] Figure 3 This is a schematic diagram of the structure of an initial version of MCU software provided in an embodiment of this disclosure. Figure 3 As shown, the MCU's storage area is divided into a configuration area and a code area. The configuration area stores multiple configuration codes A=0, B=0, C=0..., which correspond to the initial electronic devices A1, B1, C1... of the MCU model, respectively. The code segment in the initial state of the code area is a1+b1+c1+...+z1, where a1+b1+c1+... are multiple first code segments that correspond one-to-one with the initial electronic devices A1, B1, C1...; z1 represents the general code segment, which includes the parameter configurations required for general functions. z1 does not correspond to a specific type or model of electronic device in the MCU.

[0052] In this way, the first code segment corresponding to the electronic device is separated from the general code segment. When the MCU software runs, it runs the first code segment corresponding to the electronic device according to the configuration code, while the general code segment can run directly without reading the configuration code, making the MCU software run faster.

[0053] During MCU production, there may be a shortage of certain electronic components. This necessitates the use of alternative electronic components with similar functions; these replacement components are called backup components. To address this, various hardware backup solutions have been developed, using backup components to replace the insufficient original components, ensuring that MCUs of the same model have the same functionality. During MCU production, regardless of whether original or backup components are used, the configuration code corresponding to the electronic component's model is pre-programmed into the configuration area of ​​the storage module. Therefore, each electronic component has only one unique configuration code. After the MCU leaves the factory, if software upgrades or maintenance are required due to MCU function optimization or after-sales issues, the configuration code in the configuration area remains unchanged for each MCU; upgrades and maintenance only involve replacing code segments in the code area.

[0054] In some examples, MCUs using the supplied electronic component A2 have their configuration code corresponding to component A2, set to A=1, pre-installed in their configuration area at the factory. The original manufacturer's electronic component for this type of MCU is A1. After the MCU using component A2 is manufactured, the first MCU software version used by the MCU using component A1 at the time of manufacture is upgraded to obtain the second MCU software. At this point, a software upgrade is required for the MCU using the original manufacturer's electronic component A1. However, the upgrade only replaces the code segment in its code area; the configuration code portion in the MCU's configuration area corresponding to component A remains A=0 and is not changed. Similarly, the configuration codes corresponding to hardware configurations B, C, etc., also remain unchanged.

[0055] Optionally, the second MCU software also includes conditional statements. These conditional statements instruct the MCU to execute a target sub-code segment from at least two sub-code segments during runtime. The target sub-code segment includes the parameter configuration required by the electronic device of the model indicated by the target configuration code, which is a configuration code corresponding to the model of electronic device used by the MCU.

[0056] Since each type of electronic device in each MCU uses only one model, the configuration code in the configuration area corresponds to that model of electronic device and is the target configuration code. In the second code segment in the code area corresponding to that type of electronic device, a target sub-code segment can be executed by a conditional statement from at least two sub-code segments.

[0057] In some examples, the conditional statement checks whether the target configuration code is the first configuration code. If the configuration code is the first configuration code, the first sub-code segment corresponding to the first configuration code is executed. If the configuration code is not the first configuration code, it checks whether the configuration code is the second configuration code. If the configuration code is the second configuration code, the second sub-code segment corresponding to the second configuration code is executed, and so on, until the target sub-code segment corresponding to the target configuration code is executed.

[0058] Optionally, the version of the second MCU software is higher than that of the first MCU software. The second MCU software and the first MCU software may differ in at least one first code segment but share the same general code segment; or they may all have the same first code segment but differ in the general code segment; or they may differ in at least one first code segment and also in the general code segment. Here, "the second MCU software and the first MCU software may differ in at least one first code segment" means that the number of sub-code segments contained in the first code segment corresponding to any type of electronic device in the second MCU software is greater than the number of sub-code segments contained in the first code segment corresponding to the same type of electronic device in the first MCU software.

[0059] For example, the code segment of the first MCU software is a1+b1+c1+……z1, and the code segment of the second MCU software is a1||a2+b1+c1+……+z1. This means that the first code segment of the second MCU software corresponding to electronic device type A is compatible with MCUs using both electronic device A1 and electronic device A2. However, the first code segment of the first MCU software corresponding to electronic device type A is only compatible with MCUs using electronic device A1, and not with MCUs using electronic device A2. Their first code segments are different, but their general code segments are the same.

[0060] For example, the code segment of the first MCU software is a1||a2+b1+c1+……+z1, and the code segment of the second MCU software is a1||a2+b1+c1+……+z2. This means that both the first and second MCU software are compatible with the first code segment corresponding to electronic device type A, allowing the use of MCUs for electronic devices A1 and A2. However, the general code segment of the second MCU software is an upgrade compared to the first MCU software, with optimized general functions. While their first code segments are the same, their general code segments differ.

[0061] For example, the code segment of the first MCU software is a1+b1+c1+……+z1, while the code segment of the second MCU software is a1||a2+b1+c1+……+z2. This means that the first code segment of the second MCU software corresponding to electronic device type A is compatible with MCUs using both electronic device A1 and electronic device A2, and its general code segment has also been upgraded, resulting in optimized functionality. However, the first code segment of the first MCU software corresponding to electronic device type A is only compatible with MCUs using electronic device A1, not with MCUs using electronic device A2, and its general code segment has not been upgraded. Their first code segments are different, and their general code segments are also different.

[0062] While the number of electronic device models for each type of MCU is currently limited, various new models of electronic devices may emerge in the future, meaning the number of electronic device models can be infinitely expanded. When the number of electronic device models increases, only a sub-code segment corresponding to that model needs to be added to the first code segment corresponding to that type of electronic device to upgrade the MCU software. Therefore, the sub-code segments in the first code segment corresponding to the electronic device model can also be infinitely expanded, thus ensuring compatibility with all hardware configurations of that MCU model. This method requires minimal modification to the MCU software and is easy to implement.

[0063] Assumption Figure 3The first version of the MCU software uses new electronic devices A2 and A3. The second version of the MCU software includes sub-code segment a1 corresponding to electronic device A1, sub-code segment a2 corresponding to electronic device A2, and sub-code segment a3 corresponding to electronic device A3. The second MCU software also includes conditional judgment statements, which are located at the beginning of the corresponding first sub-code segment.

[0064] Figure 4 This is a schematic diagram of the structure of an upgraded version of MCU software provided in an embodiment of this disclosure. When the general functions are also upgraded, and the general code segment is upgraded from the initial state z1 to z2, the code segment of the higher version of the second MCU software is a1||a2||a3+b1+c1+……+z2. Figure 4 As shown, the electronic devices currently used by the MCU are model A3, B1, C1... Before the MCU leaves the factory, the configuration code corresponding to electronic device A3 is written as A=2, the configuration code corresponding to electronic device B1 is written as B=0, the configuration code corresponding to electronic device C1 is written as C=0... and so on. The code segment a1||a2||a3+b1+c1+...+z2 of the second MCU software is written in its code segment. When the MCU software runs, that is, each time the MCU powers on, it determines the target configuration code A=2 based on the conditional statement, and automatically calls the target sub-code segment a3. Therefore, the actual code segment executed by the MCU software is a3+b1+c1+...+z2.

[0065] In this way, the latest version of the second MCU software can be compatible with various hardware configurations of the MCU, avoiding the problem of software mismatch with actual hardware configuration, and making MCU software upgrades more reliable.

[0066] Step S102: Write the second motor controller software into the code area.

[0067] Optionally, the following steps may be included before step S102.

[0068] The step S102, which determines whether the multiple first code segments of the second MCU software include the parameter configuration required for the electronic device of the model indicated by the multiple configuration codes of the MCU, includes: when the multiple first code segments include the parameter configuration required for the electronic device of the model indicated by the multiple configuration codes, writing the second MCU software into the code area.

[0069] If the first code segment does not include the parameter configuration required for the electronic device of the model indicated by the multiple configuration codes, the second MCU software is discarded and the upgrade process is exited.

[0070] The above steps determine whether the multiple first code segments of the second MCU software include the parameter configurations required for the electronic devices of the model indicated by the multiple configuration codes of the MCU before writing the second MCU software into the code area or abandoning the upgrade. This avoids the rare situation where the obtained second MCU software is incompatible with the MCU to be upgraded, reducing the possibility of errors and making the upgrade method more reliable. Normally, the obtained second MCU software is compatible with the hardware configuration of the MCU to be upgraded; only in rare cases will the multiple first code segments of the second MCU software not include the code segment corresponding to the configuration code in the configuration area of ​​the MCU to be upgraded.

[0071] In some examples, for MCUs using electronic devices A1 and A2, the configuration codes in their configuration areas are A=0 and A=1, respectively. When the software needs to be upgraded, such as when the parameter configuration required for general functions needs to be upgraded to these two MCUs, the upgrade of the general code segment z2 needs to be applied to the MCUs using electronic devices A1 and A2. This only requires obtaining the latest version of the second MCU software. Once it is determined that the second MCU software includes the parameter configuration required for the electronic device model indicated by multiple configuration codes in its multiple first code segments, the code segment a1||a2||a3+b1+c1+……+z2 of the second MCU software replaces the old version of the first MCU software used before the upgrade. After the upgrade is complete, when the MCU software runs, that is, every time the MCU is powered on, the MCU using electronic device A1 will determine that the target configuration code A = 0 and will automatically call the target sub-code segment a1. The MCU software will actually execute the code segment a1+b1+c1+……+z2. The MCU using electronic device A2 will determine that the target configuration code A = 1 and will automatically call the target sub-code segment a2. The MCU software will actually execute the code segment a2+b1+c1+……+z2.

[0072] In some examples, when upgrading the older version of the first MCU software is required, the latest version of the second MCU software can be downloaded via a host computer. After the MCU connects to the host computer, the host computer writes the second MCU software into the code area to replace the older version of the first MCU software. Alternatively, when the MCU remotely receives the second MCU software, the MCU itself writes the second MCU software into the code area to replace the older version of the first MCU software.

[0073] In this embodiment, when the MCU software needs to be upgraded, a second MCU software is first obtained. This second MCU software includes multiple first code segments, each corresponding to a type of electronic device. Each first code segment includes the parameter configuration required for the corresponding type of electronic device. The multiple first code segments include at least one second code segment, and each second code segment includes at least two sub-code segments, each containing the parameter configuration required for different models of the electronic device corresponding to its respective second code segment. Then, the second MCU software is written into the MCU's code area to replace the first MCU software, thus completing the MCU software upgrade. Since the motor controller's configuration area stores configuration codes, which correspond one-to-one with electronic devices and indicate the model of the corresponding electronic device, the second MCU software is compatible with various MCU hardware configurations. Each time the motor controller powers on, it can automatically execute the corresponding parameter configuration based on the model of the electronic device indicated by the configuration code. Therefore, in this upgrade method, it is only necessary to cover the parameter configurations corresponding to the MCU electronic devices as much as possible in the MCU software, which reduces the complex process of querying the hardware configuration of each MCU, making the upgrade method simpler and reducing the possibility of errors.

[0074] Figure 5 This is a flowchart of another MCU software upgrade method provided in this disclosure embodiment. This method can be executed by a server. Figure 5 As shown, the method includes:

[0075] Step S201: Obtain the second motor controller software.

[0076] Here, the method for obtaining the second MCU software is based on the same concept as the MCU software upgrade method described above. The specific implementation process is detailed in the above method embodiments and will not be repeated here.

[0077] Step S202: Send the second motor controller software to the upgrade device.

[0078] The upgrade device is used to write the second MCU software into the code area. In some examples, the server may obtain the second MCU software and then send it to the upgrade device. The upgrade device can be a host computer or an MCU itself.

[0079] Here, the content of the second MCU software and the method of writing the second MCU software into the code area are based on the same concept as the above-mentioned MCU software upgrade method. The specific implementation process is detailed in the above-mentioned method embodiment, and will not be repeated here.

[0080] Figure 6 This is a structural block diagram of an MCU software upgrade device provided in an embodiment of this disclosure. Figure 6As shown, the MCU software upgrade device includes: a first acquisition module 1001 and a first execution module 1002.

[0081] An MCU comprises multiple electronic devices. The MCU's storage area is divided into a configuration area and a code area. The configuration area stores multiple configuration codes, which correspond one-to-one with multiple electronic devices. Each configuration code is used to indicate the model of the corresponding electronic device. The code area stores the first MCU software.

[0082] The first acquisition module 1001 is used to acquire second MCU software. The second MCU software includes multiple first code segments, each corresponding to a type of electronic device. Each first code segment includes the parameter configuration required by the corresponding type of electronic device. The multiple first code segments include at least one second code segment, and each second code segment includes at least two sub-code segments. Each of the at least two sub-code segments includes the parameter configuration required by different models of the electronic devices corresponding to its respective second code segment. The first execution module 1002 is used to write the second MCU software into the code area to replace the first MCU software.

[0083] Optionally, the first execution module 1002 is configured to determine whether the plurality of first code segments of the second MCU software include the parameter configuration required for the electronic device of the model indicated by the plurality of configuration codes of the MCU, and to write the second MCU software into the code area, including: when the plurality of first code segments include the parameter configuration required for the electronic device of the model indicated by the plurality of configuration codes, the second MCU software is written into the code area.

[0084] Figure 7 This is a structural block diagram of another MCU software upgrade device provided in an embodiment of this disclosure. Figure 7 As shown, the MCU software upgrade device includes: a second acquisition module 2001 and a second execution module 2002.

[0085] An MCU comprises multiple electronic devices. The MCU's storage area is divided into a configuration area and a code area. The configuration area stores multiple configuration codes, which correspond one-to-one with multiple electronic devices. Each configuration code is used to indicate the model of the corresponding electronic device. The code area stores the first MCU software.

[0086] The second acquisition module 2001 is used to acquire second MCU software. The second MCU software includes multiple first code segments, each corresponding to a type of electronic device. Each first code segment includes the parameter configurations required for the corresponding type of electronic device. The multiple first code segments include at least one second code segment, and each second code segment includes at least two sub-code segments. Each of the at least two sub-code segments includes the parameter configurations required for different models of the electronic devices corresponding to its respective second code segment. The second execution module 2002 is used to send the second MCU software to an upgrade device, which then writes the second MCU software into the code area.

[0087] Optionally, the second execution module 2002 is used to determine whether the plurality of first code segments of the second MCU software include the parameter configuration required for the electronic device of the model indicated by the plurality of configuration codes of the MCU, and to write the second MCU software into the code area, including: when the plurality of first code segments include the parameter configuration required for the electronic device of the model indicated by the plurality of configuration codes, the second MCU software is written into the code area.

[0088] It should be noted that the MCU software upgrade device provided in the above embodiments is only illustrated by the division of the above functional modules when upgrading the MCU software. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the MCU software upgrade device and the MCU software upgrade method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0089] Figure 8 This is a structural block diagram of a computer device provided in an embodiment of this disclosure. Figure 8 As shown, the computer device 3000 includes a processor 3001 and a memory 3002.

[0090] Processor 3001 may include one or more processing cores, such as a 5-core processor, an 8-core processor, etc. Processor 3001 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 3001 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 3001 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 3001 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0091] The memory 3002 may include one or more computer-readable storage media, which may be non-transitory. The memory 3002 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 3002 is used to store at least one instruction, which is executed by the processor 3001 to implement the MCU software upgrade method provided in this disclosure embodiment.

[0092] Those skilled in the art will understand that Figure 8 The structure shown does not constitute a limitation on the computer device 3000, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0093] This disclosure also provides a non-transitory computer-readable storage medium that, when the instructions in the storage medium are executed by the processor of a computer device, enables the computer device to execute the MCU software upgrade method provided in this disclosure.

[0094] The above description is not intended to limit this disclosure in any way. Although this disclosure has been disclosed above through embodiments, it is not intended to limit this disclosure. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the technical solution of this disclosure. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of this disclosure without departing from the content of the technical solution of this disclosure shall still fall within the scope of the technical solution of this disclosure.

Claims

1. A method for upgrading motor controller software, characterized in that, The motor controller includes multiple electronic components. Its storage area is divided into a configuration area and a code area. The configuration area stores multiple configuration codes, each corresponding to one of the electronic components. Each configuration code indicates the model of the corresponding electronic component. The code area stores first motor controller software. The method includes: The second motor controller software is obtained. The second motor controller software includes multiple first code segments, each of which corresponds one-to-one with the types of multiple electronic devices. Each first code segment includes the parameter configuration required for the corresponding type of electronic device. The multiple first code segments include at least one second code segment. The second code segment includes at least two sub-code segments. The at least two sub-code segments include the parameter configuration required for different models of the electronic devices of the corresponding type in the second code segment. The second motor controller software is written into the code area to replace the first motor controller software.

2. The method for upgrading motor controller software according to claim 1, characterized in that, The second code segment also includes a conditional statement, which is used to instruct the motor controller to execute the target sub-code segment of the at least two sub-code segments during operation. The target sub-code segment includes the parameter configuration required by the electronic device of the model indicated by the target configuration code, and the target configuration code is the configuration code stored in the configuration area of ​​the motor controller.

3. The method for upgrading motor controller software according to claim 2, characterized in that, The second motor controller software also includes a general code segment, which includes parameter configurations required for general functions.

4. The method for upgrading motor controller software according to any one of claims 1 to 3, characterized in that, The method further includes: Determine whether the plurality of first code segments of the second motor controller software include the parameter configuration required for the electronic devices of the model indicated by the plurality of configuration codes of the motor controller; The step of writing the second motor controller software into the code area includes: When the plurality of first code segments include the parameter configuration required for the electronic device of the model indicated by the plurality of configuration codes, the second motor controller software is written into the code area.

5. The method for upgrading motor controller software according to any one of claims 1 to 3, characterized in that, The parameter configuration includes fault protection points.

6. A method for upgrading motor controller software, characterized in that, The motor controller includes multiple electronic components. Its storage area is divided into a configuration area and a code area. The configuration area stores multiple configuration codes, each corresponding to one of the electronic components. Each configuration code indicates the model of the corresponding electronic component. The code area stores first motor controller software. The method includes: The second motor controller software is obtained. The second motor controller software includes multiple first code segments, each of which corresponds one-to-one with the types of multiple electronic devices. Each first code segment includes the parameter configuration required for the corresponding type of electronic device. The multiple first code segments include at least one second code segment. The second code segment includes at least two sub-code segments. The at least two sub-code segments include the parameter configuration required for different models of the electronic devices of the corresponding type in the second code segment. The second motor controller software is sent to the upgrade device, which is used to write the second motor controller software into the code area.

7. A device for upgrading motor controller software, characterized in that, The motor controller includes multiple electronic devices. The storage area of ​​the motor controller is divided into a configuration area and a code area. The configuration area stores multiple configuration codes, each corresponding one-to-one with one of the multiple electronic devices. Each configuration code indicates the model of the corresponding electronic device. The code area stores first motor controller software. The device includes: The first acquisition module is used to acquire the second motor controller software. The second motor controller software includes a plurality of first code segments, each of which corresponds one-to-one with the types of a plurality of electronic devices. Each first code segment includes the parameter configuration required for the corresponding type of electronic device. The plurality of first code segments includes at least one second code segment. The second code segment includes at least two sub-code segments. The at least two sub-code segments include the parameter configuration required for different models of the electronic devices of the corresponding type in the second code segment. The first execution module is used to write the second motor controller software into the code area to replace the first motor controller software.

8. A device for upgrading motor controller software, characterized in that, The motor controller includes multiple electronic devices. The storage area of ​​the motor controller is divided into a configuration area and a code area. The configuration area stores multiple configuration codes, each corresponding one-to-one with one of the multiple electronic devices. Each configuration code indicates the model of the corresponding electronic device. The code area stores first motor controller software. The device includes: The second acquisition module is used to acquire the second motor controller software. The second motor controller software includes a plurality of first code segments, each of which corresponds one-to-one with the type of a plurality of electronic devices. Each first code segment includes the parameter configuration required for the corresponding type of electronic device. The plurality of first code segments includes at least one second code segment. The second code segment includes at least two sub-code segments. The at least two sub-code segments include the parameter configuration required for different models of the electronic devices of the corresponding type in the second code segment. The second execution module is used to send the second motor controller software to the upgrade device, and the upgrade device is used to write the second motor controller software into the code area.

9. A computer device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute the method for upgrading the motor controller software as described in any one of claims 1 to 5 or claim 6.

10. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of a computer device, the computer device is able to perform the method for upgrading the motor controller software as described in any one of claims 1 to 5 or claim 6.

Citation Information

Patent Citations

  • Multi-model software synchronous upgrading method and device and terminal equipment

    CN109819286A

  • Software upgrading method, smart television and storage medium

    CN111813431A