Off-line software flashing method and device

Through offline software writing methods and devices, software files in external memory cards are read and written to the motor controller one after another, which solves the problems of high cost of upgrading the motor controller software and cumbersome operation, and achieves low-cost and simple batch software upgrades.

CN119597323APending Publication Date: 2025-03-11CHONGQING JINKANG POWER NEW ENERGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411512839.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The upgrade of the motor controller software is expensive and cumbersome. Especially when batch upgrades are required, multiple upper computers need to be configured, which is relatively expensive.

Method used

An offline software writing method and device is provided, which realizes software upgrade by reading the software files to be written in an external memory card, and determining the single-sessment amount based on its own storage capacity, and parsing and writing to the motor controller one after another.

Benefits of technology

It reduces the cost and operation complexity of software upgrades, and is suitable for software upgrades of large-volume motor controllers, which are easy to operate and low cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597323A_ABST
    Figure CN119597323A_ABST
Patent Text Reader

Abstract

The invention discloses an off-line software flashing method and device, and relates to the technical field of motor controllers, and the off-line software flashing method comprises the following steps: the off-line software flashing device reads a to-be-flashed software file stored in an external memory card; the off-line software flashing device determines a single-time analysis amount based on the storage capacity of the off-line software flashing device; the offline software flashing device performs multiple analysis operations on the to-be-flashed software file in sequence based on the single analysis amount, and writes the to-be-flashed software content analyzed each time into the motor controller in sequence; wherein each parsing operation is executed after the to-be-flashed software content parsed last time is written into the motor controller. The invention aims to improve the problems of high software upgrading cost and tedious operation of the motor controller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of motor controllers, and more specifically, to an offline software flashing method and device. Background Art

[0002] As one of the core components of electric vehicles, the intelligence level of the motor controller's software will become the key to the differentiation of new energy vehicle companies. With the rapid development of automotive electronic technology, the software control logic of the motor controller includes instructions and responses, closed-loop control, etc. These need to be continuously optimized through software iteration to improve control accuracy and response speed. The motor controller of the car faces the demand for rapid software iteration. Therefore, it is necessary to frequently update the software in the motor controller during product verification to adapt to new technologies and market requirements.

[0003] In the related technology, it is usually necessary to use a host computer such as a computer to flash the software of the motor controller, for example, using ETAS's INCA update software, Vector's CANoe update software, or self-developed engineering diagnostic equipment update software. However, no matter which update software is used, a host computer is required to flash the software, and the host computer is not convenient to carry. In many experimental environments, the charging requirements of the host computer are not easy to meet, and the operation is cumbersome, and the requirements for the operator are high. In particular, when batch software upgrades are required for motor controllers, a relatively large number of host computers need to be configured to meet the software upgrade requirements, which is costly. Summary of the invention

[0004] In view of this, the present invention provides an offline software flashing method and device, which can improve the problems of high cost and complicated operation of motor controller software upgrade.

[0005] In order to achieve the above object, the present invention adopts the following technical scheme:

[0006] In a first aspect, the present invention provides an offline software flashing method, comprising:

[0007] The offline software flashing device reads the software file to be flashed stored in the external storage card;

[0008] The offline software flash writing device determines the single analysis amount based on its own storage capacity;

[0009] The offline software flashing device sequentially performs multiple parsing operations on the software file to be flashed based on the single parsing amount, and sequentially writes the software content to be flashed obtained from each parsing into the motor controller;

[0010] Each parsing operation is performed after the software content to be flashed obtained from the last parsing is written into the motor controller.

[0011] The method provided by the present invention abandons the method of realizing the software upgrade of the motor controller through the host computer. Through the communication between the portable offline software flashing device and the external storage card, the software file to be flashed stored in the external storage card is read and written into the motor controller to complete the software upgrade of the motor controller. The method can improve the problems of high cost and cumbersome operation of the motor controller software upgrade, and is particularly suitable for the software upgrade of large quantities of motor controllers.

[0012] In a possible implementation, the offline software flashing device sequentially performs multiple parsing operations on the software file to be flashed based on a single parsing amount, and sequentially writes the software content to be flashed obtained from each parsing into the motor controller, including:

[0013] When the parsed software content to be flashed includes a boot program, the offline software flashing device deletes the boot program from the software content to be flashed and then writes the software content to be flashed into the motor controller.

[0014] In one possible implementation,

[0015] Before the offline software flashing device sequentially performs multiple parsing operations on the software file to be flashed based on the single parsing amount and sequentially writes the software content to be flashed obtained from each parsing into the motor controller, the method further includes:

[0016] The offline software flashing device sends a safety authentication request to the motor controller;

[0017] After the offline software flashing device receives the authentication information returned by the motor controller, the offline software flashing device performs multiple parsing operations on the software files to be flashed based on the single parsing amount, and writes the software content to be flashed obtained from each parsing into the motor controller in sequence.

[0018] In a possible implementation, after the offline software flash writing device sends a safety authentication request to the motor controller, the method further includes:

[0019] The offline software flashing device receives the random number returned by the motor controller in response to the security authentication request;

[0020] The offline software flash writing device performs security authentication calculation on the random number to obtain a first key;

[0021] The offline software flashing device sends a first key to the motor controller, so that the motor controller returns authentication pass information to the offline software flashing device after comparing the first key with the second key and finding them to be the same, wherein the second key is obtained by the motor controller through security authentication calculation of a random number.

[0022] In a possible implementation, before the offline software flashing device reads the software file to be flashed stored in the external storage card, it also includes:

[0023] If there is only one software file to be flashed in the external memory card, the step of the offline software flashing device reading the software file to be flashed stored in the external memory card is executed.

[0024] In a possible implementation, the offline software flashing device reads the software file to be flashed stored in the external storage card, including:

[0025] If a plurality of software files to be flashed are stored in the external storage card, the offline software flashing device reads the software file to be flashed with the latest storage time.

[0026] In a second aspect, the present invention provides an offline software flashing device, comprising a processing chip, a memory, a memory card communication interface, and a transceiver: wherein the memory stores a computer program or computer instructions that can be loaded by the processing chip and execute the offline software flashing method of the first aspect and any possible implementation thereof;

[0027] A memory card communication interface, coupled to the processing chip, for realizing communication between the offline software flash writing device and the external memory card;

[0028] The transceiver is coupled to the processing chip and is used to realize the communication between the offline software flashing device and the motor controller.

[0029] In a possible implementation, it also includes a housing and a button;

[0030] The processing chip, memory and transceiver are all arranged in the housing;

[0031] The button is exposed on the outer surface of the shell, coupled to the processing chip, and is used to generate a flashing instruction so that the processing chip responds to the flashing instruction and performs a software flashing operation on the motor controller.

[0032] In a third aspect, the present invention provides a computer-readable storage medium storing a computer program or computer instructions that can be loaded by a processor and executed by an offline software flashing method such as the first aspect and any possible implementation thereof.

[0033] In a fourth aspect, the present invention provides a computer program product, comprising a computer program or computer instructions, which, when loaded and executed by a processor, implement the steps of the offline software flashing method of the first aspect and any possible implementation thereof.

[0034] For the specific description of the second to fourth aspects and their various implementations in the present invention, reference can be made to the detailed description in the first aspect and its various implementations; and for the beneficial effects of the second to fourth aspects and their various implementations, reference can be made to the analysis of the beneficial effects in the first aspect and its various implementations, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0036] Figure 1 It is a flowchart of an offline software flashing method provided by an embodiment of the present invention;

[0037] Figure 2 It is a schematic diagram of a safety authentication process in an offline software flashing method provided by an embodiment of the present invention;

[0038] Figure 3 It is a schematic diagram of the internal structure of an offline software flash writing device provided by an embodiment of the present invention;

[0039] Figure 4 It is a structural schematic diagram of an external shell of an offline software flashing device provided by an embodiment of the present invention;

[0040] Figure 5 It is a block diagram of the internal structure of an offline software flashing device provided by an embodiment of the present invention.

[0041] Among them: 11, shell; 12, processing chip; 13, memory; 14, transceiver; 15, button; 16, card slot; 17, opening; 21, first indicator light; 22, second indicator light; 23, third indicator light; 24, fourth indicator light; 31, input pin; 32, output pin. DETAILED DESCRIPTION

[0042] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.

[0043] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0044] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0045] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0046] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0047] Embodiment 1:

[0048] Please refer to Figure 1 , which is a flow chart of the offline software flashing method provided by an embodiment of the present invention. Figure 1 As shown, the method mainly includes:

[0049] Step S101, the offline software flashing device reads the software file to be flashed stored in the external storage card;

[0050] Step S102, the offline software flash writing device determines a single analysis amount based on its own storage capacity;

[0051] Step S103, the offline software flashing device sequentially performs multiple parsing operations on the software file to be flashed based on the single parsing amount, and sequentially writes the software content to be flashed obtained from each parsing into the motor controller;

[0052] Each parsing operation is performed after the software content to be flashed obtained from the last parsing is written into the motor controller.

[0053] In this embodiment, the external storage card may be an SD card, and the offline software flashing device is provided with a card slot for accommodating the SD card. The software file to be flashed may be stored in the Intel HEX format, which is a file format for storing and transmitting binary data and is mainly used for firmware upgrades or data downloads of microcontrollers and other programmable devices.

[0054] In order to reduce costs, offline software flashing devices generally do not use microcontrollers with large RAM capacity. However, parsing all the program data in the hex file into RAM before software flashing requires a relatively large microcontroller RAM space, which will undoubtedly increase costs.

[0055] Therefore, this embodiment uses a segmented extraction software flashing method, first extracting a section of the program from the hex file, and then transmitting this section to the motor controller through the diagnostic flashing process. After completion, the next section of the program data is read from the hex file for flashing.

[0056] In step S102, the storage capacity of the offline software flashing device is the RAM capacity of the single chip. The single analysis amount can be determined according to the RAM capacity of the single chip in the offline software flashing device, for example, 300 lines of program, which is not specifically limited in this embodiment.

[0057] In this embodiment, as long as the offline software flash writing device parses the program content of the single parsing amount, the program content is written into the motor controller, and after the program content is written, the remaining software files to be flashed are parsed and written according to the single parsing amount. If the remaining amount to be parsed is less than the single parsing amount, the remaining file content is directly parsed.

[0058] The program to be flashed generally includes a boot program, application software and calibration data. Among them, the boot program is the first code executed by the embedded system or microcontroller after power-on or reset, which is responsible for initializing the system and loading the operating system or application software; the application software refers to the program code used to implement specific functions in the embedded system or microcontroller, which is the software part that the user directly interacts with or uses; the calibration data usually refers to the data used to calibrate or configure specific functions in the embedded system or microcontroller, which is used to adjust and optimize the performance of the software or hardware. These data may include sensor calibration values, configuration parameters, user preference settings, etc.

[0059] The hex file contains the addresses corresponding to the boot program boot, application software and calibration data. By parsing the hex file and finding the address, the boot program boot, application software and calibration data can be located.

[0060] Generally speaking, for the version upgrade of the same software, the boot program is the same and there is no need to flash it repeatedly, which can save upgrade time and improve upgrade efficiency.

[0061] Therefore, in some optional embodiments, after the offline software flashing device parses the boot program in the software file to be flashed, it will delete the boot program from the software content to be flashed, and then write the software content to be flashed into the motor controller to complete the flashing operation on the motor controller.

[0062] In addition, sometimes when the software version is iterated, the application software part does not change, only the calibration data is updated. Therefore, when making the software file to be flashed, the program code of the application software part is omitted, which will also save upgrade time and improve upgrade efficiency.

[0063] In this embodiment, the software file to be written stored in the external memory card is read through the communication between the offline software flashing device and the external memory card, and is written into the motor controller to complete the software upgrade of the motor controller. Compared with the host computer, the offline software flashing device is easy to carry. As long as the SD card storing the software file to be written is inserted and the offline software flashing device is connected to the communication interface of the vehicle, the motor controller software can be upgraded, and the operation is simple. In addition, the cost of the offline software flashing device is relatively low, and it can be mass-produced. Each offline software flashing device flashes a motor controller, so the software upgrade of multiple motor controllers can be completed at the same time. Moreover, due to the simple operation, the upgrade of multiple motor controllers can be completed by one staff member, and there is no need to wait near the offline software flashing device during the upgrade process.

[0064] The offline software flashing device can be reused. If a large number of motor controllers need to be upgraded, these motor controllers can also be upgraded in batches. Therefore, it is particularly suitable for software upgrades of large quantities of motor controllers.

[0065] Embodiment 2:

