Upgrading method and device of motor controller, vehicle, storage medium and product

By introducing a state machine into the gateway of the motor controller, the delay time is dynamically determined to ensure an orderly response from the slave controller, which solves the problems of long upgrade time and low parallel upgrade efficiency in the existing motor controller upgrade method, and achieves high efficiency, Stable and reliable upgrade process.

CN119356705APending Publication Date: 2025-01-24CHONGQING JINKANG POWER NEW ENERGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411386563.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The existing motor controller upgrade methods have problems such as long upgrade time, increased user waiting time and large energy consumption. The parallel upgrade method can easily lead to a sudden increase in the load of the main controller, affecting the upgrade efficiency.

Method used

By introducing a state machine into the gateway, the first delay time is dynamically determined based on the total number of slave controllers and the instruction response time to ensure orderly response from the slave controllers, thus avoiding signal conflicts and excessive load. At the same time, after receiving the upgrade permission instruction from the slave controller, the gateway forwards it to the main controller. After receiving the upgrade permission instruction, the main controller controls the slave controller to perform software upgrade.

Benefits of technology

A variety of controller starts the upgrade process at the same time, improves the overall upgrade efficiency, stability and reliability, and ensures the orderly and reasonable scheduling of the upgrade process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356705A_ABST
    Figure CN119356705A_ABST
Patent Text Reader

Abstract

The invention discloses an upgrading method and device of a motor controller, a vehicle, a storage medium and a product, and the method comprises the steps that a gateway responds to a received upgrading request instruction sent by a master controller every first delay time, and the gateway forwards the upgrading request instruction to a plurality of slave controllers, so that the slave controllers receive the upgrading request instruction, and the upgrading request instruction is sent to the master controller; sending an upgrade permission instruction to the gateway; wherein each slave controller is configured with a state machine, and the state machine is used for determining first delay time according to the total number of the slave controllers and instruction response time; and the gateway responds to the received upgrade permission instruction sent by the slave controller and forwards the upgrade permission instruction to the master controller, so that the master controller controls the slave controller to upgrade software after receiving the upgrade permission instruction. The invention aims to improve the upgrading efficiency of the motor controller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicles, and more specifically, to a method for upgrading a motor controller, an apparatus for upgrading a motor controller, a vehicle, a computer-readable storage medium, and a computer program product. Background Art

[0002] With the rapid development of automotive electronic technology, the motor controller of the car is also facing rapid iteration of software. Therefore, it is necessary to frequently update the software in the motor controller during product verification to adapt to new product requirements.

[0003] Currently, most vehicles use serial upgrades. The upgrade time for a single controller is determined by factors such as the size of the upgrade package, the bandwidth of the transmission channel, the response rate of the controller, and the internal storage of the controller. In the case of serial upgrades, the more objects are upgraded, the longer the upgrade time. This increases the waiting time for users, which not only leads to a poor upgrade experience, but also consumes more energy for the vehicle.

[0004] In addition, relevant technicians adopt a parallel upgrade method to upgrade the controller. However, the parallel upgrade method in the relevant technology usually relies on conditional judgment to execute. Most controllers process the same command in a similar time. Therefore, the master controller will also receive the response of the slave controller to be upgraded at the same time, causing the load rate of the master controller to suddenly increase, thereby affecting the upgrade efficiency of the slave controller. Summary of the invention

[0005] In view of this, the present invention provides a motor controller upgrade method, a motor controller upgrade device, a vehicle, a computer-readable storage medium and a computer program product, aiming to improve the upgrade efficiency of the motor controller.

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

[0007] The present invention provides a method for upgrading a motor controller, the method comprising:

[0008] In response to receiving the upgrade request instruction sent by the master controller every first delay time, the gateway forwards the upgrade request instruction to a plurality of slave controllers, so that the plurality of slave controllers receive the upgrade request instruction and send an upgrade permission instruction to the gateway; wherein each slave controller is configured with a state machine, and the state machine is used to determine the first delay time according to the total number of slave controllers and the instruction response time;

[0009] In response to receiving the upgrade permission instruction sent by the slave controller, the gateway forwards the upgrade permission instruction to the main controller, so that the main controller controls the slave controller to upgrade the software after receiving the upgrade permission instruction.

[0010] Optionally, the instruction response time is the time taken by the slave controller to respond to the instruction of the master controller, and the first delay time is the quotient of the instruction response time and the total number of slave controllers.

[0011] Optionally, in response to receiving an upgrade permission instruction issued by the slave controller, the gateway forwards the upgrade permission instruction to the master controller, so that the master controller controls the slave controller to upgrade software after receiving the upgrade permission instruction, including:

