CN106375175B - Method and system for flashing electronic control unit for automobile diagnosis - Google Patents
Method and system for flashing electronic control unit for automobile diagnosis Download PDFInfo
- Publication number
- CN106375175B CN106375175B CN201611015981.2A CN201611015981A CN106375175B CN 106375175 B CN106375175 B CN 106375175B CN 201611015981 A CN201611015981 A CN 201611015981A CN 106375175 B CN106375175 B CN 106375175B
- Authority
- CN
- China
- Prior art keywords
- target
- bus
- diagnosis
- upper computer
- ethernet
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40169—Flexible bus arrangements
- H04L12/40176—Flexible bus arrangements involving redundancy
- H04L12/40189—Flexible bus arrangements involving redundancy by using a plurality of bus systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40267—Bus for use in transportation systems
- H04L2012/40273—Bus for use in transportation systems the transportation system being a vehicle
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention provides a method and a system for automobile diagnosis and flash of an electronic control unit, wherein the method comprises the following steps: the upper computer sends diagnosis flash instruction data to the lower computer through an Ethernet bus, wherein the diagnosis flash instruction data carries CAN messages used for diagnosis flash and at least two target CAN bus IDs; the lower computer receives the diagnosis flash instruction data, extracts CAN messages in the data, and respectively sends the CAN messages to at least two target CAN buses according to the target CAN bus IDs; the lower computer receives the returned CAN response message, packages the CAN response message into an Ethernet data frame and sends the Ethernet data frame to the upper computer through an Ethernet bus; the upper computer receives the Ethernet data frame, extracts the CAN response message from the Ethernet data frame and processes the CAN response message; the upper computer and the lower computer communicate through a User Datagram Protocol (UDP). The invention CAN simultaneously write the electronic control units on the multi-path CAN bus in a flashing way, thereby improving the production efficiency.
Description
Technical Field
The invention belongs to the technical field of automobiles, and particularly relates to a method and a system for automobile diagnosis and flash of an electronic control unit.
Background
When an automobile is produced off line, the speed of diagnosing and writing an Electronic Control Unit (ECU) on the whole automobile seriously influences the production rhythm. At present, the communication technology between the Ethernet and the CAN bus network is mature, and in the aspect of automobile diagnosis and writing, more devices are used, such as CANoe of Vector company, Vehicle Spy of IntrepidCS company and various after-sales diagnostic instruments. The diagnosis equipment supports both wired Ethernet and wireless Ethernet to diagnose and write the ECU on the CAN line, but basically does not support the function of writing and writing the ECUs on the multiple CAN lines simultaneously, and the main reasons are that the algorithm for writing and writing the multiple CAN lines simultaneously is complex, the cost expense and the difficulty in realizing the software stability are increased due to the complexity, and the like.
Although only a single ECU in the same CAN network CAN be flashed at the same time due to CAN bus communication characteristics and diagnostic flash protocols, simultaneous flashing is possible if the ECUs are in different CAN networks. At present, CAN bus communication networks of most vehicle types are composed of a plurality of CAN lines. On the premise of the current situation, if the diagnostic equipment does not support simultaneous writing of multiple CAN lines, the production speed is greatly reduced.
Disclosure of Invention
The invention aims to solve the technical problem of providing a method and a system for flashing an electronic control unit for automobile diagnosis, which CAN simultaneously flash the electronic control unit on a plurality of paths of CAN buses and improve the production efficiency.
In order to solve the technical problem, the invention provides a method for automobile diagnosis to flash an electronic control unit, which comprises the following steps:
step S1, the upper computer sends diagnosis flash instruction data to the lower computer through the Ethernet bus, wherein the diagnosis flash instruction data carries CAN messages used for diagnosis flash and at least two target CAN bus IDs;
step S2, the lower computer receives the diagnosis flash instruction data, extracts the CAN messages in the diagnosis flash instruction data, and respectively sends the CAN messages to at least two target CAN buses according to the target CAN bus IDs;
step S3, the lower computer receives CAN response messages returned by the at least two target CAN buses, packages the CAN response messages into Ethernet data frames and sends the Ethernet data frames to the upper computer through the Ethernet buses;
step S4, the upper computer receives the Ethernet data frame, extracts the CAN response message from the Ethernet data frame and processes the CAN response message;
the upper computer and the lower computer communicate through a User Datagram Protocol (UDP).
Wherein, before the step S1, the method further includes:
the upper computer sets the IP address and the port number intercepted by the lower computer through Ethernet connection, and the IP address and the port number are used for intercepting the diagnosis flashing instruction data from the upper computer by the lower computer.
Wherein, before the step S1, the method further includes:
and the upper computer is respectively configured with diagnosis flashing instruction data parameters for flashing ECUs on at least two CAN buses, wherein the diagnosis flashing instruction data parameters comprise a flashing target file path, a target CAN bus ID, a target electronic control unit ECU and a flashing data segment size.
Wherein the method further comprises:
and the upper computer registers the corresponding relation between the address of the received message queue of the write-once task and the ID of the target CAN bus in the global mapping relation record table.
In step S1, after the upper computer sends the diagnosis flush command data to the lower computer, if the upper computer needs to wait for the response of the ECU on the target CAN bus, the upper computer waits for the CAN response message received and forwarded from the lower computer via the ethernet, and if the upper computer does not need to wait for a certain time, the upper computer sends the next diagnosis flush command data.
Wherein, the step S2 specifically includes:
when the lower computer monitors the diagnosis flashing instruction data from the upper computer on the set IP address and the set port number, the IP address and the port number of the upper computer and the target CAN bus ID in the data are extracted;
the lower computer inquires whether a record which is the same as the extracted target CAN line ID is stored in a storage unit of the lower computer, if so, the IP address and the port number of the upper computer are compared with the extracted IP address and the port number, if the record is the same as the extracted target CAN line ID, no processing is performed, and if not, the extracted record is used for replacing the IP address and the port number which are stored before;
and after extracting the CAN messages which are respectively used for diagnosing and flashing at least two CAN buses in the diagnosis flashing instruction data, the lower computer sends the extracted CAN messages to the CAN bus corresponding to the target CAN bus ID.
And if the lower computer does not have the record which is the same as the extracted CAN bus ID, newly establishing an IP address, a port number and a target CAN bus ID record of the upper computer.
Wherein, the step S3 specifically includes:
and after receiving the CAN response message from the target CAN bus, the lower computer searches for a record with the same ID as the received target CAN bus from the storage unit, and if the record is found, encapsulates the CAN response message into an Ethernet data frame by taking the IP address and the port number in the record and the target CAN bus ID as parameters, and then sends the encapsulated Ethernet data frame to the upper computer through the Ethernet.
Wherein, the step S4 specifically includes:
when the upper computer receives the Ethernet data frame, extracting a target CAN bus ID and a CAN response message from the Ethernet data frame;
and the upper computer sends the extracted CAN response message to a task receiving message queue corresponding to the extracted target CAN bus ID for subsequent processing according to the global mapping relation record table.
The invention also provides a system for the automobile diagnosis flash electronic control unit, which comprises the following components:
the system comprises an upper computer and a lower computer, wherein the upper computer and the lower computer communicate through a User Datagram Protocol (UDP);
the upper computer sends diagnosis flash instruction data to the lower computer through an Ethernet bus, wherein the diagnosis flash instruction data carries CAN messages used for diagnosis flash and at least two target CAN bus IDs;
the lower computer receives the diagnosis flash instruction data, extracts CAN messages in the diagnosis flash instruction data, and respectively sends the CAN messages to at least two target CAN buses according to the target CAN bus IDs;
the lower computer receives CAN response messages returned by the at least two target CAN buses, packages the CAN response messages into Ethernet data frames and sends the Ethernet data frames to the upper computer through the Ethernet buses;
and the upper computer receives the Ethernet data frame, extracts the CAN response message from the Ethernet data frame and processes the CAN response message.
The upper computer is used for setting an IP address and a port number intercepted by the lower computer through Ethernet connection and is used for intercepting diagnosis flashing instruction data from the upper computer by the lower computer.
The upper computer is further used for respectively configuring diagnosis flashing instruction data parameters for flashing ECUs on at least two CAN buses, and the diagnosis flashing instruction data parameters comprise a flashing target file path, a target CAN bus ID, a target electronic control unit ECU and a flashing data segment size.
And the upper computer is also used for registering the corresponding relation between the address of the message queue received by the write task and the ID of the target CAN bus in the global mapping relation record table.
After the upper computer sends the diagnosis flashing instruction data to the lower computer, if the upper computer needs to wait for the response of the ECU on the target CAN bus, the upper computer waits for the CAN response message received and forwarded from the lower computer through the Ethernet, and if the upper computer does not need to wait for a certain time, the upper computer sends the next diagnosis flashing instruction data.
Wherein, the lower computer still is used for:
when the diagnostic flash instruction data from the upper computer is intercepted on the set IP address and the set port number, the IP address and the port number of the upper computer and the target CAN bus ID in the data are extracted;
inquiring whether a record which is the same as the extracted target CAN line ID is stored in a self storage unit, if so, comparing whether the stored upper computer IP address and port number are the same as the extracted IP address and port number, if so, performing no processing, and if not, replacing the previously stored IP address and port number by the extracted IP address and port number;
and after extracting the CAN messages respectively used for the diagnosis flash of at least two CAN buses in the diagnosis flash instruction data, sending the extracted CAN messages to the CAN bus corresponding to the target CAN bus ID.
And if the lower computer does not have the record which is the same as the extracted CAN bus ID, newly establishing an IP address, a port number and a target CAN bus ID record of the upper computer.
Wherein, the lower computer still is used for:
after receiving the CAN response message from the target CAN bus, searching a record which is the same as the received target CAN bus ID from the storage unit, if the record is found, packaging the CAN response message into an Ethernet data frame by taking the IP address and the port number in the record and the target CAN bus ID as parameters, and then sending the packaged Ethernet data frame to the upper computer through the Ethernet.
Wherein, the host computer still is used for:
when an Ethernet data frame is received, extracting a target CAN bus ID and a CAN response message from the Ethernet data frame;
and sending the extracted CAN response message to a task receiving message queue corresponding to the extracted target CAN bus ID for subsequent processing according to the global mapping relation record table.
The embodiment of the invention has the beneficial effects that:
firstly, the offline production efficiency of the whole vehicle CAN be improved, when the whole vehicle is offline, the time for writing an ECU is long and needs several minutes, if the production rate requirement of the whole vehicle is improved, for example, ten thousand vehicles are produced every day, and stations CAN only be increased according to the speed to meet the yield requirement, but the invention CAN ensure that a certain upper computer is responsible for the writing of a certain path of CAN buses of all stations, thereby achieving the purposes of clear division of labor, greatly reducing the number of work stations and improving the efficiency;
secondly, the communication between the upper computer and the lower computer is based on a UDP protocol, thereby avoiding the complexity and instability brought by the TCP communication mode when establishing, maintaining and releasing the connection. In the prior art, a TCP mode is mainly considered to ensure the consistency and integrity of data communication, but in the end-to-end communication in the flashing process, both an upper computer end and a target ECU end have a data consistency and integrity ensuring algorithm, and the UDP communication mode is adopted to save the data verification of an intermediate link to play roles in simplifying the algorithm and improving the stability; according to the characteristic that response CAN be given only by the request ECU of the upper computer during flash, the path information is carried in the CAN message, and the lower computer serves as a router, so that the channel CAN be prevented from being established before communication, and simplicity and flexibility of communication establishment at any time and termination at any time are achieved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic configuration diagram of a system of an electronic control unit for automobile diagnosis and flashing, which implements the invention.
Fig. 2 is a flowchart illustrating a method for flashing an electronic control unit for vehicle diagnosis according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of an execution flow of the upper computer in the embodiment of the present invention.
Fig. 4 is a schematic diagram illustrating an execution flow of the lower computer according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments refers to the accompanying drawings, which are included to illustrate specific embodiments in which the invention may be practiced.
As shown in fig. 1, an embodiment of the present invention provides a system for automobile diagnosis and flashing of an electronic control unit, wherein an upper computer is connected with a lower computer through an ethernet communication unit, the lower computer is connected with all ECUs on an automobile through a plurality of CAN lines, and two CAN buses, namely CAN a and CAN B, are shown in the figure. The upper computer diagnosis flashing instruction data reach each ECU through the lower computer and the multi-path CAN bus, and the flashing response data of the ECU reach the upper computer along the opposite direction. When multiple CAN lines are flashed simultaneously, multiple round-trip data streams exist in a hardware environment, and at the moment, a method is needed for controlling how the multiple data streams reach a destination address according to a specified path without generating data stream confusion. In the embodiment of the invention, the passive characteristic of ECU data uploading is utilized, namely, the ECU can feed back the flash response data only when receiving the diagnosis flash request, otherwise, the data can not be sent actively.
Referring to fig. 2, an embodiment of the present invention provides a method for flashing an electronic control unit for automobile diagnosis, including:
step S1, the upper computer sends diagnosis flash instruction data to the lower computer through the Ethernet bus, wherein the diagnosis flash instruction data carries CAN messages used for diagnosis flash and at least two target CAN bus IDs;
step S2, the lower computer receives the diagnosis flash instruction data, extracts the CAN messages in the diagnosis flash instruction data, and respectively sends the CAN messages to at least two target CAN buses according to the target CAN bus IDs;
step S3, the lower computer receives CAN response messages returned by the at least two target CAN buses, packages the CAN response messages into Ethernet data frames and sends the Ethernet data frames to the upper computer through the Ethernet buses;
step S4, the upper computer receives the Ethernet data frame, extracts the CAN response message from the Ethernet data frame and processes the CAN response message;
the upper computer and the lower computer communicate through a User Datagram Protocol (UDP).
The following description is made with reference to fig. 3 and 4, where fig. 3 is a schematic diagram of an execution flow of an upper computer, and fig. 4 is a schematic diagram of an execution flow of a lower computer.
Before step S1, the method further includes a configuration step of the upper computer, one of which is:
the upper computer sets the IP address and the port number intercepted by the lower computer through Ethernet connection, and the IP address and the port number are used for intercepting the diagnosis flashing instruction data from the upper computer by the lower computer.
The lower computer is set in a configuration mode through a hardware switch, the default IP address of the lower computer is 192.168.0.1, and the port number is 80. When the upper computer is configured to the lower computer, the upper computer and the lower computer are directly connected through an Ethernet bus, and the upper computer communicates with the lower computer through a UDP protocol through a default IP address and a port number of the lower computer.
The configuration step of the upper computer further comprises:
and respectively configuring diagnostic flash instruction data parameters for flashing ECUs on at least two CAN buses.
The diagnosis flashing instruction data parameters comprise a flashing target file path, a target CAN bus ID, a target ECU and the segment size of the flashing data. The flash target file path points to an executable BIN file path to be flashed into the ECU, the ID of the target CAN bus is used for indicating the lower computer to send diagnosis flash instruction data to a corresponding CAN bus, the target ECU is used for building a CAN message by a flash task, and the flash data segment size parameter is used for adapting to the block size of the flash data received by the specific ECU.
In addition, the upper computer also registers the corresponding relationship between the address of the message queue received by the write task and the ID of the target CAN bus in the global mapping relationship record table, so that after the upper computer receives the ethernet data frame and extracts the CAN response message in step S4, the upper computer CAN find the message queue address to which the CAN response message is to be sent from the global mapping relationship table.
In step S1, the upper computer simultaneously sends the diagnosis flashing instruction data to the lower computer through the ethernet bus, and if the upper computer needs to wait for the response of the ECU on the target CAN bus, the upper computer waits for the CAN response message received and forwarded from the lower computer through the ethernet, and if not, the upper computer waits for a certain time and then sends the next diagnosis flashing instruction data. It should be noted that the diagnostic flash command data sent by the upper computer does not allow the same CAN bus to be flashed at the same time.
In step S2, the lower computer listens for the diagnostic flush instruction data from the upper computer on the set IP address and port number. And when the lower computer listens to the diagnosis flash data, extracting the IP address, the port number and the target CAN bus ID of the upper computer in the data.
Then, before extracting the CAN message in the diagnosis flashing instruction data, the lower computer inquires whether a record which is the same as the extracted target CAN line ID exists in a storage unit of the lower computer, if so, the lower computer compares whether the stored IP address and the port number of the upper computer are the same as the extracted IP address and the port number, if so, the upper computer does not perform any processing, and if not, the extracted upper computer replaces the previously stored IP address and the port number. And if the record identical to the CAN bus ID does not exist, newly establishing an IP address, a port number and a target CAN bus ID record of the upper computer. Through the process, the target address CAN be clarified, and if the address is not regular, the step of extracting the CAN message in the diagnosis flash instruction data in the step S2 CAN not be executed any more. Such a sequential order ensures that problems are discovered as early as possible, avoiding waste of resources and time.
And after extracting the CAN messages (respectively used for diagnosing and flashing at least two CAN buses) in the diagnosis flashing instruction data, the lower computer sends the extracted CAN messages to the CAN bus corresponding to the target CAN bus ID.
Then, in step S3, the lower computer task monitors the data on each target CAN bus in real time, and takes fig. 1 as an example, the lower computer monitors the data on CAN a and CAN B in real time.
After receiving response data of the target ECU from the CAN A, the lower computer searches for a record with the same ID as the CAN A line from the storage unit, and if the record is found, the lower computer encapsulates a CAN response message into an Ethernet data frame by taking the IP address and the port number in the record and the CAN bus ID as parameters; and then the encapsulated Ethernet data frame is sent to an upper computer through the Ethernet. Similarly, after receiving response data of the target ECU from the CAN B, the lower computer searches for a record with the same ID as the CAN B line from the storage unit, and if the record is found, the lower computer encapsulates a CAN response message into an Ethernet data frame by taking the IP address and the port number in the record and the CAN bus ID as parameters; and then the encapsulated Ethernet data frame is sent to an upper computer through the Ethernet. It should be noted that when the lower computer monitors data on each target CAN bus, it needs to filter out non-diagnostic messages.
In step S4, the upper computer monitors the ethernet interface in real time, and extracts the target CAN bus ID and the CAN response packet from the ethernet data frame if the ethernet data frame is received. And then the upper computer sends the extracted CAN response message to a task receiving message queue corresponding to the extracted target CAN bus ID for subsequent processing according to the global mapping relation record table.
According to the invention, by utilizing the passive characteristic of ECU data uploading, when a data stream goes down, the upper computer carries the IP address and the port number of the sending end in the diagnosis flashing instruction data sent to the lower computer, the lower computer stores the IP address and the port number of the sending end in the record table after receiving the diagnosis flashing instruction data, the lower computer inquires the IP address and the port number of the upper computer from the record table when receiving response data from the target ECU on the target CAN bus, and the Ethernet data frame encapsulating the CAN response message is sent to the upper computer according to the IP address and the port number in the record after finding, so that the data stream CAN reach the target address along a correct route without sending data confusion.
The embodiment of the invention has the following beneficial effects:
firstly, the offline production efficiency of the whole vehicle CAN be improved, when the whole vehicle is offline, the time for writing an ECU is long and needs several minutes, if the production rate requirement of the whole vehicle is improved, for example, ten thousand vehicles are produced every day, and stations CAN only be increased according to the speed to meet the yield requirement, but the invention CAN ensure that a certain upper computer is responsible for the writing of a certain path of CAN buses of all stations, thereby achieving the purposes of clear division of labor, greatly reducing the number of work stations and improving the efficiency;
secondly, the communication between the upper computer and the lower computer is based on a UDP protocol, thereby avoiding the complexity and instability brought by the TCP communication mode when establishing, maintaining and releasing the connection. In the prior art, a TCP mode is mainly considered to ensure the consistency and integrity of data communication, but in the end-to-end communication in the flashing process, both an upper computer end and a target ECU end have a data consistency and integrity ensuring algorithm, and the UDP communication mode is adopted to save the data verification of an intermediate link to play roles in simplifying the algorithm and improving the stability; according to the characteristic that response CAN be given only by the request ECU of the upper computer during flash, the path information is carried in the CAN message, and the lower computer serves as a router, so that the channel CAN be prevented from being established before communication, and simplicity and flexibility of communication establishment at any time and termination at any time are achieved.
Referring to fig. 3 again, based on the first embodiment of the present invention, the second embodiment of the present invention provides a system for an automotive diagnostic flash electronic control unit, which includes:
the system comprises an upper computer and a lower computer, wherein the upper computer and the lower computer communicate through a User Datagram Protocol (UDP);
the upper computer sends diagnosis flash instruction data to the lower computer through an Ethernet bus, wherein the diagnosis flash instruction data carries CAN messages used for diagnosis flash and at least two target CAN bus IDs;
the lower computer receives the diagnosis flash instruction data, extracts CAN messages in the diagnosis flash instruction data, and respectively sends the CAN messages to at least two target CAN buses according to the target CAN bus IDs;
the lower computer receives CAN response messages returned by the at least two target CAN buses, packages the CAN response messages into Ethernet data frames and sends the Ethernet data frames to the upper computer through the Ethernet buses;
and the upper computer receives the Ethernet data frame, extracts the CAN response message from the Ethernet data frame and processes the CAN response message.
The upper computer is used for setting an IP address and a port number intercepted by the lower computer through Ethernet connection and is used for intercepting diagnosis flashing instruction data from the upper computer by the lower computer.
The upper computer is further used for respectively configuring diagnosis flashing instruction data parameters for flashing ECUs on at least two CAN buses, and the diagnosis flashing instruction data parameters comprise a flashing target file path, a target CAN bus ID, a target electronic control unit ECU and a flashing data segment size.
And the upper computer is also used for registering the corresponding relation between the address of the message queue received by the write task and the ID of the target CAN bus in the global mapping relation record table.
After the upper computer sends the diagnosis flashing instruction data to the lower computer, if the upper computer needs to wait for the response of the ECU on the target CAN bus, the upper computer waits for the CAN response message received and forwarded from the lower computer through the Ethernet, and if the upper computer does not need to wait for a certain time, the upper computer sends the next diagnosis flashing instruction data.
Wherein, the lower computer still is used for:
when the diagnostic flash instruction data from the upper computer is intercepted on the set IP address and the set port number, the IP address and the port number of the upper computer and the target CAN bus ID in the data are extracted;
inquiring whether a record which is the same as the extracted target CAN line ID is stored in a self storage unit, if so, comparing whether the stored upper computer IP address and port number are the same as the extracted IP address and port number, if so, performing no processing, and if not, replacing the previously stored IP address and port number by the extracted IP address and port number;
and after extracting the CAN messages respectively used for the diagnosis flash of at least two CAN buses in the diagnosis flash instruction data, sending the extracted CAN messages to the CAN bus corresponding to the target CAN bus ID.
And if the lower computer does not have the record which is the same as the extracted CAN bus ID, newly establishing an IP address, a port number and a target CAN bus ID record of the upper computer.
Wherein, the lower computer still is used for:
after receiving the CAN response message from the target CAN bus, searching a record which is the same as the received target CAN bus ID from the storage unit, if the record is found, packaging the CAN response message into an Ethernet data frame by taking the IP address and the port number in the record and the target CAN bus ID as parameters, and then sending the packaged Ethernet data frame to the upper computer through the Ethernet.
Wherein, the host computer still is used for:
when an Ethernet data frame is received, extracting a target CAN bus ID and a CAN response message from the Ethernet data frame;
and sending the extracted CAN response message to a task receiving message queue corresponding to the extracted target CAN bus ID for subsequent processing according to the global mapping relation record table.
For the working principle and the advantageous effects thereof, please refer to the description of the first embodiment of the present invention, which will not be described herein again.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.
Claims (16)
1. A method for automobile diagnosis flashing electronic control unit is characterized in that an upper computer sets an IP address and a port number intercepted by a lower computer through Ethernet connection, and the IP address and the port number are used for intercepting diagnosis flashing instruction data from the upper computer by the lower computer, and the method comprises the following steps:
step S1, the upper computer sends diagnosis flash instruction data to the lower computer through the Ethernet bus, wherein the diagnosis flash instruction data carries CAN messages used for diagnosis flash and at least two target CAN bus IDs;
step S2, the lower computer receives the diagnosis flash instruction data, extracts the CAN messages in the diagnosis flash instruction data, and respectively sends the CAN messages to at least two target CAN buses according to the target CAN bus IDs;
the lower computer receives the diagnosis flash instruction data, and the extracting of the CAN message in the diagnosis flash instruction data comprises the following steps:
when the lower computer monitors the diagnosis flashing instruction data from the upper computer on the set IP address and the set port number, the IP address and the port number of the upper computer and the target CAN bus ID in the data are extracted; the lower computer inquires whether a record which is the same as the extracted target CAN line ID is stored in a storage unit of the lower computer, if so, the IP address and the port number of the upper computer are compared with the extracted IP address and the port number, if the record is the same as the extracted target CAN line ID, no processing is performed, and if not, the extracted IP address and the extracted port number are used for replacing the stored IP address and the port number;
step S3, the lower computer receives CAN response messages returned by the at least two target CAN buses, packages the CAN response messages into Ethernet data frames, and sends the Ethernet data frames to the upper computer through the Ethernet bus according to the IP address and the port number;
step S4, the upper computer receives the Ethernet data frame, extracts the CAN response message from the Ethernet data frame and processes the CAN response message; the upper computer and the lower computer communicate through a User Datagram Protocol (UDP).
2. The method according to claim 1, wherein before the step S1, further comprising:
and the upper computer is respectively configured with diagnosis flashing instruction data parameters for flashing ECUs on at least two CAN buses, wherein the diagnosis flashing instruction data parameters comprise a flashing target file path, a target CAN bus ID, a target electronic control unit ECU and a flashing data segment size.
3. The method of claim 2, further comprising:
and the upper computer registers the corresponding relation between the address of the received message queue of the write-once task and the ID of the target CAN bus in the global mapping relation record table.
4. The method according to claim 1, wherein in step S1, after the upper computer sends the diagnosis flush command data to the lower computer, if the upper computer needs to wait for the response of the ECU on the target CAN bus, the upper computer waits for the CAN response message received and forwarded from the lower computer via the ethernet, and if not, waits for a certain time before sending the next diagnosis flush command data.
5. The method according to claim 1, wherein the step S2 further comprises:
and after extracting the CAN messages which are respectively used for diagnosing and flashing at least two CAN buses in the diagnosis flashing instruction data, the lower computer sends the extracted CAN messages to the CAN bus corresponding to the target CAN bus ID.
6. The method of claim 5 wherein if the lower computer does not have the same record as the extracted CAN bus ID, then creating a new record of the upper computer IP address, port number and target CAN bus ID.
7. The method according to claim 1, wherein the step S3 specifically includes:
and after receiving the CAN response message from the target CAN bus, the lower computer searches for a record with the same ID as the received target CAN bus from the storage unit, and if the record is found, encapsulates the CAN response message into an Ethernet data frame by taking the IP address and the port number in the record and the target CAN bus ID as parameters, and then sends the encapsulated Ethernet data frame to the upper computer through the Ethernet.
8. The method according to claim 1, wherein the step S4 specifically includes:
when the upper computer receives the Ethernet data frame, extracting a target CAN bus ID and a CAN response message from the Ethernet data frame;
and the upper computer sends the extracted CAN response message to a task receiving message queue corresponding to the extracted target CAN bus ID for subsequent processing according to the global mapping relation record table.
9. A system for automotive diagnostic flash of an electronic control unit, comprising:
the system comprises an upper computer and a lower computer, wherein the upper computer and the lower computer communicate through a User Datagram Protocol (UDP); the upper computer is used for setting an IP address and a port number intercepted by the lower computer through Ethernet connection and is used for intercepting diagnosis flash instruction data from the upper computer by the lower computer;
the upper computer sends diagnosis flash instruction data to the lower computer through an Ethernet bus, wherein the diagnosis flash instruction data carries CAN messages used for diagnosis flash and at least two target CAN bus IDs;
the lower computer receives the diagnosis flash instruction data, extracts CAN messages in the diagnosis flash instruction data, and respectively sends the CAN messages to at least two target CAN buses according to the target CAN bus IDs; the lower computer receives the diagnosis flashing instruction data, and the extracting of the CAN message in the diagnosis flashing instruction data comprises the following steps: when the upper computer monitors the diagnosis flashing instruction data from the upper computer on the set IP address and the set port number, the IP address, the port number and the target CAN bus ID of the upper computer in the data are extracted; and inquiring whether a record which is the same as the extracted target CAN line ID is stored in a self storage unit, if so, comparing whether the stored upper computer IP address and port number are the same as the extracted IP address and port number, if so, performing no processing, and if not, replacing the previously stored IP address and port number by the extracted IP address and port number;
the lower computer receives CAN response messages returned by the at least two target CAN buses, packages the CAN response messages into Ethernet data frames, and sends the Ethernet data frames to the upper computer through the Ethernet buses according to the IP addresses and the port numbers;
and the upper computer receives the Ethernet data frame, extracts the CAN response message from the Ethernet data frame and processes the CAN response message.
10. The system of claim 9, wherein the host computer is further configured to configure diagnostic flash command data parameters for flashing ECUs on at least two CAN buses, respectively, the diagnostic flash command data parameters including a flash target file path, a target CAN bus ID, a target electronic control unit ECU, and a flash data segment size.
11. The system of claim 9, wherein the host computer is further configured to register a correspondence between the address of the write task receive message queue and the target CAN bus ID in a global mapping table.
12. The system according to claim 9, wherein after the upper computer sends the diagnosis flush command data to the lower computer, if the upper computer needs to wait for the response of the ECU on the target CAN bus, the upper computer waits for the CAN response message received and forwarded from the lower computer via the ethernet, and if not, waits for a certain time before sending the next diagnosis flush command data.
13. The system of claim 9, wherein the lower computer is further configured to:
and after extracting the CAN messages respectively used for the diagnosis flash of at least two CAN buses in the diagnosis flash instruction data, sending the extracted CAN messages to the CAN bus corresponding to the target CAN bus ID.
14. The system of claim 13 wherein if the lower computer does not have a record identical to the extracted CAN bus ID, then creating a new upper computer IP address, port number, and target CAN bus ID record.
15. The system of claim 9, wherein the lower computer is further configured to:
after receiving the CAN response message from the target CAN bus, searching a record which is the same as the received target CAN bus ID from the storage unit, if the record is found, packaging the CAN response message into an Ethernet data frame by taking the IP address and the port number in the record and the target CAN bus ID as parameters, and then sending the packaged Ethernet data frame to the upper computer through the Ethernet.
16. The system of claim 9, wherein the host computer is further configured to:
when an Ethernet data frame is received, extracting a target CAN bus ID and a CAN response message from the Ethernet data frame;
and sending the extracted CAN response message to a task receiving message queue corresponding to the extracted target CAN bus ID for subsequent processing according to the global mapping relation record table.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611015981.2A CN106375175B (en) | 2016-11-18 | 2016-11-18 | Method and system for flashing electronic control unit for automobile diagnosis |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611015981.2A CN106375175B (en) | 2016-11-18 | 2016-11-18 | Method and system for flashing electronic control unit for automobile diagnosis |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106375175A CN106375175A (en) | 2017-02-01 |
CN106375175B true CN106375175B (en) | 2020-10-16 |
Family
ID=57891631
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611015981.2A Active CN106375175B (en) | 2016-11-18 | 2016-11-18 | Method and system for flashing electronic control unit for automobile diagnosis |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106375175B (en) |
Families Citing this family (27)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106375175B (en) * | 2016-11-18 | 2020-10-16 | 广州汽车集团股份有限公司 | Method and system for flashing electronic control unit for automobile diagnosis |
CN106953796B (en) * | 2017-04-13 | 2021-01-01 | 北京汽车集团有限公司 | Security gateway, data processing method and device, vehicle network system and vehicle |
CN106970609A (en) * | 2017-04-22 | 2017-07-21 | 深圳市元征科技股份有限公司 | The diagnostic method and vehicle diagnostics box of vehicle diagnostics box |
CN107360262B (en) * | 2017-09-07 | 2020-06-05 | 北京经纬恒润科技有限公司 | Software updating method and device |
CN107666482A (en) * | 2017-09-18 | 2018-02-06 | 上海电气分布式能源科技有限公司 | A kind of means of communication and system based on SOA framework |
CN109582931A (en) * | 2017-09-29 | 2019-04-05 | 上海欧菲智能车联科技有限公司 | Refresh the generation method and system of file |
CN107948036A (en) * | 2017-12-28 | 2018-04-20 | 深圳市元征软件开发有限公司 | A kind of automobile-used Ethernet diagnosis communication line and the means of communication |
CN108833018B (en) * | 2018-04-09 | 2021-01-22 | 桂林电子科技大学 | Networking communication system and method |
CN108810082A (en) * | 2018-04-24 | 2018-11-13 | 江苏金坛长荡湖新能源科技有限公司 | A kind of new-energy automobile control module remotely writes with a brush dipped in Chinese ink method |
CN109150682B (en) * | 2018-11-02 | 2021-02-19 | 广州小鹏汽车科技有限公司 | Interference source detection method and device |
CN109828935B (en) * | 2019-01-17 | 2021-01-05 | 重庆菲斯塔新能源汽车科技有限公司 | Parallel flash method based on CAN FD bus |
CN111694335B (en) * | 2019-03-12 | 2022-04-19 | 广州汽车集团股份有限公司 | Automobile ECU (electronic control Unit) diagnosis method and system and gateway equipment |
CN110138840B (en) * | 2019-04-22 | 2022-04-19 | 浙江合众新能源汽车有限公司 | Parallel refreshing method based on vehicle-mounted Ethernet |
CN110162024B (en) * | 2019-06-29 | 2021-08-20 | 潍柴动力股份有限公司 | ECU data self-checking method and device |
CN110460621A (en) * | 2019-09-10 | 2019-11-15 | 上海怿星电子科技有限公司 | A kind of industry ethernet based on SOME/IP agreement and CAN bus data transfer device and system |
CN111030902A (en) * | 2019-10-15 | 2020-04-17 | 浙江合众新能源汽车有限公司 | Vehicle electronic control unit refreshing method and system |
CN112748711A (en) * | 2019-10-30 | 2021-05-04 | 惠州比亚迪电池有限公司 | ECU data flashing method, device and system |
CN112835598B (en) * | 2019-11-25 | 2023-11-10 | 广州汽车集团股份有限公司 | Automobile ECU (electronic control Unit) refreshing method and system and computer readable storage medium thereof |
CN111049716A (en) * | 2019-12-19 | 2020-04-21 | 深圳市华翼智能有限公司 | Automobile CAN data decryption method and device |
CN111679836B (en) * | 2020-05-07 | 2023-03-21 | 安徽工业大学 | Automobile ECU flashing system and method |
CN113805897A (en) * | 2020-06-11 | 2021-12-17 | 卓品智能科技无锡有限公司 | Multichannel parallel flash method for vehicle-mounted controller |
CN112468378B (en) * | 2020-10-30 | 2023-02-10 | 中国航发西安动力控制科技有限公司 | High-capacity data transmission equipment and method based on CAN bus |
CN113219945A (en) * | 2021-04-29 | 2021-08-06 | 上海星融汽车科技有限公司 | Vehicle ECU data flashing pressure measurement system and pressure measurement method |
CN113542273B (en) * | 2021-07-15 | 2023-07-18 | 北京润科通用技术有限公司 | Data transmission method and related equipment |
CN113741390B (en) * | 2021-08-30 | 2023-10-13 | 重庆长安汽车股份有限公司 | Method for FBL (flash memory controller) to write vehicle controller based on UDS (Universal diagnostic System) diagnostic service |
CN114398097A (en) * | 2021-12-31 | 2022-04-26 | 普华基础软件股份有限公司 | Online writing method |
CN115134196B (en) * | 2022-06-30 | 2023-12-15 | 奇瑞新能源汽车股份有限公司 | Brush writing pretreatment method and system for distributed gateway software of electric automobile |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1430427A (en) * | 2001-12-29 | 2003-07-16 | 深圳市中兴通讯股份有限公司上海第二研究所 | Method of automatic establishing multi-level cascade link pased on point to point |
CN101360036A (en) * | 2007-07-31 | 2009-02-04 | 比亚迪股份有限公司 | CAN bus gateway controller and data transmission method between CAN buses |
CN102346472A (en) * | 2011-08-31 | 2012-02-08 | 奇瑞汽车股份有限公司 | CAN (Controller Area Network) and LIN (Local Interconnect Network) bus network based vehicle control system |
CN103634150A (en) * | 2013-12-03 | 2014-03-12 | 合肥工大高科信息科技股份有限公司 | Redundant high-safety CAN (controller area network) bus communication system and communication method thereof |
CN104281469A (en) * | 2014-08-26 | 2015-01-14 | 东风电子科技股份有限公司 | Method and system for realizing refreshing and writing of ECU (Electronic Control Unit) program |
CN104539498A (en) * | 2014-12-15 | 2015-04-22 | 浙江吉利汽车研究院有限公司 | Automotive CAN/LIN network structure |
CN104793975A (en) * | 2015-04-29 | 2015-07-22 | 北京经纬恒润科技有限公司 | Method and device for updating application programs in electronic control units |
CN106375175A (en) * | 2016-11-18 | 2017-02-01 | 广州汽车集团股份有限公司 | Method and system for diagnosing and flashing electronic control unit of vehicle |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004249817A (en) * | 2003-02-19 | 2004-09-09 | Denso Corp | Electronic control device and control system having a plurality of electronic control devices |
CN101739012B (en) * | 2009-12-14 | 2011-08-10 | 北汽福田汽车股份有限公司 | Vehicle electronic control unit and control method and upper computer thereof |
CN102053569A (en) * | 2010-12-13 | 2011-05-11 | 普华基础软件股份有限公司 | Self refresh method and self-refresh device used for automotive electronic controller |
CN103853105A (en) * | 2012-11-28 | 2014-06-11 | 北汽福田汽车股份有限公司 | Electronic control unit flash method based on controller area network (CAN) |
CN103616830B (en) * | 2013-12-02 | 2017-04-12 | 北京经纬恒润科技有限公司 | Car controller flash control method and device and car bus system |
CN104539668B (en) * | 2014-12-16 | 2018-09-11 | 北京新能源汽车股份有限公司 | Method and system for remotely updating software programs in a vehicle |
CN105278994A (en) * | 2015-10-29 | 2016-01-27 | 北京新能源汽车股份有限公司 | Updating method and updating system for vehicle-mounted ECU software |
-
2016
- 2016-11-18 CN CN201611015981.2A patent/CN106375175B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1430427A (en) * | 2001-12-29 | 2003-07-16 | 深圳市中兴通讯股份有限公司上海第二研究所 | Method of automatic establishing multi-level cascade link pased on point to point |
CN101360036A (en) * | 2007-07-31 | 2009-02-04 | 比亚迪股份有限公司 | CAN bus gateway controller and data transmission method between CAN buses |
CN102346472A (en) * | 2011-08-31 | 2012-02-08 | 奇瑞汽车股份有限公司 | CAN (Controller Area Network) and LIN (Local Interconnect Network) bus network based vehicle control system |
CN103634150A (en) * | 2013-12-03 | 2014-03-12 | 合肥工大高科信息科技股份有限公司 | Redundant high-safety CAN (controller area network) bus communication system and communication method thereof |
CN104281469A (en) * | 2014-08-26 | 2015-01-14 | 东风电子科技股份有限公司 | Method and system for realizing refreshing and writing of ECU (Electronic Control Unit) program |
CN104539498A (en) * | 2014-12-15 | 2015-04-22 | 浙江吉利汽车研究院有限公司 | Automotive CAN/LIN network structure |
CN104793975A (en) * | 2015-04-29 | 2015-07-22 | 北京经纬恒润科技有限公司 | Method and device for updating application programs in electronic control units |
CN106375175A (en) * | 2016-11-18 | 2017-02-01 | 广州汽车集团股份有限公司 | Method and system for diagnosing and flashing electronic control unit of vehicle |
Also Published As
Publication number | Publication date |
---|---|
CN106375175A (en) | 2017-02-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106375175B (en) | Method and system for flashing electronic control unit for automobile diagnosis | |
CN106664261B (en) | A kind of methods, devices and systems configuring flow entry | |
CN110061897A (en) | Data on flows acquisition methods and system in virtual network tunnel | |
CN107332775B (en) | Cross-host machine inter-visit system based on docker container and control method thereof | |
CN104702438B (en) | PE device management methods and device | |
EP3605959B1 (en) | Method, device and computer storage medium for implementing double control plane | |
CN107306215B (en) | Data processing method, system and node | |
EP3018867B1 (en) | Method for processing user message and forwarding plane device | |
CN114545906B (en) | Vehicle-mounted Ethernet gateway and vehicle | |
CN114745255B (en) | Hardware chip, DPU, server, communication method and related device | |
US7269661B2 (en) | Method using receive and transmit protocol aware logic modules for confirming checksum values stored in network packet | |
CN103401773A (en) | Method and network equipment realizing interboard communication | |
WO2018049725A1 (en) | Pptp vpn-based accelerated access method, apparatus and device | |
CN104660469A (en) | Layer-2 network connectivity detecting method and associated equipment | |
CN109547350B (en) | Route learning method and gateway equipment | |
US20120182892A1 (en) | Method and system for low-latency networking | |
CN109474534A (en) | Routing based on FPGA accelerates repeater system, router and retransmission method | |
CN104796338A (en) | Migration method and device of virtual machines | |
CN102045233A (en) | Method and device for controlling message forwarding in network communication | |
CN110958590B (en) | Heterogeneous equipment integrated system based on multi-protocol edge computing gateway | |
CN110300064A (en) | A kind of data traffic processing method, equipment and system | |
CN111800338A (en) | Cross-AS EVPN route interaction method and device | |
CN109558367B (en) | Multi-bus processor MHAL routing method | |
CN112543142B (en) | Method and device for realizing RSTP ring network protocol based on FPGA | |
CN113377393B (en) | Diagnosis refreshing system and method for vehicle-mounted system main node |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |