A method, apparatus and related device for upgrading a power module

CN122963591APending Publication Date: 2026-10-23SHENZHEN WINLINE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611443529.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-17
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0004]本申请的目的是提供一种电源模块的升级方法、装置及相关设备,旨在解决在多个电源模块并机进行在线升级的场景下,通过广播方式向电源模块下发升级程序无法直接确定实际响应的电源模块是否与预先确定的待升级的电源模块一致,导致升级程序下发前缺少对升级对象的一致性确认,容易影响目标电源模块升级的准确性

Benefits of technology

本申请提供了一种电源模块的升级方法、装置及相关设备,应用于充电桩升级系统中的主控制器,首先接收上位机发送的升级报文;其中升级报文包括模块升级清单和升级程序;模块升级清单记录待升级电源模块的第一模块地址;接着,向并机的多个电源模块广播升级请求报文;并获取多个电源模块分别响应升级请求报文而上送的应答报文;然后,根据第一模块地址和第二模块地址进行地址匹配,得到地址匹配结果;最后,在地址匹配结果表征第一模块地址与第二模块地址全部匹配时,以广播地址向多个待升级电源模块发送升级程序,以使多个待升级电源模块并行接收升级程序并完成升级。如此,通过将预先确定的待升级电源模块的第一模块地址与实际响应升级请求的电源模块的第二模块地址进行匹配,能够在升级程序下发之前对实际响应的电源模块进行升级对象一致性确认,并仅在所述第一模块地址与所述第二模块地址全部匹配时向多个待升级电源模块广播发送升级程序,从而避免非目标电源模块接收升级程序,并降低待升级电源模块遗漏的可能性,提高多电源模块在线升级的准确性。同时,通过广播方式向多个待升级电源模块发送同一升级程序,使多个待升级电源模块能够并行接收所述升级程序,减少针对不同电源模块重复进行升级程序下发所产生的通信过程,从而减少多模块在线升级过程中的重复数据传输时间,提高多电源模块并行升级的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122963591A_ABST
    Figure CN122963591A_ABST
Patent Text Reader

Abstract

The application provides an upgrading method and device of a power supply module and related equipment, and belongs to the field of upgrading of charging pile power supply modules. The method comprises the following steps: receiving an upgrading message sent by an upper computer; wherein the upgrading message comprises a module upgrading list and an upgrading program; the module upgrading list records a first module address of a power supply module to be upgraded; then, an upgrading request message is broadcasted to multiple power supply modules connected in parallel; and response messages sent by the multiple power supply modules in response to the upgrading request message are obtained; then, address matching is performed according to the first module address and a second module address, and an address matching result is obtained; finally, when the address matching result indicates that the first module address and the second module address are all matched, the upgrading program is sent to the multiple power supply modules to be upgraded in parallel through a broadcast address, so that the multiple power supply modules to be upgraded can receive the upgrading program in parallel and complete the upgrading. The accuracy and efficiency of parallel upgrading of multiple power supply modules can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power charging technology, and in particular to a method, apparatus and related equipment for upgrading a power module. Background Technology

[0002] Currently, upgrade solutions for charging pile power modules typically involve upgrading each module individually online to remotely update the program code within the module. This approach requires the host computer to establish communication with each power module individually and sequentially transmit and verify the upgrade data. In scenarios where multiple power modules are connected in parallel and require upgrades, upgrading each module individually increases the overall upgrade time, thus impacting upgrade efficiency. Current solutions involve broadcasting upgrade programs to power modules, allowing all charging pile power modules to receive the programs simultaneously for online upgrades, thereby improving upgrade efficiency. However, broadcast upgrades cannot directly determine whether the actual responding power module matches the pre-determined upgrade target, resulting in a lack of consistency confirmation before the upgrade program is sent, potentially affecting the accuracy of the target power module upgrade.

[0003] Therefore, improving the accuracy and efficiency of upgrading multiple power modules in charging piles is an urgent issue that needs to be addressed. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, and related equipment for upgrading power modules, aiming to solve the problem that in scenarios where multiple power modules are upgraded online in parallel, the upgrade program is broadcast to the power modules, which cannot directly determine whether the actual responding power module is consistent with the pre-determined power module to be upgraded. This results in a lack of consistency confirmation of the upgrade target before the upgrade program is sent, which can easily affect the accuracy of the target power module upgrade.

[0005] To achieve the objectives of this application, the following solution is provided: In a first aspect, embodiments of this application provide a method for upgrading a power module, applied to the main controller of a charging pile upgrade system, the method comprising: Receive upgrade messages sent by the host computer; the upgrade message includes a module upgrade list and an upgrade program; the module upgrade list records the first module addresses corresponding to multiple power modules to be upgraded; Broadcast upgrade request messages to multiple power modules that are connected in parallel; and obtain the response messages sent by the multiple power modules in response to the upgrade request messages; the response messages carry the second module addresses of the multiple power modules; Address matching is performed based on the first module address and the second module address to obtain the address matching result; When the address matching result indicates that the addresses of the first module and the second module match completely, the upgrade program is broadcast to the plurality of power modules to be upgraded, so that the plurality of power modules to be upgraded can receive the upgrade program in parallel and complete the upgrade.

[0006] Secondly, this application provides a power module upgrade device, applied to the main controller of a charging pile upgrade system, the device comprising: The receiving module is used to receive upgrade messages sent by the host computer; the upgrade message includes a module upgrade list and an upgrade program; the module upgrade list records the first module addresses corresponding to multiple power modules to be upgraded; The sending module is used to broadcast upgrade request messages to multiple power modules connected in parallel; and to obtain response messages sent by the multiple power modules in response to the upgrade request messages; the response messages carry the second module addresses of the multiple power modules. The matching module is used to perform address matching based on the address of the first module and the address of the second module to obtain the address matching result; The control module is configured to broadcast the upgrade program to the plurality of power modules to be upgraded when the address matching result indicates that the addresses of the first module and the second module match completely, so that the plurality of power modules to be upgraded receive the upgrade program in parallel and complete the upgrade.

[0007] Thirdly, this application provides a controller, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing steps in any of the methods of the first aspect of the embodiments of this application.

[0008] Fourthly, this application provides a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in any of the methods of the first aspect of the embodiments of this application.

[0009] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program being operable to cause a computer to perform some or all of the steps described in any method of the first aspect of embodiments of this application.

[0010] By implementing the embodiments of this application, the following beneficial effects can be achieved: This application provides a method, apparatus, and related equipment for upgrading power modules. Applied to the main controller in a charging pile upgrade system, the method first receives an upgrade message sent by a host computer. The upgrade message includes a module upgrade list and an upgrade program. The module upgrade list records the first module address of the power module to be upgraded. Next, an upgrade request message is broadcast to multiple power modules connected in parallel. The method then obtains response messages sent by the multiple power modules in response to the upgrade request message. Next, address matching is performed based on the first module address and the second module address to obtain the address matching result. Finally, when the address matching result indicates that the first module address and the second module address match completely, the upgrade program is sent to the multiple power modules to be upgraded using the broadcast address, so that the multiple power modules to be upgraded receive the upgrade program in parallel and complete the upgrade. Thus, by matching the pre-determined first module address of the power module to be upgraded with the second module address of the power module actually responding to the upgrade request, the consistency of the upgrade target can be confirmed before the upgrade program is issued. The upgrade program is broadcast to multiple power modules to be upgraded only when both the first and second module addresses match, thereby preventing non-target power modules from receiving the upgrade program and reducing the possibility of missing upgrade modules, thus improving the accuracy of online upgrades for multiple power modules. Simultaneously, broadcasting the same upgrade program to multiple power modules allows them to receive the upgrade program in parallel, reducing the communication process caused by repeatedly issuing upgrade programs to different power modules. This reduces the time spent on repetitive data transmission during online upgrades and improves the efficiency of parallel upgrades for multiple power modules. Attached Figure Description

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

[0012] Figure 1 This is an architecture diagram of a charging pile upgrade system provided in an embodiment of this application; Figure 2 This is a hardware architecture diagram of a main controller provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a controller provided in an embodiment of this application; Figure 4 This is a flowchart illustrating a power module upgrade method provided in an embodiment of this application; Figure 5 This is a schematic diagram of an upgrade data temporary storage and migration process provided in an embodiment of this application; Figure 6 This is a schematic diagram of the CPU and CLA processing flow for an online power module upgrade upon startup, provided in an embodiment of this application. Figure 7 This is a flowchart illustrating another power module upgrade method provided in an embodiment of this application; Figure 8 This is a functional module block diagram of a power module upgrade device provided in an embodiment of this application. Detailed Implementation

[0013] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0014] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0015] It should be understood that the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document indicates that the preceding and following related objects are in an "or" relationship. In the embodiments of this application, "multiple" refers to two or more.

[0016] In the embodiments of this application, "at least one item" or its similar expression refers to any combination of these items, including any combination of a single item or a plurality of items. "One or more" means one or more, while "multiple" means two or more. For example, "at least one item" of a, b, or c can represent the following seven cases: a, b, c; a and b; a and c; b and c; a, b, and c. Each of a, b, and c can be an element or a set containing one or more elements.

[0017] In this application, the term "connection" refers to various connection methods, such as direct connection or indirect connection, to achieve communication between devices. This application does not impose any limitations on this.

[0018] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0019] The following is an explanation of the relevant terms used in this application: DSP: Digital Signal Processor. In this embodiment, the DSP is a TI C2000 series control DSP (often also called a real-time control MCU) for power electronics, used in a charging / bidirectional DC-DC power module to realize power control, CAN communication, FLASH program storage, and online firmware upgrades.

[0020] CLA: Control Law Accelerator. It is a programmable 32-bit floating-point coprocessor inside the DSP chip, with independent pipelines, registers, and buses. It can run programs in parallel with the CPU and belongs to a heterogeneous dual-core architecture.