[0012] In response to receiving the upgrade permission instruction sent by the slave controller, the gateway forwards the upgrade permission instruction to the master controller, so that the master controller sends a flash write condition check instruction to the gateway after receiving the upgrade permission instruction;

[0013] The gateway receives the flashing condition check instruction, and forwards the flashing condition check instruction to the slave controller, so that the slave controller sends a flashing condition check response to the gateway after receiving the flashing condition instruction;

[0014] In response to the flash condition check responses being all flash condition qualified responses, the gateway forwards the flash condition qualified responses to the main controller, so that the main controller sends an upgrade instruction to the gateway after a first delay time, and the gateway forwards the upgrade instruction to the slave controller, so that the slave controller upgrades the software after receiving the upgrade instruction.

[0015] Optionally, after the gateway receives the flash condition check instruction and forwards the flash condition check instruction to the slave controller so that the slave controller sends a flash condition check response to the gateway after receiving the flash condition instruction, the method further includes:

[0016] Optionally, in response to the flash condition check response including a flash condition failure response, the gateway forwards the flash condition failure response to the master controller, so that after receiving the flash condition failure response, the master controller determines the number of slave controllers that fail the flash condition, and sends an upgrade instruction to the gateway after a second delay time, and the gateway forwards the upgrade instruction to the slave controllers that succeed in the flash condition, so that the slave controllers that succeed in the flash condition upgrade their software after receiving the upgrade instruction;

[0017] The second delay time is determined based on the number of slave controllers that fail the flashing condition, the total number of slave controllers, and the instruction response time.

[0018] Optionally, after forwarding the upgrade permission instruction to the master controller so that the master controller controls the slave controller to upgrade the software after receiving the upgrade permission instruction, the method further includes:

[0019] The gateway receives the software verification instruction sent by the master controller, and forwards the software verification instruction to the slave controller, so that the slave controller makes a software verification response after receiving the software verification instruction;

[0020] The gateway receives the software verification response sent by the slave controller, and forwards the software verification response to the main controller, so that the main controller determines that the upgrade software of the slave controller is the target software when judging that the software verification response is successful.

[0021] Optionally, after forwarding the upgrade permission instruction to the master controller so that the master controller controls the slave controller to upgrade the software after receiving the upgrade permission instruction, the method further includes:

[0022] The gateway receives the reset and restart instruction sent by the master controller, and forwards the reset and restart instruction to the slave controller, so that the slave controller makes a reset and restart response after receiving the reset and restart instruction;

[0023] The gateway receives the reset and restart response sent by the slave controller, and forwards the reset and restart response to the master controller, so that the master controller determines that the upgrade of the slave controller is completed when judging that the reset and restart response is a reset and restart success.

[0024] In a second aspect, the present invention provides an upgrade device for a motor controller, comprising an upgrade request module and an upgrade permission module, wherein:

[0025] The upgrade request module is electrically connected to the upgrade permission module, and is used for forwarding the upgrade request instruction to a plurality of slave controllers in response to receiving the upgrade request instruction sent by the master controller every first delay time, so that the plurality of slave controllers receive the upgrade request instruction and send the upgrade permission instruction to the upgrade permission module; wherein each slave controller is configured with a state machine, and the state machine is used for determining the first delay time according to the total number of slave controllers and the instruction response time;

[0026] The upgrade permission module is used to receive an upgrade permission instruction sent by the slave controller, and forward the upgrade permission instruction to the master controller, so that the master controller controls the slave controller to upgrade the software after receiving the upgrade permission instruction.

[0027] The motor controller upgrade device provided by the present invention can ensure that multiple slave controllers can start the upgrade process at the same time, and the delay-based control mechanism effectively avoids signal conflicts or excessive loads caused by simultaneous responses of multiple slave controllers, thereby improving the stability, reliability and upgrade efficiency of the upgrade process.

[0028] In a third aspect, the present invention provides a vehicle, comprising:

[0029] A processor and a memory, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor executes the computer instructions, the upgrade device of the motor controller executes the upgrade method of the motor controller as the first aspect and any possible implementation method thereof.

[0030] The vehicle provided by the present invention can ensure that multiple slave controllers can start the upgrade process at the same time, and the delay-based control mechanism effectively avoids signal conflicts or excessive loads caused by simultaneous responses of multiple slave controllers, thereby improving the stability, reliability and upgrade efficiency of the upgrade process.