[0066] The external memory card can repeat the software flashing operation for multiple versions, and for the purpose of software backup and other requirements, the external memory card may store multiple versions of the motor controller software files. However, for the offline software flashing device, if the external memory card stores multiple software files to be flashed at the same time, the offline software flashing device will not be able to determine which software file to be flashed should be read, which will cause abnormal errors in the software flashing process.

[0067] In order to avoid the situation where the software flashing process described above is abnormal and erroneous, in some optional embodiments, before the external memory card is successfully initialized and the offline software flashing device starts to read the software file to be flashed stored in the external memory card, it is necessary to first determine whether there is and only one software file to be flashed in the external memory card. If there is and only one, the software flashing process can continue, otherwise it is necessary to continue waiting.

[0068] For the external storage card, you can also avoid the abnormal error of the above software flashing process by the following methods:

[0069] When the new version of the software file to be flashed is stored in the external storage card, the old version of the software file (usually the software file that has been flashed) in the external storage card is stored in the external storage card in the form of a compressed package for backup; and the new version of the software file to be flashed is stored in the hex file format. In this way, the offline software flashing device only reads the software file to be flashed in the hex file format.

[0070] Of course, in addition to the above method, the offline software flashing device can also read the software files to be flashed in the external storage card based on the time when the multiple software files to be flashed were stored in the external storage card. Specifically, the software files to be flashed with the latest storage time are read.

[0071] Embodiment three:

[0072] In order to ensure that the motor controller software is upgraded by a legally authorized offline software flashing device, it is necessary to conduct a security authentication on the legitimacy of the offline software flashing device before executing the flashing task. Only after the security authentication is passed can the flashing task continue. Figure 2 The specific plan is as follows:

[0073] Step S201, the offline software flash writing device sends a security authentication request to the motor controller;

[0074] Step S202, the offline software flashing device receives a random number returned by the motor controller in response to a security authentication request;

[0075] Step S203, the offline software flash writing device performs security authentication calculation on the random number to obtain a first key;

[0076] Step S204, the offline software flashing device sends the first key to the motor controller, so that the motor controller returns authentication pass information to the offline software flashing device after comparing the first key with the second key and finding them to be the same, wherein the second key is obtained by the motor controller performing security authentication calculation on the random number;

[0077] Step S205, after the offline software flashing device receives the authentication pass information returned by the motor controller, the offline software flashing device performs multiple parsing operations on the software files to be flashed based on the single parsing amount, and writes the software content to be flashed obtained from each parsing into the motor controller in sequence.

[0078] In this embodiment, the calculation of the first key is based on the first security authentication algorithm built into the offline software flashing device to calculate the random number, and the calculation of the second key is based on the second security authentication algorithm built into the motor controller to calculate the random number. If it is a legally authorized offline software flashing device, its built-in first security authentication algorithm should be the same as the second security authentication algorithm, and the calculated first key and second key are also the same. Therefore, if the first key is the same as the second key, it means that the offline software flashing device is legally authorized, the security authentication passes, and the offline software flashing device is allowed to flash the software to the motor controller; if the first key is not the same as the second key, it means that the offline software flashing device is not legally authorized, the security authentication fails, and the offline software flashing device is not allowed to flash the software to the motor controller.

[0079] Embodiment 4:

[0080] Figure 3 It is a schematic diagram of the internal structure of an offline software flash writing device provided by an embodiment of the present invention; Figure 4 It is a structural schematic diagram of an external shell of an offline software flashing device provided by an embodiment of the present invention.

[0081] like Figure 3 and Figure 4 As shown, the offline software flashing device provided by the present invention includes a processing chip 12, a memory 13 and a transceiver 14. The processing chip 12 is provided with a communication interface (not shown), a file system (not shown) and a preset program (not shown), which is used to communicate with the memory 13 through the communication interface, the file system is used to read the software file to be flashed, and the preset program is used to parse the software file to be flashed after reading, and obtain the software content to be flashed that needs to be upgraded; the memory 13 is coupled to the processing chip 11 through the communication interface, and stores the software file to be flashed that can be used by the motor controller (not shown); the memory card communication interface (not shown) is used to implement the processing chip 1 2 for communicating with an external memory card (not shown); a button 15, coupled to the processing chip 12, for generating a flashing instruction; a transceiver 14, coupled to the processing chip 12, and when the transceiver 14 is coupled to the motor controller, the processing chip 12 responds to the flashing instruction, reads the software file to be flashed through the file system, and parses the read software file to be flashed through a preset program to obtain the software content to be flashed, and then writes the software content to be flashed stored in the memory 13 to the motor controller through the transceiver 14 to complete the software upgrade of the motor controller.