[0021] CRC checksum: Cyclic Redundancy Check. CRC checksum is a data integrity verification algorithm. The sending end performs a CRC operation on the original binary data to generate a fixed-length CRC checksum, which is sent along with the original data. The receiving end performs the exact same CRC operation on the received data and compares the resulting checksum with the received checksum.

[0022] Please see Figure 1 , Figure 1 This is an architecture diagram of a charging pile upgrade system provided in an embodiment of this application. The charging pile upgrade system 100 includes a host computer 110, a CAN bus 120, and a power module 130.

[0023] The host computer 110 is used to send online upgrade request messages, upgrade program data packets, and online upgrade completion instructions to the power module 130 via the CAN bus 120, and to receive response messages returned by the power module 130 in response to the online upgrade request messages and upgrade program data packets. The CAN bus 120 is used to receive or send data transmitted by the host computer 110 in the power upgrade scenario, and to send address confirmation information sent by the power module 130. In some embodiments, the main controller 131 is mounted on the power module 130, which includes a first charging module, a second charging module, ..., an Nth charging module. The first charging module, the second charging module to the Nth charging module are respectively connected to the main controller 131, so that multiple charging modules in the power module 130 can receive online upgrade messages sent by the host computer 110 in parallel via the CAN bus 120, and the main controller 131 can return corresponding response messages to the host computer 110 via the CAN bus 120. Furthermore, when upgrading multiple charging modules simultaneously, the host computer 110 can set the destination address of the online upgrade request message to a broadcast address and send the request message to the main controller 131 via the CAN bus 120. Simultaneously, after receiving the online upgrade request message, the first, second, through Nth charging modules can generate corresponding response messages and return them to the CAN bus 120 via the main controller 131. These response messages are then transmitted to the host computer 110 via the CAN bus 120. The response messages include the source address of the corresponding charging module, allowing the host computer 110 to determine whether all the power modules 130 to be upgraded have responded based on the source addresses in each response message.

[0024] In some embodiments, after the host computer 110 determines that all power modules 130 to be upgraded have responded, it can continue to send upgrade program data packets via broadcast. Upon receiving the upgrade program data packets, each power module 130 performs data verification and returns the corresponding verification result to the host computer 110, allowing the host computer 110 to determine whether to continue sending the next upgrade program data packet based on the response messages returned by each charging module. Furthermore, after all upgrade program data packets have been transmitted, the host computer 110 can broadcast an online upgrade completion command to the main controller 131 mounted on the power module 130 via the CAN bus 120, enabling the power module 130 to perform subsequent upgrade processing according to the online upgrade completion command.

[0025] As can be seen, by setting up the host computer 110, the CAN bus 120, and the power module 130 including the first to Nth charging modules, a parallel communication architecture is formed between the host computer 110 and the power module 130. This allows the host computer 110 to simultaneously interact with multiple charging modules via the CAN bus 120 to exchange upgrade message information. Furthermore, by broadcasting upgrade-related messages to multiple charging modules and having the host computer 110 confirm the power module 130 to be upgraded one by one based on the source address in the response message returned by each charging module, multiple charging modules can be upgraded online in the same upgrade process. This reduces the time required for upgrading multiple charging modules separately and improves the efficiency of charging pile upgrades.

[0026] Please continue reading. Figure 2 , Figure 2 This is a hardware architecture diagram of a main controller provided in an embodiment of this application. As can be seen, the main controller 131 includes a CLA31, a CPU32, and a FLASH space 33. The CLA31 and CPU32 interact with each other, and the CPU32 is connected to the FLASH space 33. Specifically, the CPU32 is used to run the charging main program and is responsible for receiving and sending upgrade messages during the online upgrade process, as well as writing the received upgrade program data into the FLASH space 33. The CLA31 is used to parse and verify the upgrade messages received by the CPU32, and load the reply information to be sent according to the parsing and verification results, so that the CPU32 can send the reply information to the host computer. The FLASH space 33 is used to store the received upgrade program data. In one possible embodiment, the FLASH space 33 includes a program segment for storing the currently running program and a code temporary storage segment for temporarily storing upgrade program data. After receiving the upgrade program data sent by the host computer, the CPU 32 can first write the upgrade program data into the code temporary storage segment instead of directly erasing or writing the currently running program in the program segment. After all upgrade program data has been received and passed CRC verification, the upgrade program data in the code temporary storage segment is then migrated to the program segment.

[0027] It can be seen that by setting up CLA31, CPU32 and FLASH space 33 in the main controller 131, and utilizing the data interaction between CLA31 and CPU32, CPU32 can perform online upgrade-related data receiving, sending and storage operations while running the charging main program, and CLA31 performs the parsing and verification of upgrade messages, thus providing a basis for the parallel operation of the charging program and the online upgrade program. At the same time, by setting up a storage space in FLASH space 33 for temporarily storing upgrade program data, the current running program can be directly erased and rewritten during the upgrade data receiving process, thereby reducing the risk of interruption during the upgrade process affecting the original running program.

[0028] The following is combined Figure 3 The controller in the embodiments of this application will be described. Figure 3 This is a schematic diagram of the structure of a controller provided in an embodiment of this application, such as... Figure 3 As shown, the controller 300 includes one or more processors 310, a memory 320, a communication interface 330, and one or more programs 321. The processor 310 is communicatively connected to the memory 320 and the communication interface 330 through an internal communication bus.

[0029] The one or more programs 321 are stored in the memory 320 and configured to be executed by the processor 310. The one or more programs 321 include instructions for performing any step in the above method embodiments.

[0030] The processor 310 can be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, cells, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The communication unit can be a communication interface, transceiver, transceiver circuitry, etc., and the storage unit can be a memory.

[0031] The memory 320 can be volatile memory or non-volatile memory, or it can include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0032] It is understood that the controller 300 may include more or fewer structural elements than those shown in the block diagram above, such as a power module, physical buttons, a Wi-Fi module, a speaker, a Bluetooth module, sensors, a display module, etc., without limitation. It is also understood that the controller 300 may be equipped with... Figure 1 The architecture of the charging pile upgrade system.

[0033] After understanding the software and hardware architecture of this application, the following will be combined with... Figure 4 An upgrade method for a power module according to an embodiment of this application will be described. Figure 4 This is a flowchart illustrating a power module upgrade method provided in an embodiment of this application. The method is applied to the main controller of a charging pile upgrade system and specifically includes the following steps: Step S401: Receive an upgrade message sent by the host computer; the upgrade message includes a module upgrade list and an upgrade program; the module upgrade list records the first module address corresponding to multiple power modules to be upgraded.

[0034] The module upgrade list indicates the power modules targeted for this online upgrade, and the first module address represents the address identifier of the power module to be upgraded in the parallel communication system. By simultaneously including the module upgrade list and the upgrade program in the upgrade message, the controller can obtain the target object information corresponding to this upgrade upon receiving the upgrade program, enabling subsequent multi-module online upgrades based on broadcast methods.

[0035] Specifically, during online power module upgrades, the host computer generates an upgrade message based on the user-selected upgrade targets and sends the message to the main controller of the charging pile upgrade system. The host computer can generate a module upgrade list based on the address information of the power modules to be upgraded, recording the first module addresses corresponding to each of the multiple power modules in the upgrade list. For example, when multiple power modules are operating in parallel, the user can select multiple modules as the upgrade targets. The host computer forms a module upgrade list based on the module addresses of the selected power modules and encapsulates the upgrade list and the upgrade program to be sent into the upgrade message. Simultaneously, the host computer directly sends broadcast messages to 1-N charging modules via the CAN bus.

[0036] It should be noted that this embodiment does not directly upgrade all power modules in parallel operation according to the upgrade procedure. Instead, it first clarifies the target module range for this upgrade through a module upgrade list. This is because in a multi-module parallel communication scenario, when using broadcast messages for upgrades, the broadcast messages can be received by multiple parallel power modules in the communication network. Therefore, simply sending upgrade requests via broadcast cannot directly confirm whether all power modules that actually respond to the upgrade requests belong to the pre-selected upgrade targets. Based on this, a module upgrade list recording the first module addresses of multiple power modules to be upgraded is obtained in advance. This allows for subsequent matching of the addresses of power modules that actually respond to upgrade requests with the pre-determined first module addresses. Upgrade procedure transmission continues only when the target addresses match, thereby improving the efficiency of multi-module upgrades while effectively confirming the upgrade targets.

[0037] Step S402: Broadcast upgrade request messages to multiple power modules connected in parallel; and obtain the response messages sent by the multiple power modules in response to the upgrade request messages; the response messages carry the second module addresses of the multiple power modules.

[0038] The upgrade request message triggers multiple power modules connected in parallel to enter online upgrade mode. The second module address represents the address information of the power module that actually responds to the upgrade request message. By broadcasting the upgrade request message, the multiple power modules communicating in parallel can simultaneously receive the upgrade request message and return a response message carrying their own second module address. This allows the host computer to obtain the information of the power modules that actually participated in the online upgrade process through the main controller.

[0039] Specifically, after obtaining the module upgrade list and the corresponding first module address, the destination address of the upgrade request message is set as the broadcast address, and it is broadcast to multiple power modules through the parallel communication link. Since the upgrade request message is sent via broadcast, all power modules within the parallel communication range can receive it. Upon receiving the upgrade request message, each power module enters an online upgrade state and sends a response message via the CAN bus through the main controller. Each power module's response message carries its own second module address, enabling it to obtain the address information of the multiple power modules that actually responded to the upgrade request message based on the received response messages. Furthermore, the received response messages can be obtained one by one, and the corresponding second module address can be extracted from each response message to form a set of address information for the actual responding power modules. When the main controller receives the response messages sent by multiple power modules, it can determine the power modules that have responded to the upgrade request message and their corresponding addresses. For power modules that fail to return response messages in a timely manner, the host computer can continue to wait for their response until the expected number of response messages are received or the communication timeout mechanism is triggered.