[0031] In a fourth aspect, the present invention provides a computer-readable storage medium, comprising: computer instructions, which, when executed on an upgrade device of a motor controller, enable the upgrade device of the motor controller to execute an upgrade method of the motor controller as in the first aspect and any possible implementation thereof.

[0032] The computer-readable storage medium provided by the present invention can ensure that multiple slave controllers can start the upgrade process at the same time, and the delay-based control mechanism effectively avoids signal conflicts or excessive loads caused by simultaneous responses of multiple slave controllers, thereby improving the stability, reliability and upgrade efficiency of the upgrade process.

[0033] In a fifth aspect, the present invention provides a computer program product, which includes: computer instructions, which, when executed on a control device of a vehicle, cause the control device of the vehicle to execute a method for upgrading a motor controller as in the first aspect and any possible implementation thereof.

[0034] The computer program product provided by the present invention can ensure that multiple slave controllers can start the upgrade process at the same time, and the delay-based control mechanism effectively avoids signal conflicts or excessive loads caused by simultaneous responses of multiple slave controllers, thereby improving the stability, reliability and upgrade efficiency of the upgrade process.

[0035] Compared with the prior art, the upgrade method of the motor controller provided by the present invention achieves at least the following beneficial effects: the gateway responds to receiving the request upgrade instruction sent by the master controller every first delay time, forwards the request upgrade instruction to several slave controllers, so that the several slave controllers receive the request upgrade instruction and send the permission upgrade instruction to the gateway; wherein each slave controller is configured with a state machine, and the state machine is used to determine the first delay time according to the total number of slave controllers and the instruction response time. Further, the gateway responds to receiving the permission upgrade instruction sent by the slave controller, forwards the permission upgrade instruction to the master controller, so that the master controller controls the slave controller to upgrade the software after receiving the permission upgrade instruction. The present application receives the request upgrade instruction sent by the master controller through the gateway, and forwards the instruction to multiple slave controllers, forming an effective parallel upgrade management mechanism, ensuring that multiple slave controllers can start the upgrade process at the same time, thereby improving the efficiency of the entire upgrade process. Further, since each slave controller is equipped with an independent state machine, and is used to dynamically determine the first delay time according to the total number and response time of the slave controllers. This delay-based control mechanism effectively avoids signal conflicts or excessive loads caused by multiple slave controllers responding simultaneously, improves the stability and reliability of the upgrade process, and ensures orderliness and reasonable scheduling during the upgrade process. After receiving the upgrade permission instruction, the master controller controls the upgrade of the slave controller, allowing the slave controller to complete the upgrade operation smoothly and orderly, thereby improving the upgrade efficiency.

[0036] Of course, any product implementing the present invention does not necessarily need to achieve all of the above technical effects at the same time.

[0037] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] Figure 1 is a flow chart of a method for upgrading a motor controller provided by an embodiment of the present invention;

[0040] Figure 2 is a schematic diagram of a scenario of an upgrade method of a motor controller provided by an embodiment of the present invention;

[0041] Figure 3 It is a structural schematic diagram of an upgrading device for a motor controller provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

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

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

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

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

[0047] Example 1

[0048] Reference Figure 1 , Figure 1 1 is a flow chart of a vehicle control method provided by an embodiment of the present invention. The vehicle control method includes the following steps.

[0049] In step S11, in response to receiving the upgrade request instruction sent by the master controller every first delay time, the gateway forwards the upgrade request instruction to several slave controllers, so that the several slave controllers receive the upgrade request instruction and send the upgrade permission instruction to the gateway.

[0050] Each slave controller is configured with a state machine, and the state machine is used to determine the first delay time according to the total number of slave controllers and the instruction response time.

[0051] For example, the slave controller is a controller to be upgraded, such as a vehicle body controller, a left door and window controller, a right door and window controller, a sunroof controller, etc., but the present invention is not limited thereto.

[0052] For example, the user may interact with the display screen of the central control screen or the diagnostic screen to cause the main controller to issue an upgrade request instruction.

[0053] For example, in order to avoid communication conflicts or load problems that may be caused by multiple slave controllers responding at the same time, a state machine can be configured on each slave controller, and the state machine can allocate a first delay time according to the total number of slave controllers and the instruction response time. That is, the state machine can enable each slave controller to respond in sequence rather than at the same time based on the determined first delay time, so as to avoid communication congestion caused by multiple slave controllers sending upgrade permission instructions at the same time.

[0054] For example, the command response time is used to characterize the time required for the slave controller to respond to the command after receiving the upgrade request command. The command response time of each slave controller may be different due to its own processing speed, network conditions or other system delays. Therefore, the state machine can adjust the delay time according to the difference in the command response time of different slave controllers to ensure that each slave controller can complete the response within an appropriate time.