[0082] The memory 13 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 13 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, and instructions for implementing the offline software flashing method provided in the above embodiment, etc.; the data storage area may store data involved in an offline software flashing method provided in the above embodiment, etc.

[0083] Optionally, the processing chip 12 is a single-chip microcomputer, the external memory card is an SD card, and the memory card communication interface may be an SPI interface or an SDIO interface.

[0084] Optionally, the offline upgrade device also includes a shell 11 and a button 15; a processing chip 12, a memory 13, a transceiver 14 and a button 15 are arranged in the shell 11; the button 15 is exposed on the outer surface of the shell 11, coupled to the processing chip 12, and is used to generate the flashing instruction.

[0085] For example, the shell 11 may include but is not limited to a rectangular parallelepiped, a cube, a cylinder and a polygon, and the specific shape may depend on the use environment of the offline software flashing device, user needs or paper manufacturing costs, etc. This embodiment does not limit this.

[0086] The offline software flashing device provided in this embodiment integrates the processing chip 12, the memory 13, the transceiver 14 and the button 15 in a housing 11 to form an independent device, which is easy to carry and low in cost. The processing chip 12 integrates the file system and the preset program, and can accurately read and parse the software files to be flashed in the memory 13 to ensure the integrity and correctness of the upgrade data. At the same time, the parsed software content to be flashed is safely transmitted to the motor controller through the transceiver 14 to ensure the reliability of the upgrade process. Furthermore, the flashing instruction is triggered by the button 15, and the operation process is more concise. In addition, the processing chip 12 communicates with the memory 13 and the transceiver 14 at high speed through the communication interface, which improves the software upgrade speed while ensuring the accurate transmission of the software files to be flashed, and has a certain flexibility.

[0087] Optionally, Figure 5 1 is a block diagram of the internal structure of an offline software flash writing device provided by an embodiment of the present invention. Figure 5 As shown, the processing chip 12 can communicate with the memory 13 through a communication interface. In order to enable the processing chip 12 to obtain the file package of the software file to be flashed in the memory 13, the offline software flashing device can provide a file system (for example, a FAT32 file system) for reading the file package of the software file to be flashed and a SPI (Serial Peripheral Interface) read and write driver function. Thus, the processing chip 12 can communicate with the memory 13, thereby reading the file package of the software file to be flashed stored therein.

[0088] It should be noted that the FAT32 file system is a widely used file system type that can support large-capacity storage, has good compatibility, and is easy to maintain. It is mainly used in storage devices such as hard disks, USB flash drives, and SD cards.

[0089] SPI is a synchronous serial communication protocol, commonly used for communication between microcontrollers and peripheral devices. SPI not only supports full-duplex communication and fast data transmission, but also has high communication efficiency due to its simple four-wire structure. It is widely used in the connection of peripherals such as sensors, memory, and display screens.

[0090] For example, the processing chip 12 can read the file package of the software file to be flashed from the memory 13 through the FAT32 file system. The file package of the software file to be flashed can be stored in the Intel HEX format. The processing chip 12 can parse the file package of the software file to be flashed, and analyze the coded content in the file package line by line to convert the coded content into actual binary data, that is, the software content to be flashed.

[0091] For example, the preset program includes a first program and a second program, the first program includes a file parsing program, and the second program includes a bootloader program. The file parsing program may include an Intel HEX file parsing program for parsing a file package of a to-be-flashed software file stored in the Intel HEX format; the bootloader program can obtain the to-be-flashed software content that needs to be flashed based on the parsed file package of the to-be-flashed software file.

[0092] For example, the Bootloader program can obtain the parsed file package of the software file to be flashed from the memory 13 to obtain the software content to be flashed, and call the relevant commands in the unified diagnostic service protocol to flash the software content to be flashed into the motor controller.