[0040] It can be seen that by sending the upgrade request message in a broadcast manner and obtaining the second module address of the actual responding module through the response message, multiple parallel power modules can simultaneously enter the online upgrade state, avoiding the repetitive communication process caused by upgrading power modules one by one, thus providing a communication basis for multi-module parallel upgrades. On the other hand, the set of power modules that actually respond to the upgrade request can be obtained through the second module address carried in the response message, providing a basis for subsequent address matching of the actual responding power modules with the pre-determined power modules to be upgraded, thereby improving the efficiency of multi-module online upgrades and enhancing the accuracy of confirming the upgrade target.

[0041] In one optional embodiment, obtaining the response messages sent by the plurality of power modules in response to the upgrade request message includes: extracting a plurality of second module addresses corresponding to the plurality of power modules from the upgrade request message; establishing a first response address record based on the received response messages and the plurality of second module addresses; when a new response message is received, adding the second module address corresponding to the new response message to the first response address record to obtain a second response address record; determining the number of target power modules corresponding to the received response messages based on the second response address record; and determining that response messages corresponding to the plurality of power modules to be upgraded have been received when the number of target power modules is the same as the number of the plurality of power modules to be upgraded.

[0042] The first response address record and the second response address record are used to record the address of the second module corresponding to the response message that has been received. The number of target power modules represents the number of different power modules that have responded to the upgrade request message.

[0043] Specifically, firstly, after broadcasting upgrade request messages to multiple power modules connected in parallel, the system receives upgrade request messages from each power module in response to the upgrade request message, and extracts the corresponding second module address from the upgrade request message to obtain the address information of the power module that actually responded to the upgrade request. Next, a first response address record is established based on the second module address corresponding to the currently received response message to record the power modules that have responded to the upgrade request. Then, when a new response message is received, the corresponding second module address is extracted from the new response message and added to the existing first response address record to form a second response address record. At the same time, the number of target power modules that have responded to the upgrade request is determined based on the unique second module addresses in the second response address record. Finally, the number of target power modules is compared with the number of power modules to be upgraded recorded in the module upgrade list. When the two are the same, it indicates that the multiple predetermined power modules to be upgraded have responded to the upgrade request message, thus determining that the response messages corresponding to the multiple power modules to be upgraded have been received, and the subsequent upgrade procedure transmission process begins. It should be noted that determining whether a response message has been received completely is not based solely on the number of received response messages, but rather on the second module address carried in the response message to determine the number of different power modules that have responded.

[0044] It can be seen that by establishing and continuously updating the response address record, and counting the actual number of power modules responding based on the unique second module address, it is possible to accurately determine whether multiple power modules to be upgraded have completed the upgrade request response, thereby avoiding the duplicate counting problem caused by judging solely based on the number of messages. Only when the number of target power modules is consistent with the number of power modules to be upgraded is it determined that the response message has been received completely and enters the subsequent upgrade procedure transmission stage, so that a continuous time sequence relationship is formed between the upgrade request response, upgrade object confirmation, and upgrade procedure transmission, improving the reliability of upgrade object identification and communication status judgment during the online upgrade of multiple modules.

[0045] In an optional embodiment, the method further includes: when the number of target power modules is less than the number of multiple power modules to be upgraded, starting a communication timeout timer and continuing to receive response messages sent by the multiple power modules; upon receiving a new response message, updating the second response address record according to the second module address corresponding to the new response message to obtain a third response address record; determining the number of power modules that have responded according to the non-repeating second module addresses in the third response address record to obtain a first power module number; if the communication timeout timer is greater than a preset timeout duration threshold and the number of the first power modules is less than the number of multiple power modules to be upgraded, then outputting an upgrade exception and receiving an upgrade communication exception instruction generated by the host computer based on the upgrade exception; interrupting the transmission of the upgrade program according to the upgrade communication exception instruction to perform a reset on the multiple power modules to be upgraded; if the communication timeout timer is less than or equal to the timeout duration threshold and the number of the first power modules is less than the number of multiple power modules to be upgraded, then continuing to receive response messages sent by the multiple power modules.

[0046] The communication timeout timer is used to time the waiting time for the host computer to receive response messages from multiple power modules to be upgraded. The preset timeout threshold indicates whether the current communication wait exceeds the allowed communication wait time. Preferably, the timeout threshold is set to 500ms. The third response address record is used to record the second module address corresponding to the response message received during the continued waiting process. The first power module number indicates the number of different power modules that have completed the response.

[0047] Specifically, firstly, the number of target power modules that have responded is determined based on the established second response address record, and this number is compared with the number of power modules to be upgraded recorded in the module upgrade list. When the number of target power modules is less than the number of power modules to be upgraded, it indicates that there are still power modules to be upgraded that have not returned response messages. At this time, a communication timeout timer is started, and the system continues to listen for and receive response messages sent by the parallel power modules. Next, if a new response message is received before the communication timeout timer expires, the corresponding second module address is extracted from the new response message, and the second module address is updated in the existing second response address record to obtain a third response address record. Then, the number of power modules that have responded is recounted based on the unique second module addresses in the third response address record to obtain the first power module number, and it is determined whether the first power module number has reached the number of power modules to be upgraded. If not, the system continues to wait for and receive new response messages. Finally, if the number of first power modules is still less than the number of multiple power modules to be upgraded when the communication timeout timer reaches the timeout duration threshold, it is determined that there is an upgrade communication anomaly. The upgrade communication anomaly is output to the host computer, and the subsequent upgrade program transmission is interrupted. At the same time, the multiple power modules to be upgraded that have entered the upgrade state are reset to end the current abnormal online upgrade process. If the communication timeout timer has not yet reached the preset timeout duration threshold, the process of receiving response messages and updating address records continues until response messages from all power modules to be upgraded are received or a communication timeout is triggered.

[0048] It can be seen that by introducing a communication timeout mechanism when not all power modules to be upgraded respond, the controller can distinguish between normal communication delays and communication anomalies: it continues to wait and dynamically updates the response address record before the preset timeout period is reached, so as to avoid premature interruption of the upgrade due to temporary communication delays; if no response is received from all power modules to be upgraded after the preset timeout period is reached, the upgrade communication is promptly determined to be abnormal and the upgrade is interrupted and the relevant power modules are reset, thereby avoiding the continued issuance of the upgrade program when the response status of the upgrade target is incomplete, improving the communication reliability and security in abnormal situations during the online upgrade process of multiple modules.

[0049] Step S403: Perform address matching based on the first module address and the second module address to obtain the address matching result.

[0050] The address matching result indicates whether there is a correspondence between multiple first module addresses and multiple second module addresses.

[0051] Specifically, the target address set corresponding to this online upgrade is determined based on the multiple first module addresses recorded in the module upgrade list, and the actual response address set is determined based on the second module addresses carried in the multiple received response messages. Further, the target address set and the response address set are compared to determine if the addresses in the two address sets can be matched one-to-one. When each second module address in the response address set corresponds to a first module address in the target address set, and there are no second module addresses outside the target address set, it is determined that all first and second module addresses match, and an address matching result indicating successful address matching is obtained. Conversely, when a first module address does not have a corresponding second module address, or when there is a second module address outside the target address set in the response address set, it is determined that the address matching has failed. For example, if the module upgrade list records first module addresses A1, A2, and A3, and the actual received response messages carry second module addresses A1, A2, and A3 respectively, it indicates that the power module actually responding to the upgrade request is consistent with the pre-determined power module to be upgraded, and in this case, the address matching can be determined to be successful. If the actual received second module addresses are A1, A2, and A4, then since A3 did not receive a corresponding response and A4 is not the pre-determined address of the module to be upgraded, the address matching is determined to be unsuccessful.

[0052] As can be seen, by matching the addresses of the first and second modules before broadcasting the upgrade program, the upgrade targets predetermined by the host computer can be associated with the power modules that actually respond to the upgrade request. This one-to-one correspondence excludes unselected power modules from participating in the upgrade. When the address match is successful, it indicates that the power module currently responding to the upgrade request matches the expected upgrade target, providing a reliable basis for the subsequent broadcasting of the upgrade program. When the address match fails, it avoids continuing to transmit the upgrade program without valid confirmation of the upgrade target, thereby reducing the risk of the upgrade program being incorrectly sent to a non-target power module and improving the accuracy of the multi-module parallel online upgrade process.

[0053] In an optional embodiment, the step of performing address matching based on the first module address and the second module address to obtain an address matching result includes: determining a target address set based on the first module address; and determining a response address set based on the second module address; determining an address matching relationship between the target address set and the response address set; determining an address correspondence status between the first module address and the second module address based on the address matching relationship; if the address correspondence status indicates that the addresses in the target address set and the response address set are in one-to-one correspondence, and there is no second module address in the response address set other than the target address set, then the address matching result is determined to be an address matching success; if the address correspondence status indicates that the target address set and at least one address in the response address set are not in correspondence, or there is a second module address in the response address set other than the target address set, then the address matching result is determined to be an address matching failure.

[0054] The target address set represents the set of first module addresses corresponding to multiple pre-selected power modules to be upgraded, as determined by the module upgrade list. The response address set represents the set of second module addresses corresponding to multiple power modules that actually respond to the upgrade request message. The address matching relationship represents the correspondence between the first module addresses in the target address set and the second module addresses in the response address set. The address correspondence status represents whether the addresses in the two address sets satisfy the correspondence relationship. By simultaneously determining whether the addresses correspond one-to-one and whether there are second module addresses in the response address set that are not in the target address set, the completeness and accuracy of the power modules that actually respond to the upgrade request can be confirmed.