[0055] The above implementation mode, by configuring a state machine on each slave controller, can enable the state machine to control the response order according to the delay time, thereby avoiding the conflict problem when multiple slave controllers send upgrade permission instructions at the same time, and ensuring the orderly progress of the upgrade process, thereby improving the efficiency and stability of the entire upgrade process.

[0056] In step S12, in response to receiving the upgrade permission instruction issued by the slave controller, the gateway forwards the upgrade permission instruction to the master controller, so that the master controller controls the slave controller to upgrade the software after receiving the upgrade permission instruction.

[0057] For example, the gateway can receive an upgrade permission instruction from a slave controller and forward the instruction to the master controller, notifying the master controller that the slave controller is ready for the upgrade operation. After receiving the upgrade permission instruction forwarded by the gateway, the master controller can sequentially perform software upgrades on the slave controllers that have sent the upgrade permission instruction, ensuring that too many upgrade tasks do not occur at the same time, reducing the risk of resource competition or communication blockage. Since each slave controller responds in order through the delay mechanism of the state machine, the gateway can smoothly process the upgrade requests of each slave controller without causing resource conflicts due to receiving multiple responses at the same time.

[0058] In the above implementation mode, by upgrading in time and in steps, the master controller can better manage the upgrade process of the slave controller and reduce the communication bottleneck or resource overload caused by concurrent operations.

[0059] The upgrade method of the motor controller provided by the present invention achieves at least the following beneficial effects: the gateway forwards the request upgrade instruction to several slave controllers in response to receiving the request upgrade instruction sent by the master controller every first delay time, so that the several slave controllers receive the request upgrade instruction and send the permission upgrade instruction to the gateway; wherein each slave controller is configured with a state machine, and the state machine is used to determine the first delay time according to the total number of slave controllers and the instruction response time. Further, the gateway forwards the permission upgrade instruction to the master controller in response to receiving the permission upgrade instruction sent by the slave controller, so that the master controller controls the slave controller to upgrade the software after receiving the permission upgrade instruction. The present application receives the request upgrade instruction sent by the master controller through the gateway, and forwards the instruction to multiple slave controllers, forming an effective parallel upgrade management mechanism, ensuring that multiple slave controllers can start the upgrade process at the same time, thereby improving the efficiency of the entire upgrade process. Further, since each slave controller is equipped with an independent state machine, and is used to dynamically determine the first delay time according to the total number and response time of the slave controllers. This delay-based control mechanism effectively avoids the problem of signal conflict or excessive load caused by the simultaneous response of multiple slave controllers, improves the stability and reliability of the upgrade process, and ensures the orderliness and reasonable scheduling of the upgrade process. After receiving the upgrade permission instruction, the master controller controls the upgrade of the slave controller, so that the slave controller can complete the upgrade operation smoothly and orderly, thereby improving the upgrade efficiency.

[0060] Optionally, the instruction response time is the time taken by the slave controller to respond to the instruction of the master controller, and the first delay time is the quotient of the instruction response time and the total number of slave controllers.

[0061] Among them, the total number of slave controllers is the total number of slave controllers participating in the upgrade; the instruction response time is used to characterize the time required for each slave controller to receive the instruction sent by the master controller (such as a request for upgrade instruction) and prepare to send a response (allow upgrade instruction). The instruction response time may vary due to factors such as network delay, hardware processing power, and the load of the slave controller itself.

[0062] For example, the state machine can divide the instruction response time of the slave controller by the total number of slave controllers to obtain a quotient value, which represents the time interval, i.e., the first delay time, at which the master controller should send instructions in order to avoid all slave controllers responding at the same time and causing communication conflicts under ideal conditions.

[0063] For example, assuming that the response time is 10 seconds and the total number of slave controllers is 5, the first delay time can be expressed as: 10 / 5=2. That is, the master controller can send instructions in sequence at intervals of 2 seconds.

[0064] In the above implementation, the state machine calculates the first delay time to ensure that the master controller can send instructions every first delay time, thereby avoiding communication problems caused by simultaneous responses from the slave controllers and optimizing resource usage. By dynamically adjusting the delay time, it is possible to flexibly respond to different numbers of slave controllers and instruction response times, ensuring the efficiency and reliability of the entire upgrade process.