[0093] It should be noted that the Bootloader program is usually located in the memory of the embedded system and is used to load the operating system or other applications when the device starts. Its role in the embedded system is similar to that of the BIOS or UEFI of a computer, which is responsible for hardware initialization, loading the operating system or application, and supporting firmware upgrades and security functions.

[0094] For example, the processing chip 12 can communicate with the transceiver 14 via a UDS (Unified Diagnostic Services) communication protocol.

[0095] It should be noted that the UDS communication protocol is a communication protocol used for automotive electronic diagnosis. It can provide a series of command interfaces to help the Bootloader program complete the flashing task, such as: session mode switching service (0x10), used to switch to programming or diagnostic session mode, ready to enter the flashing process; routine service (0x31), used to check programming conditions to ensure that the motor controller can perform programming operations; security authentication service (0x27), used to perform security authentication to ensure that only authorized devices can perform flashing operations; request transmission service (0x34), used to send a transmission request, ready to receive the data in the file package of the software file to be flashed; transmission data service (0x36), used to gradually transfer the software data in the file package of the software file to be flashed to the motor controller; request exit service (0x37), used to exit the programming mode after the flashing is completed and return to normal operation.

[0096] For example, the transceiver 14 includes a TJA1051 CANFD (CAN with Flexible Data-Rate) transceiver, which can convert the CAN_Rx and CAN_Tx signals of the processing chip 12 into differential signals of the CAN bus. The TJA1051 CANFD transceiver can support a higher data rate to communicate with the processing chip 12 or the motor controller.

[0097] It should be noted that the TJA1051 CANFD transceiver is a type of CANFD transceiver that can support the CANFD protocol with a higher data rate and is compatible with the traditional CAN protocol. It has a low power consumption mode, high EMC performance and multiple fault protection functions, and is widely used in automotive electronics and industrial control systems.

[0098] For example, the offline software flashing device also includes an input pin 31 (Input Pin) and an output pin 32 (Output Pin). Among them, the input pin 31 is used to read the status of the button 15. For example, the user can start the flashing process by long pressing the button 15, triggering the Bootloader program to perform the corresponding operation. The output pin 32 is used to connect the indicator light, and the indicator light can display different states according to the different stages of the flashing process, such as the status of the initialization stage, the status of the standby stage, the status of flashing / flashing completed, and the status of the fault stage. Through the operating status of the indicator light, the user can intuitively understand the current status of the offline software flashing device.

[0099] The offline software flashing device provided by the present invention can realize a complete motor controller software upgrade solution by integrating the file system, communication protocol, hardware interface and user interaction, and has the characteristics of high efficiency, safety and easy operation.

[0100] Alternatively, if Figure 4 As shown, the transceiver 14 is disposed corresponding to the opening 17 on the housing 11 , and is coupled to the motor controller through the opening 17 ; the button 15 is exposed on the outer surface of the housing 11 .

[0101] For example, the transceiver 14 is arranged corresponding to the opening 17 on the housing 11, and the user can conveniently connect the transceiver 14 to the external motor controller through the opening 14. The button 15 is exposed on the outer surface of the housing 11, so that the user can directly operate the button 15 without opening or disassembling the housing 11, thereby improving the operability of the offline software flashing device, and the user can quickly start or control the flashing process, thereby enhancing the ease of use of the offline software flashing device.

[0102] The above method improves the convenience and reliability of the offline software flashing device, optimizes the user experience, ensures efficient operation in various environments, and provides effective protection for internal components.

[0103] Optionally, the first program in the processing chip 12 obtains a file package of the software file to be flashed from the memory 13 in response to the flash instruction, and parses the file package according to the software format of the software file to be flashed to obtain the software file to be flashed.

[0104] For example, the software format of the software file to be flashed is the Intel HEX software format. After the processing chip 12 reads the Intel HEX file from the memory 13, it can parse the software file to be flashed according to the encoding format corresponding to the Intel HEX software.

[0105] Optionally, the second program in the processing chip 12 responds to the flash instruction, sequentially reads part of the software content from the software file to be flashed, and writes part of the software content to the motor controller through the communication interface until all the software files to be flashed are written into the motor controller.

[0106] For example, before writing the software content, that is, before flashing the software file, the motor controller can also erase the original version of the software file to be flashed to avoid interference from old data and ensure data integrity and consistency.