[0055] Specifically, firstly, the system retrieves the first module addresses corresponding to multiple power modules to be upgraded from the module upgrade list and forms a target address set from these first module addresses. Simultaneously, it extracts the second module addresses corresponding to each power module from the received response messages and establishes a response address set based on these second module addresses. Next, it compares the first module addresses in the target address set with the second module addresses in the response address set one by one to determine the address matching relationship between the two address sets and to determine the address correspondence status based on whether a correspondence can be established between the addresses. Then, based on the address correspondence status, it determines whether each first module address in the target address set can find a corresponding second module address in the response address set, and further determines whether there are any second module addresses outside the target address set in the response address set. When the addresses in the target address set and the response address set can be matched one-to-one, and there are no second module addresses outside the target address set in the response address set, the address matching is considered successful. Finally, if at least one first module address in the target address set does not have a corresponding second module address, or if there is a second module address in the response address set that does not belong to the target address set, the address matching is considered unsuccessful, and the subsequent broadcast transmission of the upgrade procedure is not executed. For example, if the module upgrade list determines that the addresses of the power modules to be upgraded are A1, A2, and A3, then A1, A2, and A3 can be used to form the target address set. If the received response messages carry A1, A2, and A3 respectively, then the response address set corresponds one-to-one with the addresses in the target address set, and there are no extra addresses; in this case, the address matching is considered successful. If the received response messages carry A1, A2, and A4 respectively, then although the number of response addresses is the same as the number of target addresses, A3 does not receive a corresponding response, and A4 is an address outside the target address set; therefore, the address matching is considered unsuccessful.

[0056] It can be seen that by constructing a target address set representing the expected upgrade object and a response address set representing the actual response object, and simultaneously performing one-to-one correspondence verification and additional address detection on the two address sets, misjudgments caused by judging the upgrade object solely based on the number of responses can be avoided. Only when the two address sets completely correspond and there are no non-target module addresses is the upgrade program transmission phase allowed. This establishes a clear and complete correspondence between the expected upgrade object and the actual power modules participating in the upgrade, reducing the risk of the upgrade program being erroneously sent to non-target power modules and improving the accuracy and reliability of upgrade object confirmation during multi-module broadcast online upgrades.

[0057] Step S404: When the address matching result indicates that the addresses of the first module and the second module match completely, the upgrade program is broadcast to the plurality of power modules to be upgraded, so that the plurality of power modules to be upgraded receive the upgrade program in parallel and complete the upgrade.

[0058] In cases where the addresses of the first and second modules match, it indicates that the power module that actually responds to the upgrade request is consistent with the upgrade target determined in the module upgrade list. At this time, the data transmission phase of the upgrade process is allowed to proceed. The upgrade process uses a broadcast method to send data to multiple power modules to be upgraded, so that multiple power modules to be upgraded can receive upgrade data in parallel based on the same broadcast transmission process.

[0059] Specifically, after confirming that the addresses of the first and second modules fully match, the destination address of the upgrade program is set as the broadcast destination address, and the upgrade program is broadcast to multiple power modules to be upgraded via the parallel communication link. Each power module to be upgraded, upon receiving the broadcast upgrade program, processes the received upgrade data and returns a corresponding reply message to indicate its reception and verification status of the upgrade data. The transmission status of the upgrade program is determined based on the reply messages returned by the multiple power modules to be upgraded. After all power modules to be upgraded have completed the reception and verification of their respective upgrade data, subsequent upgrade data is transmitted until the entire upgrade program is transmitted. Subsequently, an online upgrade completion command is broadcast, enabling each power module to complete the subsequent upgrade processing according to the received complete upgrade program, and then reset and run a new program after the upgrade is complete.

[0060] As can be seen, by using the address matching result as the execution condition for broadcasting the upgrade program, a seamless control relationship is established between the confirmation of the upgrade target and the transmission of the upgrade program. After confirming that the actual response module matches the preset module to be upgraded, the upgrade program is transmitted to multiple target power modules simultaneously using the broadcast communication mechanism. This avoids the redundant communication overhead of transmitting the upgrade program to each power module individually, improving the parallel processing efficiency of multi-module online upgrades. Furthermore, it allows for upgrade target confirmation before the upgrade program is transmitted, reducing the possibility of non-target power modules receiving the upgrade program, thus balancing the efficiency and reliability of multi-module online upgrades.

[0061] In one optional embodiment, broadcasting the upgrade program to the plurality of power modules to be upgraded includes: determining the broadcast destination address of the upgrade program; broadcasting the upgrade program to the plurality of power modules to be upgraded according to the broadcast destination address; obtaining a plurality of reply messages from the plurality of power modules to be upgraded in response to the upgrade program; determining the transmission status of the plurality of power modules to be upgraded according to the plurality of reply messages; and determining that the upgrade program transmission is complete when the transmission status indicates that the upgrade program transmission is normal.

[0062] The broadcast destination address represents the target address corresponding to the broadcast transmission of the upgrade program. The transmission status represents the reception and verification status of the upgrade program by multiple power modules to be upgraded. The reply message is used to provide feedback on the processing result of the upgrade program by the corresponding power module to be upgraded. By using the broadcast destination address to send the upgrade program, multiple power modules to be upgraded can simultaneously receive the same upgrade data and use the reply messages returned by each power module to confirm the transmission status of the upgrade program.

[0063] Specifically, firstly, after confirming that the addresses of the first and second modules all match, the destination address of the upgrade program is determined as the broadcast destination address, so that the upgrade program can be received simultaneously by multiple power modules to be upgraded. Next, the upgrade program is broadcast to multiple power modules to be upgraded according to the broadcast destination address. After receiving the upgrade program, each power module to be upgraded verifies the received upgrade data and generates a corresponding reply message based on the verification result. Then, it receives the reply messages sent by each power module to be upgraded and determines the transmission status of each power module to be upgraded based on the reception and verification results in each reply message. Finally, when the reply messages returned by multiple power modules to be upgraded all indicate that the upgrade program reception and verification are normal, the current upgrade program transmission is determined to be normal, and the upgrade program transmission is determined to be complete. If any power module to be upgraded returns a reply message indicating reception abnormality or verification error, the upgrade program transmission is determined to be abnormal, and the current upgrade process is interrupted. It should be noted that the completion of transmission in this embodiment does not only indicate that the data transmission of the upgrade program has been completed, but also requires confirmation of the reception status of the upgrade program by combining the reply messages returned by multiple power modules to be upgraded. The host computer sends the data packets of the upgrade program in a broadcast manner. After each module receives the data packet, it verifies the data. If the verification is correct, the data is written into memory and a normal reply is sent. After receiving the module's reply, the host computer reads the reply content. Only when the reply is normal will it continue to send subsequent data packets. If there is a verification error, the online upgrade is interrupted and the module program is reset.

[0064] It can be seen that by setting the upgrade program to the broadcast destination address and broadcasting it to multiple power modules to be upgraded, multiple power modules can receive the upgrade program in parallel during the same communication process, reducing the repetitive communication process caused by sending upgrade data to each module individually; at the same time, by obtaining the reply messages returned by multiple power modules to be upgraded respectively, the actual reception and verification status of the upgrade program is confirmed, so that the controller can confirm the transmission is complete only after confirming that multiple power modules to be upgraded have received the upgrade data normally, thereby improving the reliability of data reception.

[0065] In an optional embodiment, broadcasting the upgrade program to the plurality of power modules to be upgraded according to the broadcast destination address includes: dividing the upgrade program into a plurality of upgrade data packets, and determining a first upgrade data packet in sequence according to the transmission order corresponding to the plurality of upgrade data packets; the first upgrade data packet is an upgrade data packet to be sent; broadcasting the first upgrade data packet to the plurality of power modules to be upgraded according to the broadcast destination address; obtaining a plurality of reply messages from the plurality of power modules to be upgraded in response to the first upgrade data packet; determining the upgrade data verification result corresponding to the first upgrade data packet based on the plurality of reply messages; and representing the first upgrade data packet with the upgrade data verification result. When the upgrade data packet verification passes, the first upgrade data packet is temporarily stored; the second upgrade data packet is determined according to the transmission order; and the second upgrade data packet is broadcast according to the broadcast destination address; the second upgrade data packet is the next upgrade data packet after the first upgrade data packet among the plurality of upgrade data packets; if all the plurality of upgrade data packets have been broadcast and the upgrade data verification results corresponding to the plurality of upgrade data packets have all passed, then an upgrade completion instruction is sent to the plurality of power modules to be upgraded according to the broadcast destination address; if the upgrade data verification results indicate that one upgrade data packet has failed verification, then the transmission of the upgrade program is interrupted, and the plurality of power modules to be upgraded are controlled to reset.

[0066] The upgrade data packet is a data unit formed by dividing the upgrade program into data segments for sequential transmission. The transmission order represents the order in which multiple upgrade data packets are transmitted during the upgrade program. The upgrade data verification result represents the data verification status of the corresponding upgrade data packet after being received by multiple power modules to be upgraded. The code storage segment is used to temporarily store the upgraded data packets that have passed verification during the upgrade process, and is distinguished from the program segment used to store the currently running program. By dividing the upgrade program into packets and broadcasting, verifying, and temporarily storing them packet by packet in the transmission order, it is possible to avoid directly modifying the original running program before the upgrade program has been fully received, thereby providing program protection against abnormal interruptions during the upgrade process.