[0065] Optionally, in response to receiving the upgrade permission instruction issued by the slave controller, the gateway forwards the upgrade permission instruction to the master controller, so that the master controller controls the slave controller to upgrade software after receiving the upgrade permission instruction, including: in response to receiving the upgrade permission instruction issued by the slave controller, the gateway forwards the upgrade permission instruction to the master controller, so that the master controller sends a flashing condition check instruction to the gateway after receiving the upgrade permission instruction; the gateway receives the flashing condition check instruction, forwards the flashing condition check instruction to the slave controller, so that the slave controller sends a flashing condition check response to the gateway after receiving the flashing condition instruction; in response to the flashing condition check responses being all flashing condition qualified responses, the gateway forwards the flashing condition qualified response to the master controller, so that the master controller sends an upgrade instruction to the gateway after a first delay time, and the gateway forwards the upgrade instruction to the slave controller, so that the slave controller upgrades software after receiving the upgrade instruction. .

[0066] Among them, the flash condition check instruction is a check instruction issued by the master controller before the upgrade process officially starts. It aims to confirm whether the current state of the slave controller is suitable for flashing (i.e. software upgrade). The flash condition check may include checking the power status, running status, memory space and network connection status of the slave controller.

[0067] The flashing condition check response is a check response generated by the slave controller according to its actual situation after receiving the flashing condition check instruction, so as to inform the master controller whether it meets the flashing condition.

[0068] For example, the gateway can receive the flash condition check instruction sent by the master controller, and forward the flash condition check instruction to the slave controller, so that after receiving the flash condition instruction, the slave controller performs a self-check according to its current state to check whether it meets the flash condition. After the slave controller completes the self-check, it can generate a flash condition check response and send it back to the gateway. The gateway can forward the flash condition check response of the slave controller to the master controller, so that the master controller obtains the status information of the slave controller and gives corresponding instructions based on the flash condition check response.

[0069] For example, in response to the flash condition check responses being all flash condition qualified responses, the gateway forwards the flash condition qualified responses to the master controller to notify the master controller that the slave controller is ready for the flash operation (i.e., upgrade operation). After receiving the flash condition qualified responses, the master controller can determine that the slave controller has met the conditions for flash upgrade, so the master controller can send an upgrade instruction to the gateway after a first delay time, and the gateway forwards the upgrade instruction to the slave controller so that the slave controller upgrades the software after receiving the upgrade instruction.

[0070] For example, after receiving the response indicating that the flashing condition is qualified, the main controller may also give an instruction to turn off the fault diagnosis.

[0071] It should be understood that fault diagnosis is usually used to monitor the abnormal state of the system and make corresponding warnings or control measures based on the monitored abnormal data. However, during the flashing (software upgrade) process, the fault diagnosis function may misjudge certain normal phenomena in the upgrade process as faults, thereby interfering with the smooth progress of the upgrade. For example, during the flashing period, some slave controllers may temporarily stop responding or exhibit inconsistent behavior from the usual, so they may be mistaken by the fault diagnosis system as hardware or software failures, thereby triggering false alarms or protection measures, affecting the normal progress of the upgrade. Therefore, in order to avoid the above problems, the main controller will issue an instruction to turn off the fault diagnosis after receiving the qualified response of the flashing condition to suspend the fault diagnosis function, thereby ensuring that the upgrade process will not be interrupted or failed due to the interference of fault diagnosis.

[0072] The above implementation can improve the robustness and security of the upgrade process, ensure that the slave controller is in a state suitable for flashing, so that the master controller can more effectively control the entire upgrade process and reduce errors and instabilities that may occur during the upgrade process. By turning off fault diagnosis, unnecessary interference can be avoided during the upgrade, thereby improving the success rate and efficiency of flashing.

[0073] Optionally, the gateway receives a flash condition check instruction, forwards the flash condition check instruction to the slave controller, so that after receiving the flash condition instruction, the slave controller sends a flash condition check response to the gateway, and further includes: in response to the flash condition check response including a flash condition failure response, the gateway forwards the flash condition failure response to the master controller, so that after receiving the flash condition failure response, the master controller determines the number of slave controllers that fail the flash condition, and sends an upgrade instruction to the gateway after a second delay time, and the gateway forwards the upgrade instruction to the slave controller that succeeds in the flash condition, so that the slave controller that succeeds in the flash condition upgrades the software after receiving the upgrade instruction; wherein the second delay time is determined based on the number of slave controllers that fail the flash condition, the total number of slave controllers and the instruction response time.

[0074] Specifically, the number of slave controllers that succeeded the flashing condition can be determined based on the total number of slave controllers and the number of slave controllers that failed the flashing condition, and then the quotient of the instruction response time and the number of slave controllers that succeeded the flashing condition is determined as the second delay time.