[0107] Optionally, the offline software flashing device also includes a first indicator light 21, which is coupled to the processing chip 12; the processing chip 12 responds to the initialization instruction, reads the software files to be flashed in the memory 13 through the communication interface, and when it is determined that the number of software files to be flashed is 1, lights up the first indicator light 21; the first indicator light 21 is used to indicate that the offline software flashing device is in standby mode.

[0108] Through the indication of the first indicator light 21, the user can quickly determine whether the offline software flashing device is successfully on standby, which saves the user's waiting or checking time and improves the overall operation efficiency.

[0109] Optionally, the processing chip 12 responds to the flash instruction by sending a conditional detection command to the motor controller through the communication interface, and after receiving a programming permission response from the motor controller, requests the motor controller to enter a programming session mode, and after the motor controller requests to enter the programming session mode, performs security authentication on the motor controller, and after the security authentication passes, writes the software file to be flashed stored in the memory to the motor controller through the communication interface.

[0110] For example, in order to ensure that the current state of the motor controller is suitable for software upgrade, the processing chip 12 may first send a condition detection command to the motor controller through the communication interface to check the current state of the motor controller, such as electrical conditions (such as voltage, temperature, etc.) and operating status (such as whether it is in idle mode), etc., and accept the response from the motor controller that allows programming to confirm that the motor controller is suitable for software upgrade.

[0111] After the motor controller feeds back a response allowing programming, the processing chip 12 can request the motor controller to enter the programming session mode, and then the motor controller enters the programming session mode after receiving the request.

[0112] It should be noted that the programming session mode is a special operation mode in which the motor controller is ready to receive and process external upgrade commands without performing normal control tasks. The programming session mode can prevent software upgrade failures due to normal operation of the motor controller during the upgrade process.

[0113] Alternatively, if Figure 3 to Figure 4 As shown, the offline software flashing device also includes at least one of a second indicator light 22, a third indicator light 23 and a fourth indicator light 24. The second indicator light 22 is coupled to the processing chip 12 for indicating fault indication during the flashing process; the third indicator light 23 is coupled to the processing chip 12 for indicating that the offline software flashing device is initialized; the fourth indicator light 24 is coupled to the processing chip 12 for indicating that the offline software flashing device is in a flashing state.

[0114] For example, the processor can control the operating status of the second indicator light 22, the third indicator light 23, and the fourth indicator light 24 to prompt the user of the current status of the offline software flashing device. For example, the luminous colors corresponding to the second indicator light 22, the third indicator light 23, and the fourth indicator light 24 can be predefined to correspond the luminous colors to the status of the offline software flashing device. Thus, the corresponding indicator light can be controlled to emit light of the corresponding color based on the status of the offline software flashing device.

[0115] For example, the light color of the second indicator light 22 can be set to red, and when the second indicator light 22 emits red light, it indicates that the current offline software flashing device is in a fault state, thereby realizing fault indication during the flashing process; the light color of the third indicator light 23 can be set to yellow, and when the second indicator light 23 emits yellow light, it indicates that the initialization of the current offline software flashing device is complete; the light color of the fourth indicator light 24 can be set to green, and when the fourth indicator light 24 emits green light, it indicates that the current offline software flashing device is in a flashing state.

[0116] For example, the second indicator light 22 is coupled to the processing chip 12, and when problems such as data transmission error, communication failure or security authentication failure occur during the flashing process, the processing chip 12 can control the second indicator light 33 to turn on for fault indication.

[0117] For example, when the offline software flashing device is in a ready state but has not started flashing, the processing chip 12 can control the operating state of the third indicator light 23 to indicate that the offline software flashing device has been initialized, that is, the offline software flashing device is connected and can receive flashing instructions at any time.

[0118] For example, when the processing chip 12 starts to execute the flashing process, that is, reading the software file to be flashed from the memory and transmitting it to the motor controller through the communication interface, the processing chip 12 can control the operating status of the fourth indicator light 24 to indicate that the offline software flashing device is in the flashing state.

[0119] Optionally, an indicator light on the offline software flashing device is arranged on the outer surface of the housing 11 .

[0120] For example, the indicator lights on the offline software flashing device may include but are not limited to the first indicator light 21, the second indicator light 22, the third indicator light 23 and the fourth indicator light 24, which are not limited in the present invention.