[0067] Specifically, firstly, the received upgrade program is divided into multiple upgrade data packets, and the first upgrade data packet to be sent is determined according to a predetermined transmission order. The broadcast destination address of the first upgrade data packet is set to the broadcast destination address corresponding to the multiple power modules to be upgraded. Next, the first upgrade data packet is broadcast to the multiple power modules to be upgraded according to the broadcast destination address. After receiving the first upgrade data packet, each power module to be upgraded verifies the data within it, and the controller returns a corresponding reply message to the host computer based on the verification result. Then, the upgrade data verification result corresponding to the first upgrade data packet is determined based on the reply messages returned by the multiple power modules to be upgraded. When all power modules to be upgraded indicate that the first upgrade data packet verification has passed, the first upgrade data packet is temporarily stored in a pre-allocated code temporary storage segment memory space. The next upgrade data packet after the first upgrade data packet is determined according to the transmission order as the second upgrade data packet. The second upgrade data packet is then sent to multiple power modules to be upgraded using the same broadcast method. This process of transmitting, verifying, and temporarily storing multiple upgrade data packets is completed sequentially. Finally, when all upgrade data packets have been broadcast and the verification results for each upgrade data packet indicate that the verification has passed, an upgrade completion command is sent to the multiple power modules to be upgraded via the broadcast destination address. This allows each power module to process the complete upgrade data in the code temporary storage segment's memory space. If the verification result for any upgrade data packet indicates that the verification has failed, the transmission of the current upgrade program is immediately interrupted, and multiple power modules to be upgraded are reset to prevent incomplete or erroneous upgrade data from participating in subsequent program updates. It is worth noting that during online upgrades, after receiving a data packet, the module first performs data verification. If the verification passes, the data is written to the code temporary storage segment of the FLASH memory before receiving the next data packet. After all data packets have been received, all data in the code temporary storage segment is read for CRC verification. Only after the CRC verification passes is the temporarily stored data migrated to the program segment.

[0068] As can be seen, by dividing the upgrade program into multiple upgrade data packets and using a broadcast method to transmit, verify, and temporarily store each packet sequentially, multiple power modules to be upgraded can synchronously complete the reception of upgrade data. At the same time, by temporarily storing the data packets after verification and executing the upgrade completion process only after all data transmissions are completed, the original running program is not directly modified during the upgrade process. When any upgrade data packet fails verification, the transmission is interrupted in a timely manner and the relevant power module is reset, thereby reducing the risk of program failure due to incomplete or abnormal upgrade data, and improving the reliability of the online upgrade process while ensuring the efficiency of parallel upgrades of multiple modules.

[0069] In an optional embodiment, determining the upgrade data verification result corresponding to the first upgrade data packet based on the plurality of reply messages includes: determining a plurality of first receiving states corresponding to the plurality of power modules to be upgraded based on the plurality of reply messages; writing the first upgrade data packet into a data temporary storage area when the plurality of first receiving states indicate that the power modules to be upgraded have completed receiving the first upgrade data packet; updating the first receiving states corresponding to the plurality of power modules to be upgraded based on the data temporary storage results corresponding to the plurality of power modules to be upgraded to obtain a plurality of second receiving states; and determining the upgrade data verification result corresponding to the first upgrade data packet based on the plurality of second receiving states.

[0070] The first receiving status represents the receiving status of the corresponding power module to be upgraded for the first upgrade data packet; the data storage result represents whether the first upgrade data packet has been written into the data storage area by the corresponding power module to be upgraded; the second receiving status represents the overall receiving status of the corresponding power module to be upgraded after completing the receiving and storage of the first upgrade data packet; and the upgrade data verification result represents whether all the power modules to be upgraded have correctly received and stored the first upgrade data packet. By recording the receiving status and data storage status of multiple power modules to be upgraded respectively, the actual transmission status of a single upgrade data packet among multiple power modules can be confirmed one by one.

[0071] Specifically, firstly, after broadcasting the first upgrade data packet to multiple power modules to be upgraded, the system receives reply messages from each power module and determines the first reception status of the corresponding power module based on the reception results in each reply message. When a reply message from a power module indicates that it has completed receiving the first upgrade data packet, the first reception status of that power module is determined to be the reception completion status. Next, when the first reception statuses of multiple power modules all indicate that the first upgrade data packet has been received, the first upgrade data packet is written into a pre-allocated data temporary storage area, temporarily storing the received upgrade data in a storage area separate from the currently running program. Then, based on the data temporary storage results of the multiple power modules, the original first reception status of each power module is updated. For power modules that have successfully written the first upgrade data packet into the data temporary storage area, their first reception status is updated to the corresponding second reception status, indicating that the power module has completed the reception and temporary storage of the first upgrade data packet. Finally, the second reception statuses corresponding to the multiple power modules to be upgraded are summarized. When all the second reception statuses indicate that the first upgrade data packet has been correctly received and temporarily stored, the upgrade data verification result corresponding to the first upgrade data packet is determined to be verified as passed. If the second reception status corresponding to at least one power module to be upgraded indicates a reception or temporary storage abnormality, the upgrade data verification result corresponding to the first upgrade data packet is determined to be verified as failed, and the transmission of subsequent upgrade data packets is stopped. In some embodiments, the data temporary storage area can be a FLASH code temporary storage segment, which is distinguished from the program segment storing the currently running program.

[0072] It can be seen that by establishing a first receiving state for each of the multiple power modules to be upgraded, and further updating the second receiving state after confirming the completion of the upgrade data packet reception by combining the data temporary storage result, the transmission confirmation of the first upgrade data packet is extended from simple communication reception to the completion of data temporary storage. Furthermore, by jointly determining the upgrade data verification result based on the second receiving states corresponding to multiple power modules to be upgraded, it can be ensured that the same upgrade data packet has been correctly received and temporarily stored by each power module to be upgraded before entering the transmission process of the next upgrade data packet. This improves the accuracy of data transmission status judgment during the parallel upgrade of multiple modules and reduces the risk of upgrade failure caused by abnormal data reception or temporary storage of some modules.

[0073] For easier understanding, please refer to Figure 5 , Figure 5 This is a schematic diagram illustrating a process for upgrading and temporarily migrating data, as provided in an embodiment of this application. Figure 5As shown, firstly, after the process begins, the host computer executes "Host computer sends data packet," sending the data packet corresponding to the upgrade program to the charging module. Upon receiving the data packet, the module executes "Module performs data verification," verifying the received data packet and further performing a "Data verification error?" check. If the data verification error result is "yes," meaning the current data packet's data verification is error-free, the module executes "Module writes data to code temporary storage segment," writing the currently verified data packet to the code temporary storage segment and executing "Module sends reply message," feeding back the reception and temporary storage processing result of the current data packet to the host computer. If the data verification error result is "no," meaning the current data packet's data verification contains an error, the module executes "Module replies with verification error message," feeding back the processing result of the current data packet's verification error to the host computer. Then, the host computer executes a "Data verification correct?" check based on the module's reply message to determine whether the current data packet has been correctly received and processed by the module. If the "Data verification correct?" check is "yes", then the "Data transmission completed?" check is performed to determine if all data packets corresponding to the current upgrade program have been transmitted. If the "Data verification correct?" check is "no", it indicates that the transmission or verification of the current data packet does not meet the upgrade requirements, and the subsequent transmission process of the current upgrade data will not continue. For the "Data transmission completed?" check, if the check is "no", meaning there are still data packets that have not been transmitted, then the process returns to "Host computer sends data packets", whereby the host computer continues to send subsequent data packets. The module continues to perform "Module performs data verification", performs data storage or replies with verification error messages based on the "Data verification correct?" check result, and feeds back the processing results through "Module sends reply messages", thus completing the transmission of multiple upgrade data packets in a loop according to the above process. If the "Data transmission completed?" check is "yes", meaning all upgrade data packets have been transmitted, then the host computer executes "Host computer sends upgrade completion command", sending an upgrade completion command to the module. Next, after receiving the upgrade completion command, the power module executes the following step: "The module receives the upgrade completion command and performs a CRC check on the data stored in the code temporary storage segment." This involves performing a comprehensive CRC check on all upgrade data already stored in the code temporary storage segment, and then further executing a "CRC check correct?" check. If the "CRC check correct?" check result is "yes," meaning the complete upgrade data in the code temporary storage segment passes the CRC check, the module executes the following step: "The module overwrites the data in the code temporary storage segment to the program segment." This migrates the upgrade data, confirmed to be correct through comprehensive verification, to the program segment to complete the upgrade program update. Subsequently, the module executes the following step: "Module reset, run the new program," resetting the module and running the updated new program. This concludes the process.If the result of the "CRC check is correct?" judgment is "no", that is, the complete upgrade data in the code temporary segment has not passed the CRC check, then the program migration process of "the module overwrites the data in the code temporary segment to the program segment" and "the module is reset and runs the new program" will not be executed, thus ending the current upgrade process.

[0074] As can be seen, the embodiments of this application first perform independent data verification on each data packet sent by the host computer, and only write the data that has been verified to be correct into the code temporary storage segment; during the data transmission process, the transmission processing status of each data packet is confirmed by the module sending a reply message and the data verification being correct, and the reception of all upgrade data is determined by the data transmission completion; after all data transmission is completed, the CRC verification of the complete upgrade data in the code temporary storage segment is triggered by the host computer sending an upgrade completion command. Only when the CRC verification is correct will the "module overwrites the data in the code temporary storage segment to the program segment" and "module resets and runs the new program" be executed, thereby forming a closed-loop upgrade process from data packet reception, single packet verification, data temporary storage, transmission completion confirmation, complete data CRC verification to program migration and new program operation, reducing the risk of data errors or upgrade anomalies during the upgrade data transmission process that directly affect the currently running program, and improving the data integrity and program update reliability of the power module online upgrade.

[0075] In an optional embodiment, the method further includes: receiving a communication message corresponding to the upgrade program via the CPU and sending the communication message to the CLA; parsing and verifying the communication message via the CLA to obtain a parsing and verification result; generating upgrade response information based on the parsing and verification result; and sending the upgrade response information via the CPU; when multiple upgrade verification results corresponding to multiple upgrade data packets all indicate that the verification is passed, controlling the multiple power modules to be upgraded to stop charging and enter a power-off state; writing the upgrade data packets corresponding to the verification passed into the FLASH program segment of the multiple power modules to be upgraded, and controlling the multiple power modules to be upgraded to reset after the writing is completed.

[0076] The CPU and CLA are processing units within the power module used to execute different tasks in parallel. The CPU executes the charging program and receives and sends upgrade communication messages, while the CLA parses and verifies the received upgrade communication messages. The FLASH program segment stores the currently running program of the power module and the new program that needs to be run after the upgrade is completed. By dividing the functions of the CPU and CLA, the charging program and the processing of online upgrade messages can be executed in parallel, and the program replacement can only be performed after all upgrade data has been verified.