[0075] For example, in response to the flash condition check response including a flash condition failure, after receiving the flash condition failure response, the master controller will determine which slave controllers cannot meet the flash condition, that is, the number of slave controllers that failed to flash, based on the flash condition failure response. After determining that some slave controllers cannot meet the flash condition, the master controller will not continue to send instructions to the slave controllers that failed to flash, so the delay time can be re-determined, and then the master controller will send an upgrade instruction to the gateway after the second delay time, and the gateway will only forward the upgrade instruction to the slave controllers that succeeded in the flash condition. After receiving the upgrade instruction, these controllers can start software upgrade.

[0076] The above implementation method ensures that only slave controllers that can successfully flash the conditions participate in the upgrade by checking the flashing conditions, thereby improving the software upgrade efficiency of the controller and reducing the communication load.

[0077] Optionally, after forwarding the upgrade permission instruction to the main controller so that the main controller controls the slave controller to upgrade the software after receiving the upgrade permission instruction, it also includes: the gateway receives the software verification instruction sent by the main controller, and forwards the software verification instruction to the slave controller, so that the slave controller makes a software verification response after receiving the software verification instruction; the gateway receives the software verification response sent by the slave controller, and forwards the software verification response to the main controller, so that when the main controller determines that the software verification response is a successful verification, it determines that the upgraded software of the slave controller is the target software.

[0078] The software verification instruction is used to start the self-check process of the slave controller to verify the integrity and correctness of the installed software.

[0079] For example, the gateway can receive the software verification instruction sent by the master controller, and forward the software verification instruction to the slave controller, so that after receiving the software verification instruction, the slave controller performs an internal self-check process. For example, it includes verifying whether the software version number is correct, verifying the integrity of the software file, and verifying whether the software is damaged during storage and operation. After completing the verification, the slave controller can generate a software verification response to indicate whether the software currently running on the slave controller is consistent with the expected software, that is, whether it is the target software.

[0080] For example, if the verification responses of all slave controllers indicate that the software verification is successful, the master controller can determine that the upgraded software has been successfully applied and confirm that the currently running software is the target software. If the verification response of the slave controller indicates that the software verification fails, the master controller can determine that the corresponding slave controller has an upgrade failure or software damage. At this point, the master controller can take further measures, such as re-issuing the software, restarting the upgrade process, or issuing a fault alarm, etc.

[0081] The above implementation manner, by introducing software verification instructions and responses, enables the slave controller to further verify the correctness of the upgraded software after completing the upgrade, thereby improving the reliability and maintainability of the upgrade process.

[0082] Optionally, after forwarding the upgrade permission instruction to the main controller so that the main controller controls the slave controller to upgrade the software after receiving the upgrade permission instruction, it also includes: the gateway receives the reset and restart instruction sent by the main controller, and forwards the reset and restart instruction to the slave controller, so that the slave controller makes a reset and restart response after receiving the reset and restart instruction; the gateway receives the reset and restart response sent by the slave controller, and forwards the reset and restart response to the main controller, so that the main controller determines that the upgrade of the slave controller is completed when it judges that the reset and restart response is a successful reset and restart.

[0083] For example, after the master controller completes the upgrade permission and software verification of the slave controller, it will generate a reset and restart instruction and send the instruction to all slave controllers through the gateway. Among them, the reset and restart instruction is usually triggered when the upgrade and verification of the slave controller are successful, which is used to indicate that the slave controller can work normally in the new software environment.

[0084] For example, after receiving the reset and restart instruction forwarded by the gateway, the slave controller will immediately perform the reset and restart operation and generate a reset and restart response to confirm that the reset and restart operation is successfully completed.

[0085] In the above embodiments, after the slave controller completes the software upgrade and verification successfully, it can be reset and restarted to ensure that the slave controller can successfully restart and start normal work in a new software environment. The above method can not only ensure that the upgraded software is loaded correctly, but also clear any temporary data or fault status that may occur during the upgrade process.

[0086] It should be easily appreciated by those skilled in the art that, in combination with the algorithm steps of each example described in the embodiments disclosed herein, the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0087] Example 2

[0088] Figure 2 is a schematic diagram of the structure of an upgrade device for a motor controller provided by an embodiment of the present invention, such as Figure 2 As shown, the motor controller upgrading device 200 includes an upgrading requesting module 21 and an upgrading allowing module 22 .

