Differential upgrading method of motor controller and differential upgrading package generation method and device
The differential upgrade method for motor controller MCUs simplifies the upgrade process by using a differential auxiliary file to restore target version data, addressing inefficiencies in traditional methods and enhancing compatibility and efficiency.
Patent Information
- Application Number
- CN202411083252.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-12-20
AI Technical Summary
The complexity and inefficiency of software upgrades in vehicle ECUs, particularly for motor controller MCUs, due to the need for dynamic selection of differential packets based on specific version information, complicates the upgrade process and hinders unified flashing across vehicle components.
A differential upgrade method for motor controller MCUs that uses a differential auxiliary file to restore target version data without requiring specific version information, simplifying the upgrade process and improving compatibility by generating a differential upgrade package that can be applied to any version, using tools like bsdiff or vcdiff for efficient data restoration.
This method simplifies the upgrade process, enhances compatibility, and improves efficiency by eliminating the need to query version information, ensuring accurate and reliable upgrades with reduced storage requirements and error rates.
Smart Images

Figure CN119166188A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle control, and more specifically, to a motor controller differential upgrade method, a differential upgrade package generation method and a device. Background Art
[0002] As the role of software in cars becomes more and more important, software-defined cars have become a consensus in the industry. As the number of lines of software code in cars continues to grow in direct proportion, the complexity of software engineering and the probability of software failure will increase rapidly. Vehicles may encounter software failures or need to be updated due to the need for smart car updates and iterations. Over the air technology (OTA) solves the problem of frequent software updates. Through OTA technology, defects can be quickly repaired remotely, avoiding the risks of factory recalls that last for months. Through OTA upgrades, new functions can be continuously enabled for users, the product experience can be continuously optimized, and rapid iterations can be performed. But at the same time, with the evolution of the trend of automotive electrification, the electronic and electrical architecture of the entire vehicle is developing in the direction of multi-domain control concentration, which puts higher requirements on the speed of vehicle OTA upgrades.
[0003] Due to the large number of on-board electronic control units (ECUs), the upgrade speed of traditional component ECUs without file systems has always been a bottleneck for vehicle OTA upgrades. Especially for scenarios where ECU serial upgrades are required, the upgrade time of a single ECU has a direct impact on the OTA time of the entire vehicle. At present, some ECUs use differential upgrade solutions to improve upgrade efficiency. However, in the current differential upgrade solution, the host computer needs to dynamically select different differential packets based on the version on the board and transmit them to the ECU for upgrade. The interaction process is complicated, and it is difficult to implement a unified flashing specification on all ECU components on the vehicle's communication bus. The software upgrade of the motor controller MCU has similar problems.
[0004] Therefore, how to simplify the upgrade process of the differential upgrade of the motor controller MCU is an urgent problem to be solved. Summary of the invention
[0005] The present application provides a differential upgrade method, a differential upgrade package generation method and a differential upgrade device for a motor controller MCU. By optimizing the differential upgrade, a differential auxiliary file is set in the differential upgrade file, and the target version data is restored by combining the source version, the auxiliary file of the source version and the differential package difference. Therefore, according to the scheme of the present application, there is no need to obtain the specific version information of the motor controller MCU to be upgraded, which simplifies the upgrade process and does not need to distinguish between components of different versions. The implementation is simple, there is no need to modify the upgrade process, and the compatibility is improved.
[0006] In a first aspect, the present application provides a differential upgrade method for a motor controller, wherein the motor controller to be upgraded includes source version data and a source version differential auxiliary package, wherein the source version differential auxiliary package is used to indicate information about modified data in the source version data, and the differential upgrade method includes:
[0007] The motor controller to be upgraded receives a differential upgrade package, the differential upgrade package is used to upgrade the source version data to the target version data, and the differential upgrade package includes the data to be modified and a modification execution program file for the data to be modified;
[0008] The motor controller to be upgraded performs differential restoration processing on the source version data according to the source version differential auxiliary package and the differential upgrade package to obtain the target version data.
[0009] Correspondingly, in the differential upgrade method of the motor controller MCU provided by the present application, the source version auxiliary package is generated by processing the source version data using a differential auxiliary package generation tool. The auxiliary package records the source version data differential structure related information. The source version auxiliary package is used to indicate the information that the data in the source version data has been modified compared with the preset data. The differential package in the differential upgrade package can be obtained according to the destination version data and the preset data, so that the differential package combined with the source version auxiliary package can be restored by the differential structure with the preset data, and the source version data is differentially restored to the destination version data. The source version auxiliary package and the source version data are both obtained based on the preset data, and the differential package is obtained by combining the destination version data and the preset data. Therefore, the preset data related to any version data can be first processed by the source version auxiliary package and the source version data, and then the preset data obtained by the processing is restored by the differential package, so as to obtain the destination version data. Since the preset data is related to any version data, the differential package does not need to correspond to a specific version, and any version of data can be upgraded to the destination version.
[0010] The differential upgrade method of the motor controller MCU provided in the present application does not need to obtain the specific version information of the motor controller MCU to be upgraded, which simplifies the upgrade process and improves the upgrade efficiency.
[0011] In the motor controller differential upgrade method provided in the first aspect, the motor controller to be upgraded is restored according to the differential upgrade package, the source version differential auxiliary package and the source version data to obtain the target version differential auxiliary package, and the target version differential auxiliary package is used to indicate the information of the modified data in the target version data.
[0012] Correspondingly, the differential upgrade package also includes the auxiliary package corresponding to the target version. After the source version data is differentially restored to the target version data through the source version auxiliary package and the differential package, the auxiliary package corresponding to the target version can be written into the motor controller MCU to be upgraded, so that the next time you continue to upgrade from the target version, you can perform a differential upgrade based on the auxiliary package corresponding to the target version without obtaining the specific version number.
[0013] In the motor controller differential upgrade method provided in the first aspect, the differential upgrade package is obtained by differential processing based on the differential merge package, and the differential merge package includes a target version differential auxiliary package and target version data, and the target version differential auxiliary package is determined based on the target version data.
[0014] Correspondingly, the differential upgrade package is obtained according to the target version differential auxiliary package and the target version data, thereby ensuring the accuracy of the differential upgrade package and making the differential upgrade package less prone to errors.
[0015] In the motor controller differential upgrade method provided in the first aspect, the method for the motor controller to be upgraded to receive the differential upgrade package includes:
[0016] The motor controller to be upgraded receives the differential upgrade package based on any one of the transmission control protocol TCP, the user datagram protocol UDP, and the hypertext transfer protocol HTTP;
[0017] Alternatively, the motor controller to be upgraded receives a differential upgrade package via the over-the-air download technology OTA or a proximal diagnostic instrument based on the unified diagnostic service UDS protocol.
[0018] Correspondingly, the motor controller MCU to be upgraded in the present application can have multiple methods of receiving differential upgrade packages, thereby improving the stability of the differential upgrade package receiving process and enhancing the stability of the upgrade.
[0019] In the motor controller differential upgrade method provided in the first aspect, after the motor controller to be upgraded completes the differential upgrade, the motor controller to be upgraded stores the target version data and the target version differential auxiliary package.
[0020] Correspondingly, after the motor controller to be upgraded completes the differential upgrade, only the target version data and the target version differential auxiliary package are retained, which can save storage space and make the next upgrade simpler.
[0021] In the motor controller differential upgrade method provided in the first aspect, the size of the target version differential auxiliary package is less than or equal to 10% of the target version data size.
[0022] Correspondingly, using a smaller target version differential auxiliary package can save space and complete the program upgrade assistance more efficiently and quickly.
[0023] In the motor controller differential upgrade method provided in the first aspect, the differential upgrade method includes:
[0024] The motor controller to be upgraded receives the differential upgrade package after successfully verifying the differential upgrade package;
[0025] The motor controller to be upgraded verifies the target version data obtained by differential restoration, and completes the differential upgrade after the verification passes.
[0026] Correspondingly, the motor controller to be upgraded verifies the differential upgrade package and the target version data, thereby improving the accuracy of the upgrade data and ensuring a successful upgrade.
[0027] In the motor controller differential upgrade method provided in the first aspect, during the differential upgrade of the motor controller to be upgraded, when the motor controller to be upgraded is powered off or fails, the differential upgrade method includes:
[0028] The motor controller to be upgraded stops differential upgrade and restores the source version data;
[0029] The motor controller to be upgraded stores the differential upgrade package and temporary data obtained by restoration processing for the motor controller to be upgraded to perform differential upgrade again.
[0030] Correspondingly, when a power outage or failure occurs during the differential upgrade of the motor controller to be upgraded, the availability of the motor controller to be upgraded is ensured by stopping the upgrade and restoring the source version data, and the previous upgrade data is cleared to ensure a smooth upgrade next time.
[0031] In a second aspect, the present application provides a method for generating a differential upgrade package of a motor controller, the differential upgrade package generating method comprising:
[0032] Generate a differential auxiliary package based on the target version data, where the differential auxiliary package is used to indicate information about modified data in the target version data;
[0033] A differential upgrade package is generated based on the target version data and the differential auxiliary package. The differential upgrade package is used to upgrade the source version data of the motor controller to be upgraded to the target version data. The differential upgrade package includes the data to be modified and a modification execution program file for the data to be modified.
[0034] Correspondingly, using a special differential upgrade package generation method to generate a differential package can ensure the accuracy of the differential package and the success of the upgrade.
[0035] In the method for generating a differential upgrade package for a motor controller provided in the second aspect, the process of generating a differential upgrade package based on the target version data and the differential auxiliary package includes:
[0036] The target version data and the differential auxiliary package are merged to generate a differential merge package;
[0037] The differential merge package uses a differential algorithm to generate a differential upgrade package.
[0038] Correspondingly, generating differential packets according to a certain process can reduce the error rate in the differential packet generation process.
[0039] In the motor controller differential upgrade package generation method provided in the second aspect, the differential upgrade package generation method includes:
[0040] Use the preset program to upgrade the differential upgrade package;
[0041] Verify the upgraded differential upgrade package based on the target version data.
[0042] Correspondingly, the differential upgrade package is upgraded and the target version data is verified using a preset program, which improves the accuracy of the upgrade data and ensures the success of the upgrade.
[0043] On the third aspect, the present application provides a device for differential upgrading of a motor controller MCU, the device comprising a transceiver, a processor, a memory and an interface, the memory being used to store differential upgrade packages, the processor of the device utilizing the transceiver to receive differential upgrade packages from the interface via over-the-air download technology OTA or a proximal diagnostic instrument and to send the differential upgrade packages to the motor controller MCU to be upgraded via the controller area network CAN bus.
[0044] Correspondingly, a separate device for receiving and sending and storing differential upgrade packages can be arranged on the vehicle to perform receiving and sending and storage processing on the upgrade packages, thereby reducing the storage requirements of the motor controller MCU to be upgraded and completing the upgrade requirements more quickly.
[0045] In one implementation form of the use device provided by the third aspect, when the use device is receiving the differential upgrade package, the use device loses power or fails, and the use device stops receiving the differential upgrade package and clears the received part of the differential upgrade package in the memory.
[0046] Correspondingly, during the process of using a device to receive a differential upgrade package, when the device is powered off or fails, in order to ensure the integrity of the received differential upgrade package, the device stops receiving the differential upgrade package and clears the partial differential upgrade packages that have been received in the memory, so as to subsequently receive the differential upgrade package again in full to ensure a successful upgrade.
[0047] In a fourth aspect, the present application provides a powertrain, which includes the motor controller and drive motor provided in the first aspect, and the powertrain receives high-voltage direct current and inverts and outputs three-phase alternating current through the motor controller to supply the drive motor for operation.
[0048] Correspondingly, integrating the motor controller provided in this application into the powertrain can more efficiently implement the upgrade of the motor control program of the powertrain, thereby facilitating the use and maintenance of the powertrain.
[0049] In a fifth aspect, the present application provides a vehicle, comprising the motor controller provided in the first aspect and the motor controller differential upgrade device provided in the third aspect, the motor controller differential upgrade device being used to receive differential upgrade packages via over-the-air download technology OTA or PC transmission and pass them to the motor controller for upgrade use.
[0050] Correspondingly, the motor controller and the motor controller differential upgrade device provided in this application are integrated into the vehicle, and the motor control program can be upgraded more efficiently with the help of over-the-air download technology OTA or PC transmission, which facilitates the use and maintenance of the vehicle.
[0051] It should be noted that the differential upgrade method, differential upgrade package generation method and differential upgrade device of this application are not only used on the motor controller MCU, but can also be used in other electronic control devices with similar upgrade requirements such as on-board charger OBC, vehicle information box (TBOX), smart cockpit domain controller (CDC), smart driving domain controller (MDC), vehicle control domain controller (VDC), vehicle controller VCU and other fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 is a schematic diagram of a vehicle provided in an embodiment of the present application;
[0053] Figure 2 is a schematic diagram of a vehicle architecture provided in an embodiment of the present application;
[0054] Figure 3 This is a schematic diagram of OTA upgrade provided by an embodiment of the present application;
[0055] Figure 4 This is a schematic diagram of a traditional differential upgrade process provided by an embodiment of the present application;
[0056] Figure 5 It is a schematic diagram of the differential upgrade package generation and differential upgrade process of the motor controller MCU provided in an embodiment of the present application;
[0057] Figure 6 It is a schematic diagram of the differential upgrade package generation and differential upgrade process of the motor controller MCU provided in an embodiment of the present application;
[0058] Figure 7 It is a schematic diagram of the upgrade transmission process of MCU based on TCP, UDP, and HTTP provided in an embodiment of the present application;
[0059] Figure 8It is a schematic diagram of the upgrade transmission process of ECU in other fields based on TCP, UDP, and HTTP provided by the embodiment of the present application;
[0060] Fig. 9 It is a device for using the motor controller MCU differential upgrade provided in the embodiment of the present application. DETAILED DESCRIPTION
[0061] The following will describe the technical solution in the present application in conjunction with the accompanying drawings. The detailed description of the following embodiments and the accompanying drawings are used to exemplarily illustrate the principles of the present application, but cannot be used to limit the scope of the present application, that is, the present application is not limited to the described embodiments.
[0062] As the core technology that distinguishes it from traditional fuel vehicles, the "three-electric technology" of new energy vehicles has developed rapidly. The three-electric system refers to the electric drive system, battery system and electronic control system of electric vehicles. These three systems are also the core technologies of electric vehicles. The three-electric system includes many intelligent components and traditional components.
[0063] Smart components refer to components with operating systems and file systems, usually microprocessor units (MPUs) and microcontroller units (MCUs), with diagnostic communication over internet protocol (DoIP) as the main diagnostic and upgrade channel, such as telematics boxes (TBOXs), smart cockpit domain controllers (CDCs), mobile data centers (MDCs), vehicle domain controllers (VDCs), vehicle identification units (VIUs), etc. Traditional components refer to embedded components of traditional MCUs, without MPUs, intelligent operating systems, and file systems.
[0064] In order to better illustrate the solution of the present application, some relevant terms are explained below.
[0065] (1) Electronic control unit (ECU) is a microcomputer controller for automobiles. Like ordinary computers, it is composed of large-scale integrated circuits such as a microprocessor (CPU), memory (ROM, RAM), input / output interface (I / O), and analog-to-digital converter (A / D). ECU is a control device used to realize a series of functions such as data analysis, processing, and transmission. Various sensors transmit signals to the input circuit through the input interface. The input circuit completes the signal filtering and converts various signals into digital signals, which are then transmitted to the microprocessor. The microprocessor calculates the processed signals and sends the results to the output circuit. The output circuit amplifies the digital information transmitted by the microprocessor, converts certain signals into analog signals as needed, and drives the controlled adjustment servo element to work.
[0066] Typical vehicle-mounted ECUs include the vehicle control unit (VCU) in the power domain, the motor control unit (MCU), the on-board charger (OBC), the battery management system BMS, etc.
[0067] The vehicle controller VCU can also be called the vehicle control unit of an electric vehicle. VCU is the assembly controller of the electric vehicle power system, responsible for coordinating the work of various components such as the engine, drive motor, gearbox, power battery, etc., and has the function of improving the vehicle's power performance, safety performance and economy. It is the core component of the electric vehicle control system, and is the core control device used to control the start, operation, advance and retreat, speed, stop of the electric vehicle motor and other electronic devices of the electric vehicle. As the core component of the pure electric vehicle control system, VCU undertakes the tasks of data exchange, safety management, driver intention interpretation, and energy flow management. VCU collects motor control system signals, accelerator pedal signals, brake pedal signals and other component signals, and after comprehensive analysis and response judgment based on the driver's driving intention, monitors the actions of the lower-level component controllers, and plays a key role in the normal driving of the car, braking feedback of battery energy, network management, fault diagnosis and processing, vehicle status monitoring and other functions.
[0068] The motor controller MCU is a core power electronic unit unique to new energy vehicles. It controls the motor to output the specified torque and speed by receiving the vehicle driving control instructions from the VCU to drive the vehicle. The MCU converts the DC power of the power battery into the required high-voltage AC power and drives the motor body to output mechanical energy. The MCU has the functions of motor system fault diagnosis protection and storage. The MCU consists of a housing and cooling system, a power electronic unit, a control circuit, underlying software, and control algorithm software.
[0069] The on-board charger OBC is used to charge the car. The grid voltage is connected to the OBC via the ground AC charging pile and AC charging port to charge the power battery. As the interface between the electric vehicle and the public power grid, the on-board charger can meet the charging needs of the electric vehicle power battery. At the same time, it can also invert the DC power of the power battery into AC power and feed it back to the power grid to realize the energy conversion between the electric vehicle power battery and the power grid. OBC also provides necessary protection functions during the charging process, including overvoltage, undervoltage, overcurrent, undercurrent and other protection measures. When an abnormality occurs in the charging system, OBC can cut off the power supply in time to ensure the safety of the charging process.
[0070] (2) The universal diagnostics system (UDS) is an equipment maintenance protocol frequently used in vehicle systems. The main regulations it complies with are: ISO-15765, ISO-14229. Its main protocol model is derived from the on-board diagnostics system (OBD) and is often used on various ECUs in the vehicle. UDS is one of the more complex protocol layers commonly used in the development of the vehicle ECU application layer. The protocol interaction is divided into client and server. The client is the diagnostic instrument and the server is the ECU on the vehicle. The UDS protocol defines a communication method in a diagnostic system, including the format and transmission method of information such as diagnostic requests and diagnostic responses. It adopts a client-server architecture and communicates in a question-and-answer format. This communication method enables the vehicle's ECU to exchange information with an external diagnostic device (Tester).
[0071] (3) Over the air technology (OTA). It is a technology for remote firmware or software upgrades through the air interface of mobile communications. The so-called "over the air" refers to the remote wireless method, that is, downloading data packets through the wireless network to upgrade the car system. OTA is now widely used in network upgrades of smart TVs, mobile phones, tablets, set-top boxes and other devices. With the development of smart connected cars, OTA online upgrades have become an important function of cars. OTA can be achieved if the car is equipped with a SIM card module or a WiFi module.
[0072] The specific embodiments of the present application will be described using a motor controller MCU as a usage scenario.
[0073] like Figure 1 As shown, the vehicle's electric drive system, charging system, drive braking system, battery management system, etc. include a large number of ECUs that need to be upgraded.
[0074] The electric drive system is a key system of electric vehicles. The operating performance of electric vehicles mainly depends on the type and performance of the electric drive system. The electric drive system mainly includes a drive motor, a transmission mechanism (reducer) and a converter (inverter and DC / DC converter).
[0075] The battery management system (BMS) mainly collects and calculates parameters such as voltage, current, temperature, and SOC, and then controls the battery's charge and discharge process to protect the safety and life of the power battery and improve the battery's overall performance. It mainly includes charging control, discharge control, SOC strategy, energy balance management function, thermal management function, battery safety management function, etc.
[0076] There are three levels of concepts in the battery system: cells, modules and battery packs. In the power battery pack, in order to safely and effectively manage hundreds of single cells, the cells are not placed randomly in the power battery shell, but are placed in order according to modules and packs. The smallest unit is the cell. A group of cells can form a module, and several modules can form a pack. When several modules are controlled or managed together by the BMS and thermal management system, this unified whole is called a battery pack.
[0077] After the automobile industry entered the era of smart electric vehicles, automobile products are changing from "mechanically defined vehicles" to "software defined vehicles", and the electronic and electrical architecture is the key to realizing software-defined vehicles, which is equivalent to the neural network and brain of smart electric vehicles, and determines the digitalization and intelligence level of vehicles. Whether it is the "three-electric" system, or assisted driving, automatic driving, smart cockpit, human-computer interaction, OTA upgrade and other aspects, they are all related to the electronic and electrical architecture.
[0078] like Figure 2 As shown in the figure, the centralized electronic and electrical architecture of the whole vehicle domain mainly includes the vehicle control domain, the intelligent driving domain and the intelligent cockpit domain. Among them, the vehicle control domain basically integrates the traditional vehicle domains such as the original power domain, the chassis domain and the body domain. The intelligent driving domain and the intelligent cockpit domain focus on realizing the intelligence and networking of automobiles. The main components involved are: the vehicle control domain controller VDC, which is responsible for the whole vehicle control and has high real-time safety requirements. The intelligent driving domain controller MDC is responsible for the realization of perception, planning, and decision-making related functions related to autonomous driving. As a Public DCU, the intelligent cockpit domain controller CDC is responsible for the realization of human-machine interaction and intelligent cockpit related functions.
[0079] The telematics box can also be called the car box T-Box. It is a compound word of telecommunications (telecommunications) and information science (informatics) for long-distance communication. It can be literally defined as a service system that provides information through computer systems, wireless communication technologies, satellite navigation devices, and Internet technologies for exchanging text, voice and other information built into transportation tools such as automobiles, aviation, ships, and trains. Simply put, it connects vehicles to the Internet through wireless networks to provide car owners with various information necessary for driving and life. As a wireless gateway, T-BOX provides a remote communication interface for the entire vehicle through functions such as remote wireless communication, GPS satellite positioning, acceleration sensing and CAN communication, and provides services including driving data collection, driving trajectory recording, vehicle fault monitoring, vehicle remote query and control (opening and closing locks, air conditioning control, window control, sending torque limit, engine start and stop), driving behavior analysis, wireless hotspot sharing, etc. T-BOX has various interfaces connected to the bus, including not only the traditional controller area network CAN, local interconnect network LIN (Local Interconnect Network) and debugging interface.
[0080] With the evolution of the trend of automobile electrification, the electronic and electrical architecture of the whole vehicle is developing towards the direction of centralized domain control, which puts higher requirements on the speed of OTA upgrade of the whole vehicle. For traditional component ECUs without file systems, their upgrade speed has always been the bottleneck of OTA upgrade of the whole vehicle, especially for scenarios that require ECU serial upgrades. The upgrade time of a single ECU has a direct impact on the OTA time of the whole vehicle. Due to limited resources and processing power, it is difficult for ECUs upgraded based on UDS to use solutions that consume more resources to increase the upgrade speed.
[0081] like Figure 3 As shown, when the on-board ECU needs to be upgraded, OTA upgrade can be performed based on UDS. The OTA upgrade process of the three-electric system is controlled by TBOX. TBOX downloads the upgrade package, and TBOX sends a message to the three-electric components through the gateway GW and the vehicle controller VCU to realize OTA serial upgrade. For example, the upgrade time of a single component is 5 minutes, and the total serial upgrade time is 30 minutes. The upgrade time can be shortened by first compressing the firmware to be upgraded with a tool, and then pushing the compressed upgrade file from the cloud to the device to be upgraded. The device to be upgraded is decompressed by the decompression algorithm, and finally the upgrade process is completed. However, for the binary version of the ECU, the compression rate of the mainstream compression algorithm is around 50%-60%, which cannot be further improved.
[0082] At present, one possible implementation method is to use differential upgrade, extract the difference between the old firmware and the new firmware using differential algorithm and apply compression algorithm to generate differential package, transmit the differential package from the server to the ECU client, and then restore the new firmware by differential decompression algorithm. When the two versions are highly similar, the differential package will be very small, thus reducing the amount of data downloaded, improving efficiency, and greatly reducing the transmission time of the package.
[0083] Figure 4 This is the main flow chart of the traditional differential upgrade solution. Figure 4 As shown, the traditional differential upgrade process includes the following steps:
[0084] S110, all differential packages are uploaded to the cloud.
[0085] S120, query the current version number of the component before upgrading.
[0086] The cloud needs to obtain the current software version on the board through interaction. The OTA cloud (or the near-end host computer) dynamically selects different differential packages according to the software version on the board, and then transmits them to the ECU for upgrading. Therefore, the differential package of the cloud (or the near-end host computer) needs to contain multiple packages.
[0087] For example, suppose there are n versions of a certain upgrade package, V1-Vn, and the latest version is Vn, then the number of all differential packages is n*(n-1) / 2. When upgrading to a certain target version m, there may be m-1 differential packages to choose from, depending on the version on the board. As shown in Table 1 below, the differential versions that need to be selected when upgrading from different current versions on the board to the target version V5 are also different.
[0088] Table 1. Differential upgrade version selection
[0089]
[0090]
[0091] S130, selecting a differential package according to the queried source version number and the upgrade target version number.
[0092] For example, when the cloud remotely queries that the source version is V1 and the target version is V5, select "Difference Package V1-V5" to start the upgrade.
[0093] S140, send the corresponding differential packet.
[0094] S150, restore to the target version based on the differential package and the version on the component board.
[0095] It should be understood that there are some problems with traditional differential upgrade solutions. For example, when upgrading a single version, you need to consider the differential packages for previous historical versions. The previous n versions require n-1 packages. The interaction process is complex, and the version number needs to be queried during the interaction. It may involve full-process interaction and modification adaptation of the cloud, domain controller, ECU components, etc. It is difficult to connect different components: In the vehicle's electronic and electrical architecture, if not all components support differential upgrades, it is necessary to adapt the process of querying the version number and selecting the upgrade package to distinguish different components, which makes the implementation process complex.
[0096] Therefore, the current traditional differential solutions cannot be quickly applied to OTA of embedded vehicle-mounted ECU products with less resources. It is often necessary to modify all components of the entire process from the cloud, domain controller, component ECU, etc., and it is difficult to implement a unified flashing specification on all ECU components on the communication bus of the entire vehicle.
[0097] Based on the above problems, the present application provides a motor controller MCU differential upgrade method, a differential upgrade package generation method and a differential upgrade device. It is not necessary to obtain the specific version information of the motor controller MCU to be upgraded, which simplifies the upgrade process, and there is no need to distinguish between different versions of the motor controller MCU. The implementation is simple, and there is no need to modify the upgrade process, which improves compatibility.
[0098] Figure 5 and Figure 6 This is a flow chart of the generation and differential upgrade of the motor controller MCU differential upgrade package provided in this application.
[0099] like Figure 5 As shown, the process includes: S210, the cloud or the upgrade host computer prepares a target version differential upgrade package.
[0100] The differential upgrade package can be generated by the cloud device. Figure 6 As shown in the figure, the method for generating the motor controller MCU differential upgrade package includes:
[0101] First, a differential auxiliary package is generated according to the target version data, and the differential auxiliary package is used to indicate information of modified data in the target version data.
[0102] First use the normal release package of the target version and the differential auxiliary package generation tool to generate the differential auxiliary package of the target version.
[0103] In a possible embodiment, the size of the target version differential auxiliary package is less than or equal to 10% of the size of the target version data.
[0104] The differential auxiliary package is generally less than 10% of the target version upgrade package. The size of the differential auxiliary package is related to the motor controller MCU to be upgraded. For example, if the motor controller MCU to be upgraded is a traditional component in the automotive field, the size of the differential auxiliary package is generally less than 10% of the target version data package size, and if the motor controller MCU to be upgraded is an intelligent component, the differential auxiliary package is generally smaller. The differential auxiliary package records information related to the target version differential structure.
[0105] Then, the target version data and the differential auxiliary package are merged to generate a differential merge package, and then a differential algorithm is used on the differential merge package to generate a differential upgrade package.
[0106] In a possible implementation, a package merging tool may be used to merge the target version differential auxiliary package with the normal target version upgrade package to generate a target version differential merged package without differential processing.
[0107] Next, a differential upgrade package is generated according to the target version data and the differential auxiliary package. The differential upgrade package is used to upgrade the source version data of the motor controller MCU to be upgraded to the target version data. The differential upgrade package includes the data to be modified and the program file for executing the modification of the data to be modified.
[0108] In a possible implementation, a differential package generation tool is used to process the pre-processed differential merge package to generate a final target version formal differential upgrade package, which is used for transmission during the upgrade.
[0109] Optionally, the differential algorithm bsdiff or vcdiff may be used as the differential algorithm, and this application does not limit the differential algorithm used.
[0110] The differential upgrade package can be a difference file between the target new file and the old file produced by the differential algorithm, which is completed by the host computer or platform system. The differential algorithm can be a method or step to extract the difference information between the old file and the target new file. Commonly used differential algorithms are bsdiff and vcdiff. Both algorithms can perform secondary compression after completing the matching search. For the characteristics of the firmware binary file, both can complete efficient matching. The device can restore the target new file based on the differential file and the old file.
[0111] Use the differential tool to calculate the file differences between the two versions to generate a differential upgrade file. The differential upgrade package includes the data to be modified and the program file for modifying the data to be modified. The function of the program file for modifying the data to be modified is: after the differential upgrade file is transferred to the motor controller MCU to be upgraded, the motor controller MCU to be upgraded can restore the target new data based on this program file and the data to be modified.
[0112] Exemplarily, the differential upgrade package may consist of several parts of information: header, control information, differential information, and newly added information. The control information may consist of a series of commands, each command consisting of a fixed format triple. Exemplarily, the meaning of the triple command (x1, y1, z1) may be: read the x1 length byte from the differential information and add the x1 length byte read from the old file to get the content of the new file; read the y1 length byte from the newly added information and add the current position as the content of the new file; skip the data of the z1 length byte in the old file.
[0113] In a possible implementation, the method may include: using a preset simulation program to perform an upgrade simulation operation on the differential upgrade package to obtain simulated new data, and verifying the simulated new data with the target version data.
[0114] The preset simulation program can simulate the upgrade according to the differential upgrade package corresponding to the target version data, and use the preset simulation program to simulate the restore action on the device side, and perform a simulated upgrade operation on the source version data of the differential upgrade package to obtain simulated new data. The simulated new data is verified and compared with the target version data to determine whether the differential upgrade package is correctly generated, and to ensure that the content of the simulated target version data is exactly the same as the real target version data. If there is any abnormality, the differential upgrade package generated this time cannot be used for upgrade.
[0115] In a possible embodiment, a digital signature may be added to the differential upgrade file, and the digital signature is used to verify the differential upgrade file.
[0116] Digitally signing a file is mainly divided into two steps. First, the original file is digested to obtain a digest value, and then the digest value is encrypted using the private key in the public key algorithm. The encryption method can be to use cyclic redundancy check CRC, Hash and other algorithms for data verification. This application does not limit the method of adding signature data.
[0117] The differential upgrade package corresponding to the target version data needs to be encrypted and a message authentication code (MAC code) added to ensure the confidentiality and integrity of the firmware.
[0118] After the differential upgrade package is packaged and generated, it can be stored in the cloud for download by the vehicle. The differential upgrade package can then be sent to the motor controller MCU to be upgraded, so that the motor controller MCU to be upgraded can perform the upgrade operation on the source version data according to the received differential upgrade package.
[0119] Continue to see Figure 5 After the motor controller MCU differential upgrade package is packaged, the differential upgrade package needs to be transmitted.
[0120] S220, transmitting the target version differential upgrade package.
[0121] The motor controller MCU to be upgraded includes the vehicle-side electronic controller ECU.
[0122] The motor controller MCU receives the differential upgrade package through the over-the-air download technology OTA or the proximal diagnostic instrument based on the unified diagnostic service UDS protocol.
[0123] The motor controller MCU can download the differential upgrade package through OTA technology by the vehicle information box T-BOX, and then transmit it to the motor controller MCU through the CAN line by T-BOX, or the vehicle end can be connected to the proximal diagnostic instrument, which will transmit it to the motor controller MCU.
[0124] It should be understood that the form in which the differential upgrade package is transmitted to the motor controller MCU board (or any upgradeable component, lower computer, etc.) is not limited to the CAN link UDS protocol, but also includes any physical medium or protocol that can transmit data to the motor controller MCU to be upgraded.
[0125] The motor controller MCU to be upgraded includes source version data and source version differential auxiliary package, and the source version differential auxiliary package is used to indicate information about modified data in the source version data.
[0126] S230, after receiving the target version differential upgrade file, restore the target version data.
[0127] like Figure 6 As shown, the motor controller MCU differential upgrade method provided by this application is as follows:
[0128] After the motor controller MCU to be upgraded receives the differential upgrade package, the motor controller MCU to be upgraded performs differential restoration processing on the source version data according to the source version differential auxiliary package and the differential upgrade package to obtain the target version data.
[0129] The upgrade program of the motor controller MCU to be upgraded is restored according to the differential upgrade package of the target version, combined with the source version data and the source version differential auxiliary package, and finally the restored target version data and the target version differential auxiliary package are obtained. Finally, the restored normal release package and its differential auxiliary package version are burned onto the single board.
[0130] In the differential restoration process, the source version data and the source version differential auxiliary package are required together with the differential upgrade package to finally generate the target version and its differential auxiliary package. The entire process requires the source version differential auxiliary package as auxiliary processing.
[0131] The source version differential auxiliary package is generated by processing the source version data using the differential auxiliary package generation tool. The differential auxiliary package records the information related to the differential structure of the source version data. The source version differential auxiliary package is used to indicate the information that the data in the source version data has been modified compared with the preset data. The data to be modified and the program file for modifying the data to be modified included in the differential upgrade package can be obtained according to the target version data and the preset data, so that the source version data can be restored to the target version data by the differential structure with the preset data in combination with the source version differential auxiliary package.
[0132] The source version differential auxiliary package and source version data are both obtained based on preset data, and the differential upgrade package is obtained by processing the target version data and preset data. Therefore, the source version differential auxiliary package and source version data can be used to first process the preset data related to any version data, and then the differential upgrade package can be used to restore the processed preset data to obtain the target version data. Since the preset data is related to any version data, the differential upgrade package does not need to correspond to a specific version, and can upgrade any version of data to the target version.
[0133] According to the solution of the present application, there is no need to obtain the specific version information of the motor controller MCU to be upgraded, which simplifies the upgrade process and improves the upgrade efficiency.
[0134] The differential upgrade method also includes restoring the motor controller MCU to be upgraded according to the differential upgrade package, the source version differential auxiliary package and the source version data to obtain a target version differential auxiliary package, and the target version differential auxiliary package is used to indicate information about modified data in the target version data.
[0135] The target version differential auxiliary package can be written into the motor controller MCU to be upgraded, so that when upgrading from the target version next time, a differential upgrade can be performed based on the target version auxiliary package without obtaining a specific version number.
[0136] After the motor controller MCU to be upgraded completes the differential upgrade, the target version data and the target version differential auxiliary package are stored.
[0137] After the differential upgrade is completed, the target version data and target version differential auxiliary package obtained by the restoration process are burned into the motor controller MCU to be upgraded. The source version data and source version differential auxiliary package can be deleted or retained. In some cases, if a problem is detected after the differential upgrade, it can be rolled back to the source version data.
[0138] The motor controller MCU to be upgraded receives the differential upgrade package, including receiving the differential upgrade package after successfully verifying the differential upgrade package. The differential upgrade method also includes the motor controller MCU to be upgraded verifying the target version data obtained by differential restoration processing, and completing the differential upgrade after the verification passes.
[0139] A digital signature is added to the differential upgrade package, and the digital signature is used to verify the differential upgrade package. Before receiving the differential upgrade package, the integrity and correctness of the differential upgrade package will be verified first, and the differential upgrade package will be received only after the verification is successful. In the process of differential restoration through the differential upgrade package, the target version data obtained can also be verified to verify the correctness of the upgrade. After the verification passes, the differential upgrade is completed. If the verification fails, consider rolling back the data and re-upgrading or canceling the upgrade.
[0140] During the differential upgrade of the motor controller MCU to be upgraded, when the motor controller MCU to be upgraded is powered off or fails, the differential upgrade method includes stopping the differential upgrade of the motor controller MCU to be upgraded and restoring the source version data. The motor controller MCU to be upgraded stores the differential upgrade package and the temporary data obtained by the restoration process for the motor controller MCU to be upgraded to perform the differential upgrade again.
[0141] During the upgrade process, the motor controller MCU to be upgraded will continuously detect the power status and working status. When the motor controller MCU to be upgraded fails or loses power, the differential upgrade will stop and restore to the source version data for use. In some implementations, the differential upgrade package and the temporary data obtained by the restore process can be stored in a non-volatile memory (such as flash memory), so that after stopping the differential upgrade, the data will not be lost, and the upgrade process can be continued after the power is restored. If the upgrade fails, the system may notify the user that the upgrade is not complete and provide the option to restart the upgrade.
[0142] Before the differential upgrade, the motor controller MCU to be upgraded will verify the current state, and will verify it again during or after the upgrade. If the upgrade fails due to power outage or fault, the motor controller MCU to be upgraded can verify the current state through the checksum or hash value and decide whether to retry the upgrade. The motor controller MCU to be upgraded can support the breakpoint resume function to record the progress of the upgrade. After the power is restored, the upgrade process can be continued from the last recorded breakpoint instead of starting from the beginning.
[0143] According to the solution of the present application, the stability and reliability of differential upgrading are improved.
[0144] Figure 7 This is a schematic diagram of the upgrade transmission process of the motor controller MCU based on TCP, UDP, and HTTP provided in this application.
[0145] like Figure 8 As shown, the motor controller MCU to be upgraded receives the differential upgrade package, including the motor controller MCU to be upgraded receiving the differential upgrade package based on the transmission control protocol TCP or the user datagram protocol UDP or the hypertext transfer protocol HTTP.
[0146] It should be understood that the form of differential packet transmission to the ECU board (or any upgradeable component, lower computer, etc.) is not limited to the CAN link UDS protocol, but also includes any physical medium or protocol that can transmit data to the motor controller MCU to be upgraded.
[0147] Figure 8 This is a schematic diagram of the upgrade transmission process of ECU in other fields based on TCP, UDP, and HTTP.
[0148] like Figure 8 As shown, the motor controller MCU to be upgraded includes other field ECU components, and the motor controller MCU to be upgraded receives the differential upgrade package, including the motor controller MCU to be upgraded receiving the differential upgrade package based on the transmission control protocol TCP or the user datagram protocol UDP or the hypertext transfer protocol HTTP.
[0149] ECUs in other fields can upgrade software and components on transmission links based on file transfer protocols such as TCP, UDP, and HTTP.
[0150] It should be understood that the form of differential packet transmission to the ECU board (or any upgradeable component, lower computer, etc.) is not limited to the CAN link UDS protocol, but also includes any physical medium or protocol that can transmit data to the motor controller MCU to be upgraded.
[0151] Based on the differential upgrade method of this application, the host computer (or OTA cloud) only needs to know that it needs to be upgraded to a certain target version, without knowing the specific version information of the vehicle-side components. In any software upgrade scenario where traditional differential upgrades are applied, it is not necessary to pay attention to the current version of the motor controller MCU to be upgraded, thereby simplifying the upgrade process.
[0152] Fig. 9 The embodiment of the present application provides a device for using differential upgrade of the motor controller MCU. The device includes a transceiver, a processor, a memory and an interface, the memory is used to store differential upgrade packages, and the processor of the device uses the transceiver to receive the differential upgrade package from the interface through the over-the-air download technology OTA or the near-end diagnostic instrument and sends the differential upgrade package to the motor controller MCU to be upgraded through the controller area network CAN bus.
[0153] Accordingly, a separate device for receiving and sending and storing differential upgrade packages can be arranged on the vehicle to perform receiving and sending and storage processing on the upgrade packages, thereby reducing the storage requirements of the motor controller MCU to be upgraded and completing the upgrade requirements more quickly.
[0154] In a specific embodiment, when the device is powered off or fails during the process of receiving the differential upgrade package, the device stops receiving the differential upgrade package and clears the received part of the differential upgrade package in the memory.
[0155] Correspondingly, during the process of the device receiving the differential upgrade package, when the device loses power or fails, in order to ensure the integrity of the received differential upgrade package, the device stops receiving the differential upgrade package and clears the partial differential upgrade package that has been received in the memory, so as to subsequently receive the differential upgrade package again in full to ensure a successful upgrade.
[0156] In a specific embodiment, the powertrain integrates a motor controller and a drive motor that can achieve differential upgrading. The powertrain receives high-voltage direct current and inverts the output of three-phase alternating current through the motor controller to supply the drive motor for operation.
[0157] Correspondingly, integrating the motor controller provided in this application into the powertrain can more efficiently implement the upgrade of the motor control program of the powertrain, thereby facilitating the use and maintenance of the powertrain.
[0158] In a specific embodiment, a vehicle integrates a motor controller capable of differential upgrading and a device for using the motor controller differential upgrade. The device for using the motor controller differential upgrade is used to receive differential upgrade packages via over-the-air download technology OTA or PC transmission and pass them to the motor controller for upgrading.
[0159] Correspondingly, the motor controller and the motor controller differential upgrade device provided in this application are integrated into the vehicle, and the motor control program can be upgraded more efficiently with the help of over-the-air download technology OTA or PC transmission, which facilitates the use and maintenance of the vehicle.
[0160] It should be noted that the differential upgrade method, differential upgrade package generation method and differential upgrade device of this application are not only used on the motor controller MCU, but can also be used in other electronic control devices with similar upgrade requirements such as on-board charger OBC, vehicle information box (TBOX), smart cockpit domain controller (CDC), smart driving domain controller (MDC), vehicle control domain controller (VDC), vehicle controller VCU and other fields.
[0161] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0162] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0163] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A differential upgrade method for a motor controller, characterized in that: The motor controller to be upgraded includes source version data and a source version differential auxiliary package, wherein the source version differential auxiliary package is used to indicate information about modified data in the source version data, and the differential upgrade method includes: The motor controller to be upgraded receives a differential upgrade package, wherein the differential upgrade package is used to upgrade the source version data to the target version data, and the differential upgrade package includes the data to be modified and a modification execution program file for the data to be modified; The motor controller to be upgraded performs differential restoration processing on the source version data according to the source version differential auxiliary package and the differential upgrade package to obtain the target version data.
2. The differential upgrade method of the motor controller according to claim 1, characterized in that: The differential upgrade method further includes: The motor controller to be upgraded performs restoration processing according to the differential upgrade package, the source version differential auxiliary package and the source version data to obtain a target version differential auxiliary package, wherein the target version differential auxiliary package is used to indicate information about modified data in the target version data.
3. The differential upgrade method of the motor controller according to claim 2, characterized in that: The differential upgrade package is obtained by performing differential processing on the differential merge package, the differential merge package includes the target version differential auxiliary package and the target version data, and the target version differential auxiliary package is determined according to the target version data.
4. The differential upgrade method of a motor controller according to any one of claims 1 to 3, characterized in that: The method for the motor controller to be upgraded to receive the differential upgrade package includes: The motor controller to be upgraded receives the differential upgrade package based on any one of the transmission control protocol TCP, the user datagram protocol UDP, and the hypertext transfer protocol HTTP; or, The motor controller to be upgraded receives the differential upgrade package via the over-the-air download technology OTA or a proximal diagnostic instrument based on the unified diagnostic service UDS protocol.
5. The differential upgrade method of the motor controller according to any one of claims 2 to 4, characterized in that: After the motor controller to be upgraded completes the differential upgrade, the motor controller to be upgraded stores the target version data and the target version differential auxiliary package.
6. The differential upgrade method of a motor controller according to any one of claims 2 to 5, characterized in that: The size of the target version differential auxiliary package is less than or equal to 10% of the size of the target version data.
7. The differential upgrade method of a motor controller according to any one of claims 2 to 6, characterized in that: The differential upgrade method comprises: The motor controller to be upgraded receives the differential upgrade package after successfully verifying the differential upgrade package; The motor controller to be upgraded verifies the target version data obtained by differential restoration processing, and completes the differential upgrade after the verification passes.
8. The differential upgrade method of a motor controller according to any one of claims 2 to 7, characterized in that: During the differential upgrade of the motor controller to be upgraded, when the motor controller to be upgraded is powered off or fails, the differential upgrade method includes: The motor controller to be upgraded stops the differential upgrade and restores the source version data; The motor controller to be upgraded stores the differential upgrade package and temporary data obtained by restoration processing so that the motor controller to be upgraded can perform the differential upgrade again.
9. A method for generating a differential upgrade package for a motor controller, characterized in that: The differential upgrade package generation method comprises: Generate a differential auxiliary package based on the target version data, wherein the differential auxiliary package is used to indicate information about modified data in the target version data; A differential upgrade package is generated based on the target version data and the differential auxiliary package, the differential upgrade package is used to upgrade the source version data of the motor controller to be upgraded to the target version data, and the differential upgrade package includes the data to be modified and a modification execution program file for the data to be modified.
10. The differential upgrade package generation method according to claim 9, characterized in that: The process of generating a differential upgrade package based on the target version data and the differential auxiliary package includes: The target version data and the differential auxiliary package are merged to generate a differential merged package; The differential merge package uses a differential algorithm to generate the differential upgrade package.
11. The differential upgrade package generation method according to claim 9 or 10, characterized in that: The differential upgrade package generation method comprises: Performing an upgrade operation on the differential upgrade package using a preset program; The upgraded differential upgrade package is verified based on the target version data.
12. A device for using differential upgrade of a motor controller, characterized in that: The using device includes a transceiver, a processor, a memory and an interface, the memory is used to store the differential upgrade package in the differential upgrade method of the motor controller described in any one of claims 1-8, and the processor of the using device uses the transceiver to receive the differential upgrade package from the interface through the over-the-air download technology OTA or a proximal diagnostic instrument and sends the differential upgrade package to the motor controller MCU to be upgraded through the controller area network CAN bus.
13. The device according to claim 12, characterized in that: During the process of the using device receiving the differential upgrade package, the using device loses power or fails, and the using device stops receiving the differential upgrade package and clears the received part of the differential upgrade package in the memory.
14. A powertrain, characterized in that: The powertrain includes the motor controller to be upgraded and the drive motor described in the differential upgrade method of the motor controller as described in any one of claims 1-8, and the powertrain receives high-voltage direct current and inverts and outputs three-phase alternating current through the motor controller to supply the drive motor for operation.
15. A vehicle, characterized in that: The vehicle includes the motor controller to be upgraded in the differential upgrade method for the motor controller described in any one of claims 1-8 and the motor controller differential upgrade device described in any one of claims 12-13, and the motor controller differential upgrade device is used to receive the differential upgrade package through over-the-air download technology OTA or PC computer transmission and pass it to the motor controller for upgrade use.
Citation Information
Cited By
Electronic control unit upgrading method and system
CN120560696A