[0077] Specifically, firstly, during the normal execution of the charging program by the power module, the CPU receives the communication message corresponding to the upgrade program sent by the host computer and passes the received communication message to the CLA for processing, enabling the CPU to continue executing the module's charging program. Next, the CLA parses the communication message passed by the CPU, determines the message type and content, and verifies the upgrade data in the communication message, obtaining the corresponding parsing and verification results. Then, the CLA generates the corresponding upgrade response information based on the parsing and verification results and passes the upgrade response information to the CPU, which then sends the upgrade response information to the host computer to provide feedback on the current processing status of the upgrade communication message. Finally, when the upgrade verification results for multiple upgrade data packets all indicate that the verification has passed, it is determined that the upgrade program has been completely received and verified. At this point, multiple power modules to be upgraded are controlled to stop their current charging process and enter a shutdown state. The complete upgrade program corresponding to the verified upgrade data packets is then written into the FLASH program segment of multiple power modules to be upgraded. After the program is written, multiple power modules to be upgraded are controlled to reset, causing the power modules to reinitialize and run the new program written into the FLASH program segment. In some embodiments, the DSP supports parallel operation of the CPU and CLA dual-core processors. During online upgrades, the CPU runs the module charging main program and receives and sends upgrade messages. The CLA parses and verifies the received messages and loads the messages to be sent. After all data has been received and verified, charging is paused, the data in the code temporary storage segment is overwritten into the program segment, and the new program is reset and run. Furthermore, during upgrade data transmission, upgrade data is first written to the code temporary storage segment, rather than directly overwriting the currently running program segment. Only after all upgrade data has been received and verified is the upgrade data in the code temporary storage segment migrated to the FLASH program segment. Thus, through the above processing, even if an upgrade interruption occurs during data transmission, the DSP can still run the original program after reset, thereby reducing the risk of module malfunction due to upgrade interruption.

[0078] It can be seen that by utilizing the parallel processing capabilities of the CPU and CLA, the CLA handles the parsing and verification of upgrade communication messages while the CPU executes the charging program, and the CPU completes the sending of upgrade response information. This avoids prolonged interruptions to normal charging during online upgrades due to upgrade program processing. Furthermore, charging is stopped only after all upgrade data packets have been verified, and the temporarily stored upgrade data is written to the FLASH program segment. Finally, a reset is performed to make the new program effective. This ensures that charging operation and upgrade data processing are staggered in time, and the power module shutdown operation is concentrated in the program replacement stage, thereby shortening the duration of module charging interruption during the upgrade process and improving the continuity and reliability of online power module upgrades.

[0079] In the scenario of power-on module startup, for easier understanding of the data processing procedures of the CPU and CLA, please refer to [link / reference needed]. Figure 6 , Figure 6This is a schematic diagram of the CPU and CLA processing flow for an online power module upgrade during startup, provided in an embodiment of this application. As can be seen, firstly, after the process begins, the power module receives a "message sent by the host computer." The power module, through the CPU, executes "module receives message and extracts message information" to receive the message sent by the host computer and extract the corresponding message information from the received message. Next, the CPU transmits the extracted message information to the CLA, which executes "module parses message information," parses the message information, and determines whether the message is an online upgrade data packet. If the determination result is "yes," it indicates that the current message is an online upgrade data packet. At this time, the CLA executes "module extracts data packet data," extracts the corresponding upgrade data packet data from the message, and executes "module verifies data," verifying the extracted upgrade data. Subsequently, the CLA executes "module loads reply information into reply message," loading the processing result corresponding to the current data packet into the reply message, and further determines whether the data verification is correct. If the "Data verification correct?" check is "yes", the CPU executes the "module writes the extracted data to memory" function, writing the upgrade data that has been verified correctly by the CLA to the corresponding memory area. If the "Data verification correct?" check is "no", the process of writing the extracted data to memory is not executed, and the CPU executes the "module sends a reply message" function, feeding back the processing result of the current upgrade data packet to the host computer. Then, after completing the "module sends a reply message" function, the host computer executes the "module reply message has no errors?" check based on the reply message sent by the module to determine whether the processing result fed back by the current reply message is normal. If the judgment result of "Module reply message has no errors?" is "yes", then the process returns to "Host computer sends message", and the host computer continues to send subsequent messages. The charging module, through the CPU, again executes "Module receives message and extracts message information", and transmits the extracted message information to the CLA. The CLA then performs processing such as "Module parses message information" to continue receiving and processing subsequent upgrade data. If the judgment result of "Module reply message has no errors?" is "no", then the current process ends, i.e., the "end" process is completed. The CLA is responsible for parsing the received message, verifying the upgrade data, and loading the reply information. The CPU is responsible for receiving the message, sending the reply message, and writing the upgrade data after verification, so that the main charging program can continue to run on the CPU, and the CLA handles the message processing tasks in parallel during the online upgrade process. On the other hand, if the judgment result of "Message is an online upgrade data packet?" is "no", then the CLA further determines "Message is an online upgrade request message?".If the judgment result of "Is the message an online upgrade request message?" is "Yes", the module executes "Module enters online upgrade state", putting the charging module into online upgrade state. The CLA then executes "Module loads reply information into reply message", loading the processing result of entering online upgrade state into the reply message. Subsequently, the CPU executes "Module sends reply message", feeding back the online upgrade status to the host computer. Next, if the judgment result of "Is the message an online upgrade request message?" is "No", it further checks "Is the message an online upgrade complete message?". If the judgment result of "Is the message an online upgrade complete message?" is "No", the current process ends. If the judgment result of "Is the message an online upgrade complete message?" is "Yes", it indicates that the transmission of the upgrade data packet has been completed. At this time, the CPU executes "Module performs CRC check on the data stored in the code temporary storage segment", performing a comprehensive CRC check on the upgrade data previously stored in the code temporary storage segment, and further checks "Data verification is correct?". If the "Data verification correct?" check result is "yes", the CPU executes "Module shutdown, overwrite code segment data with code temporary data", stopping the module's current charging operation and overwriting the CRC-verified code temporary data with the code segment; then, it executes "Module reset and run new program", resetting the module and running the updated new program. If the "Data verification correct?" check result is "no", the overwriting of code temporary data with code segment data and the module reset and running new program are not executed, and the current process ends. After receiving and verifying all data, the CPU performs CRC verification on the code temporary data, pauses charging after successful verification, overwrites the code temporary data with code segment data with program segment data, and then resets and runs new program.

[0080] As can be seen, this embodiment utilizes the dual-core parallel operation of the CPU and CLA to divide the different processing tasks during the online upgrade process: the CPU is responsible for receiving and sending upgrade messages, running the main charging program, and writing upgrade data; the CLA is responsible for parsing and verifying the received upgrade messages and loading the reply information. After all upgrade data transmission is completed, the CPU performs CRC verification on the complete upgrade data in the code temporary storage segment. After the verification is successful, charging is paused, the upgrade data is overwritten to the program segment, and the new program is reset and run. Therefore, the main charging program running on the CPU does not need to be stopped during the upgrade data transmission and verification process. The program migration and module reset are only performed after the complete upgrade data verification is confirmed. This fully utilizes the parallel processing capabilities of the CPU and CLA, reduces the impact of online upgrades on the normal operation of the charging module while ensuring the integrity and correctness of the upgrade data, and improves the continuity and reliability of the online upgrade process during the power-on of the charging module.

[0081] Please continue reading. Figure 7 , Figure 7 This is a flowchart illustrating another power module upgrade method provided in an embodiment of this application, as shown below. Figure 7As shown, firstly, after the process begins, the host computer sends an online upgrade request broadcast message to multiple power modules connected in parallel. Upon receiving the broadcast message, modules 1 and N respectively execute the actions of "Module 1 responding to the request and entering the online upgrade state" and "Module N responding to the request and entering the online upgrade state," thus putting all power modules participating in the upgrade into the online upgrade state. Subsequently, the host computer checks if "response messages from modules 1-N have been received" to determine if all power modules have responded to the online upgrade request broadcast message. If the result is "yes," the subsequent upgrade data packet transmission process begins; if the result is "no," the communication timeout timer T1++ is executed to accumulate the communication waiting time for responses from multiple power modules, and further checks if "timeout T1 > 500ms?" is performed. If the result of the "Timeout T1 > 500ms?" check is "No", then continue to wait for and receive reply messages from unreplying power modules, and re-execute the "Reply messages received from modules 1-N?" check; if the result of the "Timeout T1 > 500ms?" check is "Yes", then end the current upgrade process. Next, when the result of the "Reply messages received from modules 1-N?" check is "Yes", the host computer executes "Host computer broadcasts data packets", sending the data packet corresponding to the upgrade program to multiple parallel power modules via broadcast. After receiving the data packet, modules 1 and N execute "Module 1 verifies data and replies" and "Module N verifies data and replies", respectively, verifying the received upgrade data and replying to the host computer with the corresponding processing results. Subsequently, the "Reply messages received from modules 1-N?" check continues to be executed to determine whether modules 1 through N have all returned reply messages corresponding to the current data packet. If the judgment result is "yes", then the "Data verification correct?" judgment is further executed; if the judgment result is "no", then the "communication timeout counter T2++" is executed, continuing to wait for the reply message from the unreplying module, and the "timeout time T2>500ms?" judgment is executed. If the "timeout time T2>500ms?" judgment result is "no", then the reply messages returned by multiple power modules continue to be received, and the "reply messages received from modules 1-N?" judgment is re-executed; if the "timeout time T2>500ms?" judgment result is "yes", then the current upgrade process ends. Then, when the "reply messages received from modules 1-N?" judgment result is "yes", the "Data verification correct?" judgment is executed to determine whether the current data packet has passed data verification based on the reply messages returned by multiple power modules. If the "Data verification correct?" judgment result is "yes", then the "Data transmission completed?" judgment is further executed; if the "Data verification correct?" judgment result is "no", then the current upgrade process ends.When the "Data transmission complete?" check result is "No", it indicates that there are still data packets that have not been transmitted. In this case, the system returns to "Host computer broadcasts data packets", and the host computer continues to broadcast subsequent data packets. Modules 1 and N then execute "Data verification and reply message", repeating the reply message reception and data verification process. When the "Data transmission complete?" check result is "Yes", it indicates that the data corresponding to the upgrade program has been transmitted. In this case, the system executes "Host computer broadcasts upgrade completion command", and the host computer broadcasts the upgrade completion command to multiple power modules, completing the current upgrade data transmission process.