[0089] The upgrade request module 21 is electrically connected to the upgrade permission module 22, and is used for forwarding the upgrade request instruction to a plurality of slave controllers in response to receiving the upgrade request instruction sent by the master controller every first delay time, so that the plurality of slave controllers receive the upgrade request instruction and send the upgrade permission instruction to the upgrade permission module 22; wherein each slave controller is configured with a state machine, and the state machine is used for determining the first delay time according to the total number of slave controllers and the instruction response time;

[0090] The upgrade permission module 22 is used for receiving an upgrade permission instruction sent by the slave controller, and forwarding the upgrade permission instruction to the master controller, so that the master controller controls the slave controller to upgrade the software after receiving the upgrade permission instruction.

[0091] The upgrade request module 21 is also used to receive an upgrade permission instruction issued by the slave controller, forward the upgrade permission instruction to the main controller, so that the main controller flashes the condition check instruction after receiving the upgrade permission instruction; receive the flash condition check instruction, forward the flash condition check instruction to the slave controller, so that the slave controller sends a flash condition check response after receiving the flash condition instruction; in response to the flash condition check responses being all flash condition qualified responses, forward the flash condition qualified response to the main controller, so that the main controller sends the upgrade instruction after a first delay time, and forward the upgrade instruction to the slave controller, so that the slave controller upgrades the software after receiving the upgrade instruction.

[0092] The upgrade request module 21 is also used to respond to the flash condition check response including a flash condition failure response, and forward the flash condition failure response to the master controller, so that after receiving the flash condition failure response, the master controller determines the number of slave controllers that have failed the flash condition, and sends an upgrade instruction after a second delay time, and forwards the upgrade instruction to the slave controllers that have successfully flashed the condition, so that the slave controllers that have successfully flashed the condition upgrade the software after receiving the upgrade instruction; wherein the second delay time is determined based on the number of slave controllers that have failed the flash condition, the total number of slave controllers, and the instruction response time.

[0093] The upgrade permission module 22 is further used to receive the software verification instruction sent by the master controller, and forward the software verification instruction to the slave controller, so that the slave controller makes a software verification response after receiving the software verification instruction;

[0094] The upgrade permission module 22 is further configured to receive a software verification response sent by the slave controller, and forward the software verification response to the master controller, so that when the master controller determines that the software verification response is successful, it determines that the upgrade software of the slave controller is the target software.

[0095] The upgrade permission module 22 is further used to receive a reset and restart instruction sent by the master controller, and forward the reset and restart instruction to the slave controller, so that the slave controller makes a reset and restart response after receiving the reset and restart instruction;

[0096] The upgrade allowing module 22 is further configured to receive a reset and restart response sent by the slave controller, and forward the reset and restart response to the master controller, so that the master controller determines that the upgrade of the slave controller is completed when the reset and restart response is determined to be a reset and restart success.

[0097] Of course, the upgrading device of the motor controller provided by the embodiment of the present invention includes but is not limited to the above modules.

[0098] The motor controller upgrade device provided by the present invention can ensure that multiple slave controllers can start the upgrade process at the same time, and the delay-based control mechanism effectively avoids signal conflicts or excessive loads caused by simultaneous responses of multiple slave controllers, thereby improving the stability, reliability and upgrade efficiency of the upgrade process.

[0099] Example 3

[0100] In an embodiment of the present invention, a vehicle is further provided, the vehicle comprising: a control unit, the control unit comprising a processor and a memory. The memory is used to store computer program code, the computer program code comprising computer instructions. When the processor executes the computer instructions, the upgrading device of the motor controller executes each step performed by the upgrading device of the motor controller in the method flow shown in the above method embodiment.

[0101] Example 4

[0102] An embodiment of the present invention also provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed on an upgrade device of a motor controller, the upgrade device of the motor controller executes each step executed by the upgrade device of the motor controller in the method flow shown in the above method embodiment.

[0103] Example 5

[0104] An embodiment of the present invention also provides a computer program product, which includes computer instructions. When the computer instructions are run on an upgrade device of a motor controller, the upgrade device of the motor controller executes each step performed by the upgrade device of the motor controller in the method flow shown in the above method embodiment.

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

Claims

1. A method for upgrading a motor controller, characterized in that: The method comprises: In response to receiving the upgrade request instruction sent by the master controller every first delay time, the gateway forwards the upgrade request instruction to a plurality of slave controllers, so that the plurality of slave controllers receive the upgrade request instruction and send an upgrade permission instruction to the gateway; wherein each of the slave controllers is configured with a state machine, and the state machine is used to determine the first delay time according to the total number of the slave controllers and the instruction response time; In response to receiving the upgrade permission instruction issued by the slave controller, the gateway forwards the upgrade permission instruction to the master controller, so that the master controller controls the slave controller to upgrade software after receiving the upgrade permission instruction.