[0121] Thus, the user can intuitively obtain the operating status of the indicator light, confirm the current status of the offline software flashing device, and respond in time.

[0122] Embodiment five:

[0123] In particular, according to an embodiment of the present invention, the process described in the above flowchart may be implemented as a computer software program.

[0124] The technical solution of the present invention, in essence, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, that is, the embodiment of the present invention also provides a computer-readable storage medium, which includes a number of computer programs or computer instructions, which are used to enable an electronic device (which can be a personal computer, server or network device, etc.) or a processor to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory, random access memory, disk or optical disk, etc., various media that can store program codes.

[0125] Embodiment six:

[0126] An embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer readable medium, the computer program including a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), various functions defined in the present invention are performed.

[0127] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will be appreciated by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. An offline software flashing method, characterized in that: include: The offline software flashing device reads the software file to be flashed stored in the external storage card; The offline software flash writing device determines a single analysis amount based on its own storage capacity; The offline software flashing device sequentially performs multiple parsing operations on the software file to be flashed based on the single parsing amount, and sequentially writes the software content to be flashed obtained from each parsing into the motor controller; Each parsing operation is performed after the software content to be flashed obtained from the last parsing is written into the motor controller.

2. The offline software flashing method according to claim 1, characterized in that: The offline software flashing device sequentially performs multiple parsing operations on the software file to be flashed based on the single parsing amount, and sequentially writes the software content to be flashed obtained from each parsing into the motor controller, comprising: When the parsed software content to be written includes a boot program, the offline software flashing device deletes the boot program from the software content to be written and then writes the software content to be written into the motor controller.

3. The offline software flashing method according to claim 1 or 2, characterized in that: Before the offline software flashing device sequentially performs multiple parsing operations on the to-be-flashed software file based on the single parsing amount and sequentially writes the to-be-flashed software content obtained by each parsing into the motor controller, the device further includes: The offline software flash writing device sends a security authentication request to the motor controller; After the offline software flashing device receives the authentication pass information returned by the motor controller, the offline software flashing device performs multiple parsing operations on the software file to be flashed based on the single parsing amount, and writes the software content to be flashed obtained from each parsing into the motor controller in sequence.

4. The offline software flashing method according to claim 3, characterized in that: After the offline software flash writing device sends a safety authentication request to the motor controller, the method further includes: The offline software flashing device receives a random number returned by the motor controller in response to the security authentication request; The offline software flash writing device performs security authentication calculation on the random number to obtain a first key; The offline software flashing device sends the first key to the motor controller, so that the motor controller returns the authentication pass information to the offline software flashing device after comparing the first key with the second key, wherein the second key is obtained by the motor controller performing a security authentication calculation on the random number.

5. The offline software flashing method according to claim 1 or 2, characterized in that: Before the offline software flash writing device reads the software file to be flashed stored in the external storage card, it also includes: If there is only one software file to be written in the external memory card, the step of the offline software writing device reading the software file to be written stored in the external memory card is executed.

6. The offline software flashing method according to claim 1 or 2, characterized in that: The offline software flashing device reads the software file to be flashed stored in the external storage card, including: If the external storage card stores a plurality of the software files to be flashed, the offline software flashing device reads the software file to be flashed with the latest storage time.

7. An offline software flashing device, characterized in that: include: A processing chip, a memory, a memory card communication interface and a transceiver: wherein the memory stores a computer program or computer instruction that can be loaded by the processing chip and execute the offline software flashing method according to any one of claims 1 to 6; The memory card communication interface is coupled to the processing chip and is used to implement communication between the offline software flash writing device and the external memory card; The transceiver is coupled to the processing chip and is used to implement communication between the offline software flashing device and the motor controller.

8. The off-line software flashing device according to claim 7, characterized in that: Also includes a housing and a button; The processing chip, the memory and the transceiver are all arranged in the housing; The button is exposed on the outer surface of the shell, coupled to the processing chip, and is used to generate a flashing instruction, so that the processing chip responds to the flashing instruction and performs a software flashing operation on the motor controller.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or computer instructions that can be loaded by a processor and execute the offline software flashing method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program or computer instructions, characterized in that When the computer program or the computer instruction is loaded and executed by the processor, the steps of the offline software flashing method according to any one of claims 1 to 6 are implemented.