[0082] It can be seen that through implementation Figure 7 The aforementioned embodiments can form a closed-loop processing flow from upgrade request broadcasting, module response confirmation, upgrade data packet broadcasting, module verification feedback, communication timeout control to upgrade completion instruction issuance, thereby improving communication reliability and anomaly handling capabilities during the upgrade process while enabling parallel upgrades of multiple parallel power modules.

[0083] As can be seen, by implementing the power module upgrade method provided in the above embodiments, compared with the current method of upgrading each module individually online, this embodiment first receives an upgrade message sent by a host computer; wherein the upgrade message includes a module upgrade list and an upgrade program; the module upgrade list records the first module address of the power module to be upgraded; then, an upgrade request message is broadcast to multiple power modules connected in parallel; and the response messages sent by the multiple power modules in response to the upgrade request message are obtained; then, address matching is performed according to the first module address and the second module address to obtain the address matching result; finally, when the address matching result indicates that the first module address and the second module address are completely matched, the upgrade program is sent to the multiple power modules to be upgraded at the broadcast address, so that the multiple power modules to be upgraded receive the upgrade program in parallel and complete the upgrade.

[0084] Thus, by matching the pre-determined first module address of the power module to be upgraded with the second module address of the power module actually responding to the upgrade request, the consistency of the upgrade target can be confirmed before the upgrade program is issued. The upgrade program is broadcast to multiple power modules to be upgraded only when both the first and second module addresses match, thereby preventing non-target power modules from receiving the upgrade program and reducing the possibility of missing upgrade modules, thus improving the accuracy of online upgrades for multiple power modules. Simultaneously, broadcasting the same upgrade program to multiple power modules allows them to receive the upgrade program in parallel, reducing the communication process caused by repeatedly issuing upgrade programs to different power modules. This reduces the time spent on repetitive data transmission during online upgrades and improves the efficiency of parallel upgrades for multiple power modules.

[0085] The above primarily describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, the controller includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments provided herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0086] This application embodiment can divide the controller into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0087] When dividing each function into modules according to its corresponding function. Figure 8 This application provides a functional module block diagram of a power module upgrade device, applied to the main controller of a charging pile upgrade system. The power module upgrade device 800 includes: The receiving module 810 is used to receive upgrade messages sent by the host computer; the upgrade message includes a module upgrade list and an upgrade program; the module upgrade list records the first module addresses corresponding to multiple power modules to be upgraded; The sending module 820 is used to broadcast upgrade request messages to multiple power modules connected in parallel; and to obtain response messages sent by the multiple power modules in response to the upgrade request messages; the response messages carry the second module addresses of the multiple power modules. The matching module 830 is used to perform address matching based on the address of the first module and the address of the second module to obtain the address matching result; The control module 840 is configured to broadcast the upgrade program to the plurality of power modules to be upgraded when the address matching result indicates that the addresses of the first module and the second module match completely, so that the plurality of power modules to be upgraded receive the upgrade program in parallel and complete the upgrade.

[0088] In an optional embodiment, the control module 840, in broadcasting the upgrade program to the plurality of power modules to be upgraded, is specifically configured to: determine the broadcast destination address of the upgrade program; broadcast the upgrade program to the plurality of power modules to be upgraded according to the broadcast destination address; obtain a plurality of reply messages from the plurality of power modules to be upgraded in response to the upgrade program; determine the transmission status of the plurality of power modules to be upgraded according to the plurality of reply messages; and determine that the upgrade program transmission is complete when the transmission status indicates that the upgrade program transmission is normal.

[0089] In an optional embodiment, the control module 840, in broadcasting the upgrade program to the plurality of power modules to be upgraded according to the broadcast destination address, is specifically configured to: divide the upgrade program into a plurality of upgrade data packets, and sequentially determine a first upgrade data packet according to the transmission order corresponding to the plurality of upgrade data packets; the first upgrade data packet is an upgrade data packet to be sent; broadcast the first upgrade data packet to the plurality of power modules to be upgraded according to the broadcast destination address; obtain a plurality of reply messages from the plurality of power modules to be upgraded in response to the first upgrade data packet; determine the upgrade data verification result corresponding to the first upgrade data packet according to the plurality of reply messages; and determine the upgrade data verification result... When the first upgrade data packet passes verification, the first upgrade data packet is temporarily stored; a second upgrade data packet is determined according to the transmission order; and the second upgrade data packet is broadcast according to the broadcast destination address; the second upgrade data packet is the next upgrade data packet after the first upgrade data packet among the plurality of upgrade data packets; if all the plurality of upgrade data packets have been broadcast and the upgrade data verification results corresponding to the plurality of upgrade data packets have all passed, an upgrade completion instruction is sent to the plurality of power modules to be upgraded according to the broadcast destination address; if the upgrade data verification results indicate that one upgrade data packet has failed verification, the transmission of the upgrade program is interrupted, and the plurality of power modules to be upgraded are controlled to reset.

[0090] In an optional embodiment, the control module 840, in determining the upgrade data verification result corresponding to the first upgrade data packet based on the plurality of reply messages, is specifically configured to: determine a plurality of first receiving states corresponding to the plurality of power modules to be upgraded based on the plurality of reply messages; when the plurality of first receiving states indicate that the power modules to be upgraded have completed receiving the first upgrade data packet, write the first upgrade data packet into a data temporary storage area; update the first receiving states corresponding to the plurality of power modules to be upgraded based on the data temporary storage results corresponding to the plurality of power modules to be upgraded, to obtain a plurality of second receiving states; and determine the upgrade data verification result corresponding to the first upgrade data packet based on the plurality of second receiving states.

[0091] In an optional embodiment, the control module 840 is further configured to: receive communication messages corresponding to the upgrade program via the CPU, and send the communication messages to the CLA; parse and verify the communication messages via the CLA to obtain a parsing and verification result; generate upgrade response information based on the parsing and verification result; and send the upgrade response information via the CPU; when multiple upgrade verification results corresponding to multiple upgrade data packets all indicate that the verification is passed, control the multiple power modules to be upgraded to stop charging and enter a power-off state; write the upgrade data packets corresponding to the verification passed into the FLASH program segment of the multiple power modules to be upgraded, and control the multiple power modules to be upgraded to reset after the writing is completed.

[0092] In an optional embodiment, the matching module 830, in performing address matching based on the first module address and the second module address to obtain an address matching result, is specifically configured to: determine a target address set based on the first module address; and determine a response address set based on the second module address; determine an address matching relationship between the target address set and the response address set; determine an address correspondence state between the first module address and the second module address based on the address matching relationship; if the address correspondence state indicates that the addresses in the target address set and the response address set are in one-to-one correspondence, and there is no second module address in the response address set other than the target address set, then the address matching result is determined to be an address matching success; if the address correspondence state indicates that the target address set and at least one address in the response address set are not in correspondence, or there is a second module address in the response address set other than the target address set, then the address matching result is determined to be an address matching failure.

[0093] In an optional embodiment, the sending module 820, in acquiring the response messages sent by the plurality of power modules in response to the upgrade request message, is specifically used for: Extract the addresses of multiple second modules corresponding to the multiple power modules from the upgrade request message; A first response address record is established based on the received response message and the addresses of the plurality of second modules; When a new response message is received, the second module address corresponding to the new response message is added to the first response address record to obtain the second response address record; The number of target power modules corresponding to the received response messages is determined based on the second response address record; When the number of target power modules is the same as the number of multiple power modules to be upgraded, it is determined that the response messages corresponding to the multiple power modules to be upgraded have been received.

[0094] In an optional embodiment, the sending module 820 is further configured to: start a communication timeout timer when the number of target power modules is less than the number of multiple power modules to be upgraded, and continue to receive response messages sent by the multiple power modules; when a new response message is received, update the second response address record according to the second module address corresponding to the new response message to obtain a third response address record; determine the number of power modules that have responded according to the non-repeating second module addresses in the third response address record to obtain a first power module number; if the communication timeout timer is greater than a preset timeout duration threshold and the number of the first power modules is less than the number of multiple power modules to be upgraded, output an upgrade exception and receive an upgrade communication exception instruction generated by the host computer based on the upgrade exception; interrupt the transmission of the upgrade program according to the upgrade communication exception instruction to perform a reset on the multiple power modules to be upgraded; if the communication timeout timer is less than or equal to the timeout duration threshold and the number of the first power modules is less than the number of multiple power modules to be upgraded, continue to receive response messages sent by the multiple power modules.

[0095] As can be seen, by implementing the energy module upgrade device provided above, the device receives upgrade messages sent by a host computer. These upgrade messages include a module upgrade list and an upgrade program. The module upgrade list records the first module address of the power module to be upgraded. Next, upgrade request messages are broadcast to multiple power modules connected in parallel. The device then receives response messages sent by each power module in response to the upgrade request message. Next, address matching is performed based on the first module address and the second module address to obtain the address matching result. Finally, when the address matching result indicates that the first module address and the second module address match completely, the upgrade program is sent to the multiple power modules to be upgraded using the broadcast address, enabling the multiple power modules to receive the upgrade program in parallel and complete the upgrade. Thus, by using a broadcast method to send the same upgrade request and upgrade program data packets to multiple power modules to be upgraded, the same upgrade data packets can be received in parallel by the multiple power modules to be upgraded. This reduces the communication interaction process caused by repeatedly sending upgrade data to different power modules, thereby reducing the repetitive data transmission time during the online upgrade process of multiple modules and improving the efficiency of online upgrades of multiple modules.

