Vehicle controller remote software upgrading method, system and device and diagnosis server
By establishing a connection between the diagnostic server and the message router, using the message router to periodically send heartbeat signals, creating a software update process, realizing remote software upgrade of the vehicle controller, solving the problem of relying on expensive equipment and a large number of labor in the existing technology, and achieving efficient and low-cost software upgrades.
Patent Information
- Application Number
- CN202311107313.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-30
- Publication Date
- 2025-02-28
AI Technical Summary
Existing vehicle controller software upgrade methods rely on expensive diagnostic equipment and a lot of labor, resulting in high costs and inefficiency.
By establishing a connection between the diagnostic server and the message router, using the message router to periodically send heartbeat signals, creating a software update process, including controller query sequences, preparation sequences, flash sequences and verification sequences, the remote software upgrade of the vehicle controller is realized.
The simultaneous upgrade of multi-vehicle controller software has been realized, reducing labor costs, saving the cost of diagnostic equipment, and improving the real-time and efficiency of software upgrades.
Smart Images

Figure CN119536762A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention generally relate to the field of vehicle controller diagnostic technology, and more specifically, to a method, system, device, diagnostic server and storage medium for remote software upgrade of a vehicle controller. Background Technology
[0002] The current method for upgrading vehicle controller software in the production workshop is based on diagnostic equipment such as ODIS-E (Offboard Diagnostic Information System Engineering) or MFT (Multifunction Tester). Each diagnostic device requires one person to operate and complete the software upgrade. This method places all the software computing power on the diagnostic equipment, making the equipment expensive and the upgrade and maintenance costs high; the requirement of one worker per device results in excessively high labor costs for the software upgrade process. Summary of the Invention
[0003] To address the aforementioned problems in the prior art, in a first aspect, embodiments of the present invention provide a method for remote software upgrade of a vehicle controller, the method being applied to a diagnostic server adapted to communicatively connect to one or more message routers, each of the one or more message routers being connected to a vehicle controller. The method includes: after establishing a connection with a message router, receiving a heartbeat signal periodically sent by the message router; creating a software update process corresponding to the message router, the software update process including a controller query sequence, a preparation sequence, a flashing sequence, and a verification sequence, wherein each of the controller query sequence, the preparation sequence, the flashing sequence, and the verification sequence has a sequence identifier and each includes one or more tasks, each of the one or more tasks having a task identifier; transmitting the controller query sequence to the message router so that the message router forwards the controller query sequence to the vehicle controller; receiving a controller query response from the vehicle controller to the controller query sequence sent by the message router; determining whether the software upgrade execution conditions are met based on the controller query response and predefined software upgrade execution conditions; if the software upgrade execution conditions are met, sending the preparation sequence to the message router so that the message router forwards the preparation sequence to the vehicle controller, wherein the preparation sequence includes a programming prerequisite check task and a controller setup task; receiving a software update process from the vehicle controller to the message router. The system executes the following steps: First, it checks the preconditions for the programming process and responds to the controller setup task. If the response to the programming preconditions check task indicates that the programming preconditions are met and the response to the controller setup task indicates that the controller setup is successful, it sends the flashing sequence to the message router so that the message router forwards the flashing sequence to the vehicle controller. The flashing sequence includes a data transmission task generated based on the software upgrade data to be written. Second, it sends the verification sequence to the message router so that the message router forwards the verification sequence to the vehicle controller. Third, it receives the verification response from the vehicle controller to the verification sequence. If the verification response indicates successful verification, it generates and sends a software upgrade success notification. Fourth, upon receiving communication error information from the message router, including a sequence identifier and a task identifier indicating a communication error, it locates the task with the communication error based on the sequence identifier and the task identifier. It retransmits the located task with the communication error. Fifth, if no heartbeat signal is received for a predetermined number of consecutive cycles, it destroys the software update process corresponding to that message router.
[0004] In some implementations, the controller query sequence includes a controller identity query task and a controller software version query task; the controller query response includes controller identity information and controller software version information.
[0005] In some implementations, determining whether the software upgrade execution conditions are met based on the controller query response and predefined software upgrade execution conditions includes: determining that the software upgrade execution conditions are met when the controller identity information is consistent with the controller identity defined in the software upgrade execution conditions, and the controller software version information is inconsistent with the software version defined in the software upgrade execution conditions.
[0006] In some embodiments, the method further includes: receiving cache status information sent by the packet router; if the cache status information indicates that the packet router's cache is not full, sending the next task in the software update process to the packet router; if the cache status information indicates that the packet router's cache is full, stopping sending tasks to the packet router and waiting for the next received cache status information.
[0007] In some implementations, the controller configuration task includes: a diagnostic session switching task, a diagnostic fault code setting task, and a communication control task, wherein the diagnostic session switching task is configured to extend the session; the diagnostic fault code setting task is configured to disable diagnostic fault codes; and the communication control task is configured to disable communication.
[0008] In some implementations, the write sequence further includes a diagnostic session switching task, a secure login task, an identity writing task, and a request download task, wherein the diagnostic session switching task is configured as a programming session; the secure login task is configured as a secure access algorithm; the identity writing task is configured as a digital signature; and the request download task is configured to specify the controller refresh start address and the size of the software to be written.
[0009] In some implementations, after retransmitting the identified task that experienced a communication error, the method further includes generating and sending a software upgrade failure notification after performing a predetermined number of retransmissions.
[0010] In a second aspect, embodiments of the present invention provide a remote software upgrade system for a vehicle controller, the system comprising a diagnostic server and a message router, the diagnostic server being communicatively connected to one or more message routers, each of the one or more message routers being connected to a vehicle controller.
[0011] The diagnostic server is configured to: after establishing a connection with the message router, receive heartbeat signals periodically sent by the message router; create a software update process corresponding to the message router, the software update process including a controller query sequence, a preparation sequence, a flashing sequence, and a verification sequence, wherein each of the controller query sequence, the preparation sequence, the flashing sequence, and the verification sequence has a sequence identifier and each includes one or more tasks, each of the one or more tasks having a task identifier; transmit the controller query sequence to the message router so that the message router forwards the controller query sequence to the vehicle controller; receive the controller query response from the vehicle controller to the controller query sequence sent by the message router; determine whether the software upgrade execution conditions are met based on the controller query response and predefined software upgrade execution conditions; if the software upgrade execution conditions are met, send the preparation sequence to the message router so that the message router forwards the preparation sequence to the vehicle controller, wherein the preparation sequence includes a programming prerequisite check task and a controller setup task; receive the software update process from the vehicle controller to the message router sent by the message router. The system executes the following steps: First, it checks the programming prerequisites and responds to the controller setup task. If the response to the programming prerequisites check task indicates that the programming prerequisites are met and the response to the controller setup task indicates that the controller setup is successful, it sends the write sequence to the message router so that the message router forwards the write sequence to the vehicle controller. The write sequence includes a data transmission task generated based on the software upgrade data to be written. Second, it sends the verification sequence to the message router so that the message router forwards the verification sequence to the vehicle controller. Third, it receives the verification response from the vehicle controller to the verification sequence. If the verification response indicates successful verification, it generates and sends a software upgrade success notification. Fourth, upon receiving communication error information from the message router, including a sequence identifier and a task identifier indicating a communication error, it locates the task with the communication error based on the sequence identifier and the task identifier. It retransmits the located task with the communication error. Fifth, if no heartbeat signal is received for a predetermined number of consecutive cycles, it destroys the software update process corresponding to the message router.
[0012] The message router is configured to: periodically send heartbeat signals to the diagnostic server after establishing a connection with the diagnostic server; receive the controller query sequence from the diagnostic server and forward the controller query sequence to the vehicle controller; receive the controller query response from the vehicle controller to the controller query sequence and send the controller query response to the diagnostic server; receive the preparation sequence from the diagnostic server and send the preparation sequence to the vehicle controller; receive the responses from the vehicle controller to the programming prerequisite check task and the controller setting task from the vehicle controller and send them to the diagnostic server; receive the flashing sequence from the diagnostic server and send the flashing sequence to the vehicle controller; receive the verification sequence from the diagnostic server and send the verification sequence to the vehicle controller; receive the verification response from the vehicle controller to the verification sequence and send the verification response to the diagnostic server; and send the communication error information to the diagnostic server when a negative response message is received from the vehicle controller.
[0013] In some implementations, the diagnostic server is further configured to: receive cache status information sent by the packet router; if the cache status information indicates that the packet router's cache is not full, send the next task in the software update process to the packet router; if the cache status information indicates that the packet router's cache is full, stop sending tasks to the packet router and wait for the next received cache status information. Furthermore, the packet router is further configured to: query the internal cache status of the packet router and send the cache status information to the diagnostic server; if the internal cache of the packet router is not full, write the task sent by the diagnostic server into the internal cache.
[0014] In some implementations, the diagnostic server is further configured to: generate and send a software upgrade failure notification after performing a predetermined number of retransmissions. The message router is further configured to: clear its internal cache after continuously sending a predetermined number of communication error messages.
[0015] In a third aspect, embodiments of the present invention provide a remote software upgrade device for a vehicle controller. The device is applied to a diagnostic server, which is adapted to communicatively connect to one or more message routers, each of which is connected to the vehicle controller. The device includes: a heartbeat signal receiving module configured to receive heartbeat signals periodically sent by the message routers after establishing a connection; and a software update process creation module configured to create a software update process corresponding to the message router. The software update process includes a controller query sequence, a preparation sequence, a flashing sequence, and a verification sequence, wherein the controller query sequence... The preparation sequence, the flashing sequence, and the verification sequence each have a sequence identifier and each include one or more tasks, each of the one or more tasks having a task identifier; a query sequence sending module is configured to transmit the controller query sequence to the packet router so that the packet router forwards the controller query sequence to the vehicle controller; a query response receiving module is configured to receive the controller query response from the vehicle controller to the controller query sequence sent by the packet router; a software upgrade execution condition determination module is configured to determine whether the software upgrade execution condition is met based on the controller query response and predefined software upgrade execution conditions. The system includes a preparation sequence sending module, configured to send the preparation sequence to the packet router when the software upgrade execution conditions are met, so that the packet router forwards the preparation sequence to the vehicle controller, wherein the preparation sequence includes a programming prerequisite check task and a controller setting task; a preparation sequence response receiving module, configured to receive the responses from the vehicle controller sent by the packet router to the programming prerequisite check task and the controller setting task; and a flashing sequence sending module, configured to send the flashing sequence when the response to the programming prerequisite check task indicates that the programming prerequisites are met and the response to the controller setting task indicates that the controller setting is successful. The system includes: a flashing sequence sent to the packet router, which forwards the flashing sequence to the vehicle controller; a data transmission task generated based on the software upgrade data to be written; a verification sequence sending module configured to send the verification sequence to the packet router, which forwards the verification sequence to the vehicle controller; a verification response receiving module configured to receive a verification response from the vehicle controller to the verification sequence sent by the packet router; and an upgrade success notification module configured to generate and send a software upgrade success notification if the verification response indicates successful verification.A communication error task location module is configured to, upon receiving communication error information sent by the message router, wherein the communication error information includes a sequence identifier and a task identifier indicating a communication error, locate the task that has encountered a communication error based on the sequence identifier and the task identifier; a task retransmission module is configured to retransmit the located task that has encountered a communication error; and a software update process destruction module is configured to destroy the software update process corresponding to the message router if no heartbeat signal is received for a predetermined number of consecutive cycles.
[0016] In a fourth aspect, embodiments of the present invention provide a diagnostic server, the diagnostic server including a memory and a processor, the memory storing a computer program that, when executed by the processor, implements the vehicle controller remote software upgrade method described in any of the above embodiments.
[0017] In a fifth aspect, embodiments of the present invention provide a storage medium storing computer-readable instructions that, when executed by a processor, perform the vehicle controller remote software upgrade method according to any of the above embodiments.
[0018] The vehicle controller remote software upgrade scheme proposed in this invention can upgrade the software of multiple vehicle controllers simultaneously. By utilizing a simple diagnostic device (message router) to cache the task sequence, the real-time nature of upgrading the vehicle controller software via the Internet is ensured.
[0019] The technical solution proposed in this invention allows a single worker to operate a cloud server and remotely upgrade the controller software of multiple vehicles simultaneously, saving labor costs.
[0020] This invention leverages the computing power of cloud servers and internet communication, along with the task sequence caching function and download control logic of a simple terminal diagnostic device, to ensure real-time remote controller software upgrades. This enables reliable remote controller software upgrades, saving on diagnostic equipment costs and system upgrade and maintenance costs. Attached Figure Description
[0021] The above and other objects, features, and advantages of embodiments of the present invention will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated in the drawings by way of example and not limitation, wherein:
[0022] Figure 1 A flowchart of a remote software upgrade method for a vehicle controller according to an embodiment of the present invention is shown;
[0023] Figure 2 A schematic diagram illustrating an application scenario of the vehicle controller remote software upgrade method according to an embodiment of the present invention is shown;
[0024] Figure 3 A schematic diagram of a software update process and a packet router according to an embodiment of the present invention is shown;
[0025] Figure 4 A schematic diagram of the software update process creation and destruction according to an embodiment of the present invention is shown.
[0026] Figure 5 A schematic diagram illustrating an example of a controller query sequence according to an embodiment of the present invention is shown;
[0027] Figure 6 A schematic diagram illustrating an example of a preparation sequence according to an embodiment of the present invention is shown;
[0028] Figure 7 A schematic diagram illustrating an example of a write sequence according to an embodiment of the present invention is shown;
[0029] Figure 8 A schematic diagram illustrating an example of a verification sequence according to an embodiment of the present invention is shown;
[0030] Figure 9 A schematic diagram illustrating an example of an error handling process according to an embodiment of the present invention is shown;
[0031] Figure 10 A schematic diagram illustrating an example of a communication error handling process according to an embodiment of the present invention is shown;
[0032] Figure 11 A block diagram of a vehicle controller remote software upgrade device according to an embodiment of the present invention is shown.
[0033] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation
[0034] The principles and spirit of the present invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way.
[0035] In one aspect, embodiments of the present invention provide a method for remotely upgrading the software of a vehicle controller. (See reference...) Figure 1 The diagram illustrates a flowchart of a remote software upgrade method 100 for a vehicle controller according to an embodiment of the present invention. The method is applied to a diagnostic server adapted to be communicatively connected to one or more message routers, each of which is connected to the vehicle controller.
[0036] refer to Figure 2This illustration shows a schematic diagram of an application scenario for a remote software upgrade method for a vehicle controller according to an embodiment of the present invention. Figure 2 The scenario shown includes a diagnostic server, multiple message routers, and multiple controllers. The diagnostic server is communicatively connected to the multiple message routers, and each message router is connected to all controllers in a vehicle. The message routers can connect to the internet wirelessly, for example, via Wi-Fi, 4G, or 5G, and connect to the diagnostic server via TCP / IP. Alternatively, the message routers can connect to the controllers inside the vehicle, for example, via a CAN bus or an in-vehicle Ethernet network.
[0037] When the vehicles in the workshop need to have their controller software upgraded, workers can connect the message router to the vehicle, for example, to the vehicle's OBD (On-Board Diagnostics) port.
[0038] like Figure 1 As shown, the method 100 includes steps S101-S114.
[0039] In step S101, after establishing a connection with the message router, the message router receives heartbeat signals periodically sent by the message router. For example, the message router can establish a TCP connection with the diagnostic server using the diagnostic server's IP address and port number.
[0040] In step S102, a software update process corresponding to the packet router is created. The software update process includes a controller query sequence, a preparation sequence, a flashing sequence, and a verification sequence. Each of the controller query sequence, preparation sequence, flashing sequence, and verification sequence has a sequence identifier (sequence ID) and each includes one or more tasks. Each of the one or more tasks has a task identifier (task ID).
[0041] refer to Figure 3 This diagram illustrates a software update process and a packet router according to an embodiment of the present invention. Once a TCP connection is successfully established, the diagnostic server initiates a software update process. The diagnostic server supports TCP connections to multiple packet routers and initiates multiple software update processes. Figure 3 In the example, a software update process is started for each packet router.
[0042] The software update process can include a controller query process and a software upgrade process.
[0043] The controller query process can include a controller query sequence. This sequence includes identity query tasks and software version query tasks.
[0044] The software upgrade process may include preparing the sequence, writing the sequence, and verifying the sequence.
[0045] The preparation sequence may include diagnostic session switching tasks, routine control tasks, diagnostic fault code setting tasks, communication control tasks, secure login tasks, and identity writing tasks.
[0046] The flash sequence can include diagnostic session switching tasks, secure login tasks, routine control tasks, request download tasks, data transfer tasks, and data transfer exit tasks.
[0047] Verification sequences can include routine control tasks.
[0048] The above tasks are combined into a preparation sequence, a writing sequence, and a verification sequence according to the controller's software upgrade requirements.
[0049] The software update process assigns numbered sequences to the preparation sequence, the flush sequence, and the verification sequence, i.e., sequence identifiers.
[0050] The software update process assigns numbers to tasks, that is, it assigns task identifiers.
[0051] As one embodiment of the present invention, the method may further include: receiving cache status information sent by a packet router; if the cache status information indicates that the packet router's cache is not full, sending the next task in the software update process to the packet router; if the cache status information indicates that the packet router's cache is full, stopping sending tasks to the packet router and waiting for the next received cache status information.
[0052] The software update process sends the tasks in the sequence to the packet router in the order of preparation sequence, write sequence, and verification sequence. The packet router reports whether there are any empty task slots in its task buffer. If there are empty task slots, the software update process writes the remaining tasks.
[0053] When the message router is executing a task, if the controller returns a negative response message to the message router, the message router forwards this negative response message back to the software update process; if the controller experiences a communication error, the message router forwards a communication error message back to the software update process. The software update process terminates the sequence in which this task belongs, locates the task based on the sequence number and task number, and decides to restart the sequence in which the task belongs, or the current task, based on the task.
[0054] In step S103, the controller query sequence is transmitted to the message router so that the message router forwards the controller query sequence to the vehicle controller.
[0055] In step S104, the receiving message router sends the vehicle controller's controller query response to the controller query sequence.
[0056] In step S105, based on the controller query response and the predefined software upgrade execution conditions, it is determined whether the software upgrade execution conditions are met.
[0057] In one embodiment of the present invention, the controller query sequence includes a controller identity query task and a controller software version query task. The controller query response includes controller identity information and controller software version information.
[0058] As one embodiment of the present invention, determining whether the software upgrade execution conditions are met based on the controller query response and predefined software upgrade execution conditions includes: determining that the software upgrade execution conditions are met when the controller identity information is consistent with the controller identity defined in the software upgrade execution conditions, and the controller software version information is inconsistent with the software version defined in the software upgrade execution conditions.
[0059] In step S106, if it is determined that the software upgrade execution conditions are met, a preparation sequence is sent to the message router so that the message router can forward the preparation sequence to the vehicle controller. The preparation sequence includes a programming prerequisite check task and a controller setup task.
[0060] In step S107, the receiving message router sends the vehicle controller's response to the programming prerequisite check task and the controller setup task.
[0061] As one embodiment of the present invention, the controller setting task may include: a diagnostic session switching task, a diagnostic fault code setting task, and a communication control task, wherein the diagnostic session switching task is set to extend the session; the diagnostic fault code setting task is set to disable diagnostic fault codes; and the communication control task is set to disable communication.
[0062] In step S108, if the response to the programming prerequisite check task indicates that the programming prerequisites are met and the response to the controller setting task indicates that the controller setting is successful, a flashing sequence is sent to the message router so that the message router forwards the flashing sequence to the vehicle controller. The flashing sequence includes a data transmission task, which is generated based on the software upgrade data to be written.
[0063] As one embodiment of the present invention, the flashing sequence may further include a diagnostic session switching task, a secure login task, an identity writing task, and a request download task, wherein the diagnostic session switching task is set to a programming session; the secure login task is set to a secure access algorithm; the identity writing task is set to a digital signature; and the request download task is set to the controller refresh start address and the size of the software to be written.
[0064] In step S109, a verification sequence is sent to the message router so that the message router can forward the verification sequence to the vehicle controller.
[0065] In step S110, the receiving message router sends the vehicle controller's verification response to the verification sequence.
[0066] In step S111, if the verification response indicates that the verification was successful, a software upgrade success notification is generated and sent.
[0067] In step S112, when a communication error message is received from the message router, the communication error message includes a sequence identifier and a task identifier indicating that a communication error has occurred. The task indicating that a communication error has occurred is located based on the sequence identifier and the task identifier.
[0068] In step S113, the task that has been located and experienced a communication error is retransmitted.
[0069] In step S114, if no heartbeat signal is received for a predetermined number of consecutive cycles, the software update process corresponding to the message router is destroyed. For example, if the diagnostic server loses three consecutive heartbeats, it destroys the software update process corresponding to this message router.
[0070] As one embodiment of the present invention, after retransmitting the identified task that has a communication error, the method may further include: generating and sending a software upgrade failure notification after performing a predetermined number of retransmissions.
[0071] The following section provides illustrative examples of the tasks listed above.
[0072] Identity Query Task
[0073] An identity query task includes an identity query task request message and an identity query task response message.
[0074] The request message for the identity query task uses the UDS (Unified Diagnostic Services) diagnostic service SID (Service Identifier) = 0x22; including the DID (Data Identifier), which is the controller's identity DID.
[0075] The identity query task response message is divided into positive response message and negative response message. The positive response message uses the following format: SID = 0x62, DID = controller identity DID, content = controller identity information; the negative response message uses SID = 0x7F, with the reason for the negative response.
[0076] Software version query task
[0077] The software version query task includes a software version query task request message and a software version query task response message.
[0078] The request message for the software version query task uses the UDS diagnostic service, with SID (Service Identifier) = 0x22; it includes DID (Data Identifier), which is the controller's software version DID.
[0079] The software version query task response message is divided into positive response message and negative response message. The positive response message uses the following format: SID = 0x62, DID = controller software version DID, content = controller software version information; the negative response message uses SID = 0x7F, with the reason for the negative response.
[0080] Diagnostic session switching task
[0081] The diagnostic session handover task includes a diagnostic session handover task request message and a diagnostic session handover task response message.
[0082] The request message for the diagnostic session switching task uses UDS diagnostic service SID=0x10; it includes the session type, which is divided into extended session and programming session.
[0083] Diagnostic session switching task response messages are divided into positive response messages and negative response messages. Positive response messages use the following format for this service: SID = 0x50, Session Type = the session type of the request message, Content = extended content of the session type; Negative response messages use SID = 0x7F, with the reason for the negative response.
[0084] Routine control task
[0085] Routine control tasks include routine control task request messages and routine control task response messages.
[0086] The request message for routine control tasks uses UDS diagnostic service SID=0x31, which includes the routine type, which is divided into start routine, end routine, and query routine results; the routine identification number; and parameters, which are determined according to the needs of the routine.
[0087] Routine control task response messages are divided into positive response messages and negative response messages. Positive response messages use the following format: SID = 0x71, Routine Type = the routine type of the request message, Routine Identifier = the routine identifier of the request message, and routine information and routine status record; Negative response messages use SID = 0x7F, and include the reason for the negative response.
[0088] Secure login task
[0089] The secure login task involves sending the secure login algorithm in string format to the packet router, which is then completed by the secure login module built into the packet router.
[0090] Diagnostic fault code setting task
[0091] The diagnostic fault code setting task includes a diagnostic fault code setting task request message and a diagnostic fault code setting task response message.
[0092] The request message for the diagnostic fault code setting task uses UDS diagnostic service SID=0x85; it includes the fault code setting type, which is divided into enable and disable; the parameters are determined according to the specific controller requirements.
[0093] The diagnostic fault code setting task response message is divided into positive response message and negative response message. The positive response message uses the following format: SID=0xC5, fault code setting type = fault code setting type of the request message; the negative response message uses SID=0x7F, negative response reason.
[0094] Communication control task
[0095] Communication control tasks include communication control task request messages and communication control task response messages.
[0096] The request message for the communication control task uses UDS diagnostic service SID=0x28; it includes control type, communication type, and communication node identification number.
[0097] Communication control task response messages are divided into positive response messages and negative response messages. Positive response messages use the following format: SID = 0x68, Control Type = the control type of the request message; negative response messages use SID = 0x7F, with a negative response reason.
[0098] Request download task
[0099] The download request task includes a download request task request message and a download request task response message.
[0100] The request message for the download task uses UDS diagnostic service SID=0x34; it includes data format identification, address and length format identification, data memory address and data memory size.
[0101] Communication control task response messages are divided into positive response messages and negative response messages. Positive response messages use the following format: SID = 0x74; including length format identification and maximum data block length. Negative response messages use the following format: SID = 0x7F; indicating the reason for the negative response.
[0102] Data transmission task
[0103] Data transmission tasks include data transmission task request messages and data transmission task response messages.
[0104] The request message for the data transmission task uses UDS diagnostic service SID=0x36; it includes the data block count and the data block content.
[0105] Data transmission task response messages are divided into positive response messages and negative response messages. Positive response messages use the following format: SID = 0x76; including the data block count of the sent message and transmission response parameter records. Negative response messages have SID = 0x7F and specify the reason for the negative response.
[0106] Transmission exit task
[0107] The transmission exit task includes a transmission exit task request message and a transmission exit task response message.
[0108] The request message for exiting the transmission task uses UDS diagnostic service SID=0x37; it includes the transmission request parameter record.
[0109] The transmission exit task response message is divided into a positive response message and a negative response message. The positive response message uses the positive response message of this service: SID=0x77; and includes the transmission response parameter record; the negative response message SID=0x7F, indicating the reason for the negative response.
[0110] Identity writing task
[0111] An identity writing task includes an identity writing task request message and an identity writing task response message.
[0112] The request message for the identity writing task uses UDS diagnostic service SID=0x2E; it includes data identification and data recording.
[0113] The identity writing task response message is divided into positive response messages and negative response messages. The positive response message uses the positive response message of this service: SID=0x6E; including data identification; the negative response message SID=0x7F, the reason for the negative response.
[0114] As an example of this invention, the message router has a task cache for caching tasks sent by the software update process and executing those tasks. The message router supports the UDS protocol stack, and task execution is accomplished through the UDS protocol stack. The message router determines the controller response message during task execution; if it is a negative response message, the message router clears the entire task cache.
[0115] The message router will send the result of the task execution, i.e., the controller's response message, along with the task's sequence number and task number, back to the software update process.
[0116] If a controller communication error occurs during task execution, the message router will append the task sequence number and task number to the error message and send a communication error message to the software update process.
[0117] When the software update process receives a negative response message or communication error message from a task, it queries the sequence number and task number to locate the erroneous task and decides to restart the sequence in which the task belongs or the current task based on the task.
[0118] The message router has a secure login module, which loads the secure login task of the software update process, namely the secure login code algorithm, and executes the secure login process of the UDS protocol.
[0119] The message router has a refresh data reassembly module. During data transmission, the controller informs the message router of the size of each data block transmitted. The refresh data reassembly module loads the data from the data transmission task from the task cache, reassembles it into the size of the data block to be transmitted as informed by the controller, and delivers it to the UDS protocol stack.
[0120] The UDS protocol stack handles message sending and receiving during tasks. It includes the UDS protocol layer, session layer, network transport layer, data link layer, and physical layer, and supports CAN (Controller Area Network), CANFD (Controller Area Network Flexible Data Rate), and DOIP (Diagnostic communication over Internet Protocol) communication.
[0121] The TCP / IP protocol stack is used for communication between the packet router and the software update process, and to complete the task exchange with the software update process.
[0122] refer to Figure 4 It illustrates a schematic diagram of the software update process creation and destruction process according to an embodiment of the present invention.
[0123] After the message router connects to the vehicle, it is powered by the vehicle.
[0124] After the message router is powered on, it connects to the diagnostic server. First, it connects to the workshop's Wi-Fi hotspot. After a successful connection, it reads the diagnostic server's IP address and port number from its own solid-state storage and makes a TCP connection request.
[0125] After receiving the TCP connection request from the router, the diagnostic server establishes a software update process and performs the TCP connection establishment during the software update process.
[0126] The message router sends heartbeats periodically via TCP connection.
[0127] The diagnostic server monitors whether the heartbeat of the packet router has timed out. If it has, it means that the packet router has been disconnected from the vehicle, and the diagnostic server destroys the software update process corresponding to this packet router.
[0128] refer to Figure 5 The diagram illustrates an example of a controller query sequence according to an embodiment of the present invention.
[0129] Once the software update process is complete, workers can see the message router is online on the diagnostic server client. They can then initiate the corresponding vehicle controller refresh process by clicking the button on the client. After the "Start Controller Refresh" button is clicked:
[0130] The corresponding software update process sets the controller identity query task to query the controller part number;
[0131] The corresponding software update process is set to query software version as the software version query task;
[0132] The corresponding software update process combines the controller identity query task and the software version query task into a controller query sequence, and sends it to the packet router via a TCP connection;
[0133] The message router checks if its cache is full. If it is, it returns a message informing the software update process to wait. If it is not full, it writes the controller query sequence into the cache.
[0134] If the software update process is notified that the cache is full, it waits for the message router to inform it that the cache is not full before continuing to send the controller query sequence;
[0135] After sending, wait and check if the sequence has finished executing. If not, continue waiting.
[0136] The message router reads the controller identity query task and sends a UDS request message with SID=0x22 according to the task content.
[0137] After receiving the request message, the controller sends back a response message with SID=0x62;
[0138] After receiving the response message, the message router attaches the task ID and sequence ID to the message and sends it back to the software update process;
[0139] The message router reads the software version query task and sends a UDS request message with SID=0x22 according to the task content.
[0140] After receiving the request message, the controller sends back a response message with SID=0x62;
[0141] After receiving the response message, the message router attaches the task ID and sequence ID to the message and sends it back to the software update process;
[0142] The software update process verifies the controller part number and software version according to the task settings.
[0143] If the controller part numbers are the same but the software versions are different, the software update process will prepare for a refresh.
[0144] Otherwise, the diagnostic server informs the user on the client side to abandon the refresh.
[0145] refer to Figure 6 The diagram illustrates an example of a preparation sequence according to an embodiment of the present invention.
[0146] The controller part numbers are the same, but the software versions are different, indicating that the software update process has entered the preparation stage for flashing. The flashing preparation process includes:
[0147] The corresponding software update process is configured to switch the diagnostic session to an extended session.
[0148] The corresponding software update process is configured to control the routine task by checking programming prerequisites.
[0149] The corresponding software update process settings, diagnostic fault code settings, and task settings are disabled.
[0150] The corresponding software update process sets the communication control task to disable communication;
[0151] The corresponding software update process will cause the controller to combine the above tasks into a preparation sequence and send it to the packet router via a TCP connection;
[0152] The message router checks if its cache is full. If it is, it returns a message informing the software update process to wait. If it is not full, it writes the controller query sequence into the cache.
[0153] If the software update process is notified that the cache is full, it waits for the message router to inform it that the cache is not full before continuing to send the controller query sequence;
[0154] After sending, wait and check if the sequence has finished executing. If not, continue waiting.
[0155] The message router reads the diagnostic session handover task and sends a UDS request message with SID=0x10 according to the task content.
[0156] After receiving the request message, the controller sends back a response message with SID=0x50;
[0157] After receiving the response message, the message router attaches the task ID and sequence ID to the message and sends it back to the software update process;
[0158] The message router reads the routine control task and sends a UDS request message with SID=0x31 according to the task content.
[0159] After receiving the request message, the controller sends back a response message with SID=0x71;
[0160] After receiving the response message, the message router attaches the task ID and sequence ID to the message and sends it back to the software update process;
[0161] The message router reads the diagnostic fault code and sets the task. Based on the task content, it sends a UDS request message with SID=0x85.
[0162] After receiving the request message, the controller sends back a response message with SID=0xC5;
[0163] After receiving the response message, the message router attaches the task ID and sequence ID to the message and sends it back to the software update process;
[0164] The message router reads the communication control task and sends a UDS request message with SID=0x28 according to the task content.
[0165] After receiving the request message, the controller sends back a response message with SID=0x68;
[0166] After receiving the response message, the message router attaches the task ID and sequence ID to the message and sends it back to the software update process;
[0167] The software update process waits for the preparation sequence to complete before executing the refresh sequence.
[0168] refer to Figure 7 It shows a schematic diagram of an example of a brush sequence according to an embodiment of the present invention.
[0169] After the preparation sequence of the software update process is completed, the flush sequence will begin, which includes:
[0170] The corresponding software update process is configured to switch the diagnostic session task to the programming session;
[0171] The corresponding software update process sets the secure login task to the appropriate secure access algorithm.
[0172] The corresponding software update process sets the identity writing task to digital signature;
[0173] The corresponding software update process is set to request the download task to be the controller refresh start address and the size of the new software;
[0174] The corresponding software update process sets up multiple data transfer tasks, with each task having a data size of 16K.
[0175] Once all the content of the new software is set as a data transfer task, the data transfer task setup is complete.
[0176] The corresponding software update process will cause the controller to combine the above tasks into a preparation sequence and send it to the packet router via a TCP connection;
[0177] The message router checks if its cache is full. If it is, it returns a message informing the software update process to wait. If it is not full, it writes the controller query sequence into the cache.
[0178] If the software update process is notified that the cache is full, it waits for the message router to inform it that the cache is not full before continuing to send the controller query sequence;
[0179] After sending, wait and check if the sequence has finished executing. If not, continue waiting.
[0180] The message router reads the diagnostic session handover task and sends a UDS request message with SID=0x10 according to the task content.
[0181] After receiving the request message, the controller sends back a response message with SID=0x50;
[0182] After receiving the response message, the message router attaches the task ID and sequence ID to the message and sends it back to the software update process;
[0183] The message router reads the secure login task, requests a secure access seed from the controller based on the algorithm in the task, and the controller returns the secure access seed. The message router substitutes the seed into the algorithm to calculate the key and sends the key to the controller. The controller verifies whether the message router's key is valid. If valid, it sends a positive response message; otherwise, it sends a negative response message.
[0184] After receiving the response message, the message router attaches the task ID and sequence ID to the message and sends it back to the software update process;
[0185] The message router reads the identity and writes the task, and sends a UDS request message with SID=0x2E according to the task content;
[0186] After receiving the request message, the controller sends back a response message with SID = 0x6E;
[0187] After receiving the response message, the message router attaches the task ID and sequence ID to the message and sends it back to the software update process;
[0188] The message router reads the request to download the task and sends a UDS request message with SID=0x34 according to the task content.
[0189] After receiving the request message, the controller sends back a response message with SID=0x74;
[0190] After receiving the response message, the message router attaches the task ID and sequence ID to the message and sends it back to the software update process;
[0191] The message router reads the data transmission task, converts the 16KB data into a size that the controller can receive for each data transmission, such as 4KB. Then it sends a UDS request message with SID=0x36;
[0192] After receiving the request message, the controller sends back a response message with SID=0x76;
[0193] After receiving the response message, the message router determines whether the current data transmission task has been completed. If it has, it reads the new data transmission task. If it has not been completed, it continues to read the remaining data of the original data transmission task. If the remaining data is not enough for one data transmission, it reads the new data transmission task.
[0194] If there is no data transmission task, the message router will send the task ID, sequence ID, and execution result back to the software update process.
[0195] The software update process waits for the flashing sequence to complete, and then executes the verification sequence.
[0196] refer to Figure 8 The diagram illustrates an example of a verification sequence according to an embodiment of the present invention.
[0197] After the software update process completes the write sequence, it proceeds to the verification sequence, which includes:
[0198] The corresponding software update process is configured to control the routine task by checking memory.
[0199] The corresponding software update process is configured to control the application by checking its application.
[0200] The corresponding software update process will cause the controller to combine the above tasks into a preparation sequence and send it to the packet router via a TCP connection;
[0201] The message router checks if its cache is full. If it is, it returns a message informing the software update process to wait. If it is not full, it writes the controller query sequence into the cache.
[0202] If the software update process is notified that the cache is full, it waits for the message router to inform it that the cache is not full before continuing to send the controller query sequence;
[0203] After sending, wait and check if the sequence has finished executing. If not, continue waiting.
[0204] The message router reads the routine control task and sends a UDS request message with SID=0x31 according to the task content.
[0205] After receiving the request message, the controller sends back a response message with SID=0x71;
[0206] After receiving the response message, the message router attaches the task ID and sequence ID to the message and sends it back to the software update process;
[0207] The message router reads the routine control task and sends a UDS request message with SID=0x31 according to the task content.
[0208] After receiving the request message, the controller sends back a response message with SID=0x71;
[0209] After receiving the response message, the message router attaches the task ID and sequence ID to the message and sends it back to the software update process;
[0210] The software update process waits for the verification sequence to complete before notifying the user controller that the software refresh operation was successful.
[0211] refer to Figure 9 The diagram illustrates an example of an error handling process according to an embodiment of the present invention.
[0212] When a message router is performing a task, if the controller sends a negative response message, the message router needs to execute an error handling procedure. This includes:
[0213] Clear all tasks in the cache;
[0214] The system reports the error execution results to the software update process, including the sequence ID, task ID, and negative response message content.
[0215] After receiving an incorrect execution result, the software update process notifies the user that the refresh operation failed.
[0216] refer to Figure 10 The diagram illustrates an example of a communication error handling process according to an embodiment of the present invention.
[0217] When a message router is performing its tasks, if the UDS protocol stack detects a communication error, including physical communication line breaks, short circuits, or communication frame errors; or transport layer and session layer timeouts, the message router needs to execute an error handling procedure. This includes:
[0218] Retransmit the message for the current task;
[0219] Check if communication has been restored. If it has, continue executing the task.
[0220] If the transmission is not restored, continue to retransmit. If the number of retransmissions reaches 3, the communication is considered to be an unrecoverable error.
[0221] Clear all tasks in the cache;
[0222] The system reports the error execution results to the software update process, including the sequence ID, task ID, and negative response message content.
[0223] After receiving an incorrect execution result, the software update process notifies the user that the refresh operation failed.
[0224] In another aspect, embodiments of the present invention provide a remote software upgrade system for a vehicle controller, the system comprising a diagnostic server and a message router, the diagnostic server being communicatively connected to one or more message routers, each of the one or more message routers being connected to the vehicle controller.
[0225] The diagnostic server is used for:
[0226] After establishing a connection with the message router, it receives heartbeat signals periodically sent by the message router;
[0227] Create a software update process corresponding to the packet router. The software update process includes a controller query sequence, a preparation sequence, a flashing sequence, and a verification sequence. Each of the controller query sequence, preparation sequence, flashing sequence, and verification sequence has a sequence identifier and each includes one or more tasks. Each of the one or more tasks has a task identifier.
[0228] The controller query sequence is transmitted to the message router so that the message router can forward the controller query sequence to the vehicle controller;
[0229] The receiving router sends the vehicle controller's query response to the controller query sequence;
[0230] Based on the controller query response and the predefined software upgrade execution conditions, determine whether the software upgrade execution conditions are met;
[0231] Once it is determined that the conditions for software upgrade execution are met, a preparation sequence is sent to the message router so that the message router can forward the preparation sequence to the vehicle controller. The preparation sequence includes a programming prerequisite check task and a controller setup task.
[0232] The receiving router sends the vehicle controller's response to the programming prerequisite check task and controller setup task.
[0233] If the response to the programming prerequisite check task indicates that the programming prerequisites are met and the response to the controller setup task indicates that the controller setup is successful, a flash sequence is sent to the message router so that the message router forwards the flash sequence to the vehicle controller. The flash sequence includes a data transmission task, which is generated based on the software upgrade data to be written.
[0234] Send a check sequence to the message router so that the message router can forward the check sequence to the vehicle controller;
[0235] The receiving router sends the vehicle controller's verification response to the verification sequence;
[0236] If the verification response indicates that the verification was successful, a software upgrade success notification will be generated and sent.
[0237] When a communication error message is received from a message router, the message includes a sequence identifier and a task identifier indicating that a communication error has occurred. The task that caused the communication error is located based on the sequence identifier and the task identifier.
[0238] Retransmit the task that has been identified as having a communication error;
[0239] If no heartbeat signal is received for a predetermined number of consecutive cycles, the software update process corresponding to the router of that message is destroyed.
[0240] Message routers are used for:
[0241] After establishing a connection with the diagnostic server, it periodically sends heartbeat signals to the diagnostic server;
[0242] Receive controller query sequences from the diagnostic server and forward them to the vehicle controller;
[0243] Receive the controller query response from the vehicle controller to the controller query sequence, and send the controller query response to the diagnostic server;
[0244] Receive the preparation sequence from the diagnostic server and send the preparation sequence to the vehicle controller;
[0245] Receive the vehicle controller's response to the programming prerequisite check task and controller setup task from the vehicle controller, and send them to the diagnostic server;
[0246] Receive the flash sequence from the diagnostic server and send the flash sequence to the vehicle controller;
[0247] Receive the verification sequence from the diagnostic server and send the verification sequence to the vehicle controller;
[0248] Receive the vehicle controller's verification response to the verification sequence from the vehicle controller, and send the verification response to the diagnostic server;
[0249] Upon receiving a negative response message from the vehicle controller, a communication error message is sent to the diagnostic server.
[0250] In one embodiment of the present invention, the diagnostic server is further configured to: receive cache status information sent by the packet router; if the cache status information indicates that the packet router's cache is not full, send the next task in the software update process to the packet router; if the cache status information indicates that the packet router's cache is full, stop sending tasks to the packet router and wait for the next received cache status information. The packet router is further configured to: query the internal cache status of the packet router and send the cache status information to the diagnostic server; if the internal cache of the packet router is not full, write the task sent by the diagnostic server into the internal cache.
[0251] In one embodiment of the present invention, the diagnostic server is further configured to: generate and send a software upgrade failure notification after performing a predetermined number of retransmissions. The message router is further configured to: clear its internal cache after continuously sending a predetermined number of communication error messages.
[0252] In another aspect, embodiments of the present invention provide a remote software upgrade device for a vehicle controller. (See reference...) Figure 11 The diagram illustrates a block diagram of a remote software upgrade apparatus for a vehicle controller according to an embodiment of the present invention. The apparatus is used with a diagnostic server adapted to communicatively connect to one or more message routers, each of which is connected to a vehicle controller. The apparatus includes modules 1101-1114.
[0253] The heartbeat signal receiving module 1101 can be configured to receive heartbeat signals periodically sent by the message router after establishing a connection with the message router.
[0254] The software update process creation module 1102 can be configured to create a software update process corresponding to the packet router. The software update process includes a controller query sequence, a preparation sequence, a flashing sequence, and a verification sequence. Each of the controller query sequence, preparation sequence, flashing sequence, and verification sequence has a sequence identifier and includes one or more tasks. Each of the one or more tasks has a task identifier.
[0255] The query sequence sending module 1103 can be configured to transmit controller query sequences to a message router so that the message router can forward the controller query sequences to the vehicle controller.
[0256] The query response receiving module 1104 can be configured to receive the controller query response to the controller query sequence sent by the message router.
[0257] The software upgrade execution condition determination module 1105 can be configured to determine whether the software upgrade execution conditions are met based on the controller query response and predefined software upgrade execution conditions.
[0258] The preparation sequence sending module 1106 can be configured to send a preparation sequence to the message router when it is determined that the software upgrade execution conditions are met, so that the message router forwards the preparation sequence to the vehicle controller. The preparation sequence includes a programming prerequisite check task and a controller setup task.
[0259] The sequence response receiving module 1107 can be configured to receive responses from the vehicle controller to programming prerequisite check tasks and controller setting tasks sent by the message router.
[0260] The flash sequence sending module 1108 can be configured to send a flash sequence to the message router when the response to the programming prerequisite check task indicates that the programming prerequisites are met and the response to the controller setting task indicates that the controller setting is successful, so that the message router forwards the flash sequence to the vehicle controller. The flash sequence includes a data transmission task, which is generated based on the software upgrade data to be written.
[0261] The verification sequence sending module 1109 can be configured to send a verification sequence to the message router so that the message router can forward the verification sequence to the vehicle controller.
[0262] The verification response receiving module 1110 can be configured to receive the verification response of the vehicle controller to the verification sequence sent by the message router.
[0263] The upgrade success notification module 1111 can be configured to generate and send a software upgrade success notification when the verification response indicates that the verification was successful.
[0264] The communication error task location module 1112 can be configured to locate the task that caused the communication error when it receives communication error information sent by the message router, wherein the communication error information includes a sequence identifier and a task identifier of the communication error.
[0265] The task retransmission module 1113 can be configured to retransmit the identified task that has encountered a communication error.
[0266] The software update process destruction module 1114 can be configured to destroy the software update process corresponding to the packet router when no heartbeat signal is received for a predetermined number of consecutive cycles.
[0267] It should be noted that the functions implemented by each module in the vehicle controller remote software upgrade device proposed in the embodiments of the present invention correspond one-to-one with each step of the vehicle controller remote software upgrade method described above. For specific implementation methods, examples and beneficial effects, please refer to the description of the method above.
[0268] In another aspect, embodiments of the present invention provide a diagnostic server, which includes a memory and a processor. The memory stores a computer program that, when executed by the processor, implements the vehicle controller remote software upgrade method described in any of the foregoing embodiments.
[0269] In another aspect, embodiments of the present invention provide a storage medium storing computer-readable instructions that, when executed by a processor, perform the vehicle controller remote software upgrade method described according to any of the foregoing embodiments.
[0270] The vehicle controller remote software upgrade scheme proposed in this invention can upgrade the software of multiple vehicle controllers simultaneously. By utilizing a simple diagnostic device (message router) to cache the task sequence, the real-time nature of upgrading the vehicle controller software via the Internet is ensured.
[0271] The technical solution proposed in this invention allows a single worker to operate a cloud server and remotely upgrade the controller software of multiple vehicles simultaneously, saving labor costs.
[0272] This invention leverages the computing power of cloud servers and internet communication, along with the task sequence caching function and download control logic of a simple terminal diagnostic device, to ensure real-time remote controller software upgrades. This enables reliable remote controller software upgrades, saving on diagnostic equipment costs and system upgrade and maintenance costs.
[0273] The foregoing description of embodiments of the invention has been given for illustrative purposes and is not exhaustive, nor is it intended to limit the invention to the exact forms disclosed. Those skilled in the art will understand that various changes can be made without departing from the scope of the invention, and elements therein can be substituted with equivalents. Furthermore, many modifications can be made to adapt particular situations or materials to the teachings of the invention without departing from the basic scope of the invention. Therefore, the invention is not intended to be limited to the specific embodiments disclosed as the best mode contemplated for carrying out the invention; the invention will include all embodiments falling within the scope of the appended claims.
Claims
1. A method for remote software upgrade of a vehicle controller, the method being applied to a diagnostic server, the diagnostic server being adapted to be communicatively connected to one or more message routers, each of the one or more message routers being connected to a vehicle controller, the method comprising: After establishing a connection with a message router, receiving a heartbeat signal periodically sent by the message router; Creating a software update process corresponding to the message router, the software update process comprising a controller query sequence, a preparation sequence, a flash sequence and a verification sequence, wherein the controller query sequence, the preparation sequence, the flash sequence and the verification sequence each have a sequence identifier and each include one or more tasks, each of the one or more tasks each having a task identifier; transmitting the controller query sequence to the message router so that the message router forwards the controller query sequence to the vehicle controller; receiving a controller query response of the vehicle controller to the controller query sequence sent by the message router; Determining whether a software upgrade execution condition is satisfied according to the controller query response and a predefined software upgrade execution condition; In the case of determining that the software upgrade execution condition is satisfied, sending the preparation sequence to the message router so that the message router forwards the preparation sequence to the vehicle controller, wherein the preparation sequence includes a programming prerequisite check task and a controller setup task; receiving a response of the vehicle controller to the programming prerequisite check task and the controller setting task sent by the message router; When the response to the programming prerequisite check task indicates that the programming prerequisite is satisfied and the response to the controller setting task indicates that the controller setting is successful, sending the flash sequence to the message router so that the message router forwards the flash sequence to the vehicle controller, wherein the flash sequence includes a data transmission task, and the data transmission task is generated according to the software upgrade data to be written; sending the check sequence to the message router so that the message router forwards the check sequence to the vehicle controller; receiving a verification response of the vehicle controller to the verification sequence sent by the message router; If the verification response indicates that the verification is successfully performed, generating and sending a software upgrade success notification; Upon receiving the communication error information sent by the message router, wherein the communication error information includes a sequence identifier and a task identifier where the communication error occurs, locating the task where the communication error occurs according to the sequence identifier and the task identifier; Retransmitting the located task with communication error; When the heartbeat signal is not received for a predetermined number of consecutive cycles, the software update process corresponding to the message router is destroyed.
2. The method according to claim 1, characterized in that The controller query sequence includes a controller identity query task and a controller software version query task; The controller query response includes controller identity information and controller software version information.
3. The method according to claim 2, characterized in that Determining whether the software upgrade execution condition is satisfied according to the controller query response and the predefined software upgrade execution condition includes: When the controller identity information is consistent with the controller identity defined in the software upgrade execution condition, and the controller software version information is inconsistent with the software version defined in the software upgrade execution condition, it is determined that the software upgrade execution condition is satisfied.
4. The method according to claim 1, characterized in that The method further comprises: Receiving cache status information sent by the message router; When the cache status information indicates that the message router cache is not full, sending the next task in the software update process to the message router; When the buffer status information indicates that the buffer of the message router is full, the sending of tasks to the message router is stopped, and the next received buffer status information is waited for.
5. The method according to claim 1, characterized in that The controller setting tasks include: diagnostic session switching tasks, diagnostic fault code setting tasks and communication control tasks, wherein: The diagnostic session switching task is set to an extended session; The diagnostic trouble code setting task is set to disable the diagnostic trouble code; The communication control task is set to prohibit communication.
6. The method according to claim 1, characterized in that The flash sequence also includes a diagnostic session switching task, a secure login task, an identity writing task, and a download request task, wherein: The diagnostic session switching task is set to a programming session; The secure login task is set as a secure access algorithm; The identity writing task is set to be a digital signature; The download request task is set to the controller refresh start address and the size of the software to be written.
7. The method according to claim 1, characterized in that After retransmitting the located task with the communication error, the method further includes: After performing a predetermined number of retransmissions, a software upgrade failure notification is generated and sent.
8. A vehicle controller remote software upgrade system, the system comprising a diagnostic server and a message router, the diagnostic server is communicatively connected to one or more message routers, each of the one or more message routers is connected to the vehicle controller, The diagnostic server is used for: After establishing a connection with a message router, receiving a heartbeat signal periodically sent by the message router; A software update process corresponding to the message router is created, wherein the software update process includes a controller query sequence, a preparation sequence, a flash sequence, and a verification sequence, wherein: The controller query sequence, the preparation sequence, the flash sequence, and the verification sequence each have a sequence identifier and each include one or more tasks, each of the one or more tasks each having a task identifier; transmitting the controller query sequence to the message router so that the message router forwards the controller query sequence to the vehicle controller; receiving a controller query response of the vehicle controller to the controller query sequence sent by the message router; Determining whether a software upgrade execution condition is satisfied according to the controller query response and a predefined software upgrade execution condition; In the case of determining that the software upgrade execution condition is satisfied, sending the preparation sequence to the message router so that the message router forwards the preparation sequence to the vehicle controller, wherein the preparation sequence includes a programming prerequisite check task and a controller setup task; receiving a response of the vehicle controller to the programming prerequisite check task and the controller setting task sent by the message router; When the response to the programming prerequisite check task indicates that the programming prerequisite is satisfied and the response to the controller setting task indicates that the controller setting is successful, sending the flash sequence to the message router so that the message router forwards the flash sequence to the vehicle controller, wherein the flash sequence includes a data transmission task, and the data transmission task is generated according to the software upgrade data to be written; sending the check sequence to the message router so that the message router forwards the check sequence to the vehicle controller; receiving a verification response of the vehicle controller to the verification sequence sent by the message router; If the verification response indicates that the verification is successfully performed, generating and sending a software upgrade success notification; Upon receiving the communication error information sent by the message router, wherein the communication error information includes a sequence identifier and a task identifier where the communication error occurs, locating the task where the communication error occurs according to the sequence identifier and the task identifier; Retransmitting the located task with communication error; When no heartbeat signal is received for a predetermined number of consecutive cycles, the software update process corresponding to the message router is destroyed. The message router is used for: After establishing a connection with the diagnostic server, periodically sending a heartbeat signal to the diagnostic server; receiving the controller query sequence from the diagnostic server and forwarding the controller query sequence to a vehicle controller; receiving a controller query response from the vehicle controller to the controller query sequence, and sending the controller query response to the diagnostic server; receiving the preparation sequence from the diagnostic server and sending the preparation sequence to the vehicle controller; receiving a response from the vehicle controller to the programming prerequisite check task and the controller setup task from the vehicle controller and sending it to the diagnostic server; receiving the flash sequence from the diagnostic server and sending the flash sequence to the vehicle controller; receiving the verification sequence from the diagnostic server and sending the verification sequence to the vehicle controller; receiving a verification response from the vehicle controller to the verification sequence from the vehicle controller, and sending the verification response to the diagnostic server; When a negative response message is received from the vehicle controller, the communication error information is sent to the diagnostic server.
9. The system according to claim 8, characterized in that The diagnostic server is also used for: Receiving cache status information sent by the message router; When the cache status information indicates that the message router cache is not full, sending the next task in the software update process to the message router; When the cache status information indicates that the packet router cache is full, stop sending tasks to the packet router and wait for the next cache status information received, and The message router is also used for: Querying the internal cache status of the message router and sending the cache status information to the diagnostic server; When the internal cache of the message router is not full, the task sent by the diagnosis server is written into the internal cache.
10. The system according to claim 8, characterized in that The diagnostic server is further configured to: generate and send a software upgrade failure notification after executing a predetermined number of retransmissions; The message router is also used for clearing the internal cache of the message router after sending communication error information for a predetermined number of consecutive times.
11. A vehicle controller remote software upgrade device, the device is applied to a diagnostic server, the diagnostic server is adapted to be communicatively connected to one or more message routers, each of the one or more message routers is connected to a vehicle controller, the device comprising: A heartbeat signal receiving module, configured to receive a heartbeat signal periodically sent by the message router after establishing a connection with the message router; a software update process creation module, configured to create a software update process corresponding to the message router, wherein the software update process includes a controller query sequence, a preparation sequence, a flash sequence, and a verification sequence, wherein the controller query sequence, the preparation sequence, the flash sequence, and the verification sequence each have a sequence identifier and each include one or more tasks, and each of the one or more tasks each have a task identifier; a query sequence sending module configured to transmit the controller query sequence to the message router so that the message router forwards the controller query sequence to the vehicle controller; a query response receiving module, configured to receive a controller query response of the vehicle controller to the controller query sequence sent by the message router; a software upgrade execution condition determination module, configured to determine whether a software upgrade execution condition is satisfied according to the controller query response and a predefined software upgrade execution condition; a preparation sequence sending module, configured to send the preparation sequence to the message router when it is determined that the software upgrade execution condition is satisfied, so that the message router forwards the preparation sequence to the vehicle controller, wherein the preparation sequence includes a programming prerequisite check task and a controller setting task; preparing a sequence response receiving module, configured to receive a response of the vehicle controller to the programming prerequisite check task and the controller setting task sent by the message router; a flash sequence sending module, configured to send the flash sequence to the message router when the response to the programming prerequisite check task indicates that the programming prerequisite is satisfied and the response to the controller setting task indicates that the controller setting is successful, so that the message router forwards the flash sequence to the vehicle controller, wherein the flash sequence includes a data transmission task, and the data transmission task is generated according to the software upgrade data to be written; a check sequence sending module, configured to send the check sequence to the message router, so that the message router forwards the check sequence to the vehicle controller; A verification response receiving module, configured to receive a verification response of the vehicle controller to the verification sequence sent by the message router; An upgrade success notification module, configured to generate and send a software upgrade success notification when the verification response indicates that the verification is successfully executed; A communication error task locating module, configured to locate the task where the communication error occurs according to the sequence identifier and the task identifier when receiving the communication error information sent by the message router, wherein the communication error information includes a sequence identifier and a task identifier where the communication error occurs; A task retransmission module, configured to retransmit the located task with communication error; The software update process destroying module is configured to destroy the software update process corresponding to the message router when no heartbeat signal is received for a predetermined number of consecutive cycles.
12. A diagnostic server, characterized in that: The diagnostic server includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the vehicle controller remote software upgrade method according to any one of claims 1 to 7 is implemented.
13. A storage medium storing computer-readable instructions, which, when executed by a processor, executes the vehicle controller remote software upgrade method according to any one of claims 1 to 7.
Citation Information
Cited By
Multi-motor controller program updating method and system based on CAN communication
CN120743309A
A method and system for updating the program of a multi-motor controller based on CAN communication
CN120743309B