2. The method according to claim 1, characterized in that The instruction response time is the time taken by the slave controller to respond to the instruction of the master controller, and the first delay time is the quotient of the instruction response time and the total number of the slave controllers.

3. The method according to claim 1, characterized in that: In response to receiving the upgrade permission instruction issued by the slave controller, the gateway forwards the upgrade permission instruction to the master controller, so that the master controller controls the slave controller to upgrade software after receiving the upgrade permission instruction, including: In response to receiving the upgrade permission instruction sent by the slave controller, the gateway forwards the upgrade permission instruction to the master controller, so that the master controller sends a flash write condition check instruction to the gateway after receiving the upgrade permission instruction; The gateway receives the flashing condition check instruction, and forwards the flashing condition check instruction to the slave controller, so that the slave controller sends a flashing condition check response to the gateway after receiving the flashing condition instruction; In response to the flash condition check responses being all flash condition qualified responses, the gateway forwards the flash condition qualified responses to the master controller, so that the master controller sends an upgrade instruction to the gateway after the first delay time, and the gateway forwards the upgrade instruction to the slave controller, so that the slave controller upgrades the software after receiving the upgrade instruction.

4. The method according to claim 3, characterized in that After the gateway receives the flashing condition check instruction and forwards the flashing condition check instruction to the slave controller so that the slave controller sends a flashing condition check response to the gateway after receiving the flashing condition instruction, the method further includes: In response to the flash condition check response including a flash condition failure response, the gateway forwards the flash condition failure response to the master controller, so that the master controller determines the number of slave controllers that fail the flash condition after receiving the flash condition failure response, and sends an upgrade instruction to the gateway after a second delay time, and the gateway forwards the upgrade instruction to the slave controllers that succeed in the flash condition, so that the slave controllers that succeed in the flash condition upgrade their software after receiving the upgrade instruction; The second delay time is determined based on the number of slave controllers that fail the flashing condition, the total number of slave controllers, and the instruction response time.

5. The method according to claim 1, characterized in that After forwarding the upgrade permission instruction to the master controller so that the master controller controls the slave controller to upgrade the software after receiving the upgrade permission instruction, the method further includes: The gateway receives the software verification instruction sent by the master controller, and forwards the software verification instruction to the slave controller, so that the slave controller makes a software verification response after receiving the software verification instruction; The gateway receives the software verification response sent by the slave controller, and forwards the software verification response to the master controller, so that when the master controller determines that the software verification response is successful, it determines that the upgraded software of the slave controller is the target software.

6. The method according to claim 1, characterized in that After forwarding the upgrade permission instruction to the master controller so that the master controller controls the slave controller to upgrade the software after receiving the upgrade permission instruction, the method further includes: The gateway receives the reset and restart instruction sent by the master controller, and forwards the reset and restart instruction to the slave controller, so that the slave controller makes a reset and restart response after receiving the reset and restart instruction; The gateway receives the reset and restart response sent by the slave controller, and forwards the reset and restart response to the master controller, so that the master controller determines that the upgrade of the slave controller is completed when judging that the reset and restart response is a reset and restart success.

7. An upgrade device for a motor controller, characterized in that: It includes the upgrade request module and the upgrade permission module, among which: The upgrade request module is electrically connected to the upgrade permission module, and is used for forwarding the upgrade request instruction to a plurality of slave controllers in response to receiving the upgrade request instruction sent by the master controller every first delay time, so that the plurality of slave controllers receive the upgrade request instruction and send the upgrade permission instruction to the upgrade permission module; wherein each of the slave controllers is configured with a state machine, and the state machine is used for determining the first delay time according to the total number of the slave controllers and the instruction response time; The upgrade permission module is used to receive the upgrade permission instruction issued by the slave controller, and forward the upgrade permission instruction to the master controller, so that the master controller controls the slave controller to upgrade software after receiving the upgrade permission instruction.

8. A vehicle, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program codes, the computer program codes include computer instructions, and when the processor executes the computer instructions, the upgrading device of the motor controller executes the upgrading method of the motor controller as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that: include: Computer instructions, when the computer instructions are executed on the upgrading device of the motor controller, the upgrading device of the motor controller executes the upgrading method of the motor controller as described in any one of claims 1-7.

10. A computer program product, the computer program product comprising: Computer instructions, when the computer instructions are executed on a control device of a vehicle, cause the control device of the vehicle to execute the method for upgrading the motor controller as described in any one of claims 1 to 7.