[0096] This application also provides a computer-readable storage medium storing a computer program for electronic data interchange, the computer program causing a computer to perform some or all of the steps of any of the methods described in the above method embodiments, the computer including a controller.

[0097] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer includes a controller.

[0098] It should be noted that, for the sake of simplicity, the above embodiments are all described as a series of actions. Those skilled in the art should understand that this application is not limited to the described order of actions, as some steps in the embodiments of this application can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions, steps, modules, or units involved are not necessarily essential to the embodiments of this application.

[0099] In the above embodiments, the descriptions of each embodiment in this application have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0100] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0101] Those skilled in the art should recognize that, in one or more of the above examples, the functions described in the embodiments of this application can be implemented entirely or partially by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The modules / units included in the various devices and products described in the above embodiments can be software modules / units, hardware modules / units, or a combination of both. The specific embodiments described above further illustrate the purpose, technical solutions, and beneficial effects of the embodiments of this application. It should be understood that the above descriptions are merely specific implementations of the embodiments of this application and are not intended to limit the scope of protection of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made based on the technical solutions of the embodiments of this application should be included within the scope of protection of the embodiments of this application.

Claims

1. A method for upgrading a power module, characterized in that, A main controller applied to a charging pile upgrade system, the main controller including a CPU and a CLA, the method including: Receive upgrade messages sent by the host computer; the upgrade message includes a module upgrade list and an upgrade program; the module upgrade list records the first module addresses corresponding to multiple power modules to be upgraded; Broadcast upgrade request messages to multiple power modules that are connected in parallel; and obtain the response messages sent by the multiple power modules in response to the upgrade request messages; the response messages carry the second module addresses of the multiple power modules; Address matching is performed based on the first module address and the second module address to obtain the address matching result; When the address matching result indicates that the first module address and the second module address are all matched, the upgrade program is broadcast to the plurality of power modules to be upgraded, so that the plurality of power modules to be upgraded can receive the upgrade program in parallel and complete the upgrade. The method further includes, after broadcasting the upgrade program to the plurality of power modules to be upgraded: The CPU receives the communication message corresponding to the upgrade program and sends the communication message to the CLA; the CPU is used to execute the charging program and receive and send the upgrade communication message, and the CLA is used to parse and verify the received upgrade communication message. The communication message is parsed and verified using the CLA to obtain the parsing and verification result. An upgrade response information is generated based on the parsing and verification results; and the upgrade response information is sent through the CPU. When multiple upgrade verification results corresponding to multiple upgrade data packets all indicate that the verification has passed, the multiple power modules to be upgraded are controlled to stop charging and enter the power-off state. The corresponding upgrade data packet that passes the verification is written into the FLASH program segment of the multiple power modules to be upgraded, and the multiple power modules to be upgraded are reset after the writing is completed.

2. The method as described in claim 1, characterized in that, The step of broadcasting the upgrade program to the plurality of power modules to be upgraded includes: Determine the broadcast destination address of the upgrade procedure; The upgrade program is broadcast to the plurality of power modules to be upgraded according to the broadcast destination address; Obtain multiple response messages from the multiple power modules to be upgraded in response to the upgrade program; The transmission status of the multiple power modules to be upgraded is determined based on the multiple reply messages; When the transmission status indicates that the upgrade program transmission is normal, the upgrade program transmission is determined to be complete.

3. The method as described in claim 2, characterized in that, The step of broadcasting the upgrade program to the plurality of power modules to be upgraded according to the broadcast destination address includes: The upgrade process is divided into multiple upgrade data packets, and the first upgrade data packet is determined sequentially according to the transmission order of the multiple upgrade data packets; the first upgrade data packet is the upgrade data packet to be sent. The first upgrade data packet is broadcast to the plurality of power modules to be upgraded according to the broadcast destination address; Obtain multiple response messages from the multiple power modules to be upgraded in response to the first upgrade data packet; The upgrade data verification result corresponding to the first upgrade data packet is determined based on the multiple reply messages; When the upgrade data verification result indicates that the first upgrade data packet has passed verification, the first upgrade data packet is temporarily stored; a second upgrade data packet is determined according to the transmission order; and the second upgrade data packet is broadcast according to the broadcast destination address; the second upgrade data packet is the next upgrade data packet among the plurality of upgrade data packets to the first upgrade data packet; If all of the multiple upgrade data packets have been broadcast successfully, and the upgrade data verification results corresponding to the multiple upgrade data packets have all passed, then an upgrade completion command is sent to the multiple power modules to be upgraded according to the broadcast destination address. If the upgrade data verification result indicates that an upgrade data packet fails verification, the transmission of the upgrade program is interrupted, and the multiple power modules to be upgraded are reset.

4. The method as described in claim 3, characterized in that, Determining the upgrade data verification result corresponding to the first upgrade data packet based on the plurality of reply messages includes: Based on the multiple reply messages, determine the multiple first receiving states corresponding to the multiple power modules to be upgraded; When the plurality of first receiving states indicate that the power module to be upgraded has completed receiving the first upgrade data packet, the first upgrade data packet is written into the data temporary storage area. Update the first receiving state corresponding to the multiple power modules to be upgraded according to the data temporary storage results corresponding to the multiple power modules to be upgraded, and obtain multiple second receiving states; The upgrade data verification result corresponding to the first upgrade data packet is determined based on the plurality of second reception states.

5. The method as described in claim 1, characterized in that, The step of performing address matching based on the first module address and the second module address to obtain the address matching result includes: The target address set is determined based on the address of the first module; and the response address set is determined based on the address of the second module. Determine the address matching relationship between the target address set and the response address set; The address correspondence status between the first module address and the second module address is determined based on the address matching relationship; If the address correspondence status indicates that the target address set and the response address set are in one-to-one correspondence, and there is no second module address other than the target address set in the response address set, then the address matching result is determined to be an address matching success. If the address correspondence status indicates that the target address set does not correspond to at least one address in the response address set, or that there is a second module address in the response address set other than the target address set, then the address matching result is determined to be an address matching failure.

6. The method as described in claim 1, characterized in that, The step of obtaining the response messages sent by the plurality of power modules in response to the upgrade request message includes: Extract the addresses of multiple second modules corresponding to the multiple power modules from the upgrade request message; A first response address record is established based on the received response message and the addresses of the plurality of second modules; When a new response message is received, the second module address corresponding to the new response message is added to the first response address record to obtain the second response address record; The number of target power modules corresponding to the received response messages is determined based on the second response address record; When the number of target power modules is the same as the number of multiple power modules to be upgraded, it is determined that the response messages corresponding to the multiple power modules to be upgraded have been received.

7. The method as described in claim 6, characterized in that, The method further includes: When the number of target power modules is less than the number of multiple power modules to be upgraded, a communication timeout timer is started, and the response messages sent by the multiple power modules continue to be received. Upon receiving a new response message, the second response address record is updated according to the second module address corresponding to the new response message to obtain the third response address record; The number of power modules that have responded is determined based on the unique second module addresses in the third response address record, thus obtaining the first number of power modules. If the communication timeout timer is greater than the preset timeout duration threshold, and the number of the first power modules is less than the number of the plurality of power modules to be upgraded, then an upgrade exception is output, and an upgrade communication exception instruction generated by the host computer based on the upgrade exception is received; the transmission of the upgrade program is interrupted according to the upgrade communication exception instruction, so as to perform a reset on the plurality of power modules to be upgraded. If the communication timeout timer is less than or equal to the timeout duration threshold, and the number of the first power modules is less than the number of the plurality of power modules to be upgraded, then the response messages sent by the plurality of power modules will continue to be received.

8. An upgrade device for a power module, characterized in that, A main controller used in a charging pile upgrade system, the main controller including a CPU and a CLA, the device comprising: The receiving module is used to receive upgrade messages sent by the host computer; the upgrade message includes a module upgrade list and an upgrade program; the module upgrade list records the first module addresses corresponding to multiple power modules to be upgraded; The sending module is used to broadcast upgrade request messages to multiple power modules connected in parallel; and to obtain response messages sent by the multiple power modules in response to the upgrade request messages; the response messages carry the second module addresses of the multiple power modules. The matching module is used to perform address matching based on the address of the first module and the address of the second module to obtain the address matching result; The control module is configured to broadcast the upgrade program to the plurality of power modules to be upgraded when the address matching result indicates that the addresses of the first module and the second module match completely, so that the plurality of power modules to be upgraded receive the upgrade program in parallel and complete the upgrade. Specifically, after broadcasting the upgrade program to the plurality of power modules to be upgraded, the control module is further configured to: The CPU receives the communication message corresponding to the upgrade program and sends the communication message to the CLA; the CPU is used to execute the charging program and receive and send the upgrade communication message, and the CLA is used to parse and verify the received upgrade communication message. The communication message is parsed and verified using the CLA to obtain the parsing and verification result. An upgrade response information is generated based on the parsing and verification results; and the upgrade response information is sent through the CPU. When multiple upgrade verification results corresponding to multiple upgrade data packets all indicate that the verification has passed, the multiple power modules to be upgraded are controlled to stop charging and enter the power-off state. The corresponding upgrade data packet that passes the verification is written into the FLASH program segment of the multiple power modules to be upgraded, and the multiple power modules to be upgraded are reset after the writing is completed.

9. A controller, characterized in that, The controller includes: a memory, a processor, and executable program code stored in the memory and executable on the processor, wherein the processor executes the executable program code to perform the steps of the power module upgrade method as described in any one of claims 1-7.