Diagnostic flashing method and system of domain controller and electronic equipment
By introducing diagnostic flush routing rules in the DOIP gateway, the problem that the MCU can only handle a single request in the coexistence scenario of multiple diagnostic instruments, and the coexistence of multiple diagnostic instruments is achieved while the MCU can only handle a single request. The scenarios improve processing capabilities.
Patent Information
- Application Number
- CN202411164421.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-03
AI Technical Summary
Existing MCUs can only process a single request at the same time in the coexistence of multiple diagnostic instruments, and cannot meet the needs of multiple diagnostic instruments.
By introducing diagnostic flush routing rules in the DOIP gateway, only one internal diagnostic device's MCU flush request is sent to the MCU and blocking the messages from other diagnostic devices, so that when the MCU can only process a single request, multiple messages are met A scene where diagnostic instruments coexist.
It realizes that when the MCU can only process a single request, it can still meet the coexistence of multiple diagnostic devices, improves the processing capacity of the MCU, and meets the online needs of multiple diagnostic devices.
Smart Images

Figure CN119071098A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automobile diagnostic technology, and in particular to a diagnostic flashing method and system for a domain controller, and an electronic device. Background Art
[0002] In the electronic and electrical architecture of the whole vehicle, the control network of the entire electronic and electrical appliances is usually composed of a domain controller with strong computing power and high integration and many small electronic control units (ECU) with weak computing power; these domain controllers and small ECUs usually have the ability to be upgraded through diagnostic flashing. For domain controllers with a high degree of integration, they usually include a microprocessor unit (MPU) with strong computing power and more functions and a microcontroller unit (MCU) with weak computing power and simple functions. The two work together to complete various functions of the domain controller. Among them, MPU and MCU are highly related in many business logics, so it is very necessary to maintain the version consistency of MPU and MCU during diagnostic flashing.
[0003] When the domain controller is flashing the diagnosis, in order to ensure version consistency, the Diagnostic Communication over Internet Protocol (DOIP) protocol can be used to implement the diagnostic flashing of the domain controller. Among them, the DOIP protocol itself supports the simultaneous connection of diagnostic instruments with multiple source addresses, but most of the existing MCUs can only process the request of a single diagnostic instrument at the same time, which cannot meet the scenario of multiple diagnostic instruments coexisting. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a diagnostic flashing method and system for a domain controller, and an electronic device to solve the technical problem that most MCUs in the prior art can only process requests from a single diagnostic instrument at the same time and cannot meet the scenario where multiple diagnostic instruments coexist.
[0005] In the first aspect, an embodiment of the present application provides a diagnostic flashing method for a domain controller, which is applied to a DOIP gateway, including: when a routing rule change instruction is received, turning on or off the corresponding diagnostic flashing routing rule according to the routing rule change instruction; wherein, when the diagnostic flashing routing rule is turned on, the DOIP gateway will only send an MCU flashing request sent by an internal diagnostic instrument to the MCU; when the diagnostic flashing routing rule is turned on and the MCU flashing request is received, sending the MCU flashing request to the MCU, so that the MCU performs a diagnostic flashing based on the MCU flashing request.
[0006] In the above scheme, during the process of diagnostic flashing of the domain controller, if the internal diagnostic instrument in the MPU is used to perform diagnostic flashing on the MCU, a diagnostic flashing routing rule can be introduced; when the diagnostic flashing routing rule is turned on, the DOIP gateway only sends an MCU flashing request sent by an internal diagnostic instrument to the MCU, and blocks the messages sent by other diagnostic instruments. In this way, when the MCU can only process the request of a single diagnostic instrument at the same time, it can still meet the scenario where multiple diagnostic instruments coexist.
[0007] In an optional implementation, the routing rule change instruction includes: a service ID, a rule ID, and a status bit; wherein the service ID is an ID other than the UDS service, the rule ID is an ID corresponding to the diagnostic flash routing rule, and the status bit represents whether the diagnostic flash routing rule is turned on or off. In the above scheme, the routing rule change instruction may include the service ID, the rule ID, and the status bit, so that after the DOIP gateway receives the above routing rule change instruction, the corresponding diagnostic flash routing rule can be turned on or off based on the service ID, the rule ID, and the status bit, so that when the MCU can only process the request of a single diagnostic instrument at the same time, it can still meet the scenario where multiple diagnostic instruments coexist.
[0008] In an optional embodiment, turning on or off the corresponding diagnostic flash routing rule according to the routing rule change instruction includes: determining the diagnostic flash routing rule according to the service ID and the rule ID; turning on or off the diagnostic flash routing rule according to the status bit. In the above scheme, after the DOIP gateway receives the above routing rule change instruction, it can determine the corresponding diagnostic flash routing rule based on the service ID and the rule ID, and turn on or off the above diagnostic flash routing rule based on the status bit, so that when the MCU can only process the request of a single diagnostic instrument at the same time, it can still meet the scenario of multiple diagnostic instruments coexisting.
[0009] In an optional implementation, before the corresponding diagnostic flushing routing rule is turned on or off according to the routing rule change instruction, the method further includes: upon receiving the first DOIP message, determining whether the first DOIP message is a DOIP diagnostic message; if the first DOIP message is the DOIP diagnostic message, determining whether the target address of the first DOIP message is the virtual node address for receiving the routing rule change instruction; if the target address of the first DOIP message is the virtual node address for receiving the routing rule change instruction, determining whether the source address of the first DOIP message is in the whitelist; if the source address of the first DOIP message is in the whitelist, determining that the first DOIP message is the routing rule change instruction. In the above scheme, the DOIP gateway will receive various DOIP messages, so it is necessary to determine whether the received first DOIP message is a routing rule change instruction, so that the corresponding diagnostic flushing routing rule can be turned on or off when the received first DOIP message is a routing rule change instruction. Among them, by determining whether the source address of the first DOIP message is in the whitelist, security can be further improved.
[0010] In an optional implementation, before sending the MCU flash writing request to the MCU, the method further includes: upon receiving the second DOIP message, determining whether the source address corresponding to the second DOIP message is an external diagnostic instrument; if the source address corresponding to the second DOIP message is the external diagnostic instrument, determining whether the target address corresponding to the second DOIP message is the MCU; if the target address corresponding to the second DOIP message is the MCU, determining whether the service ID corresponding to the second DOIP message is in the shielding list; if the service ID corresponding to the second DOIP message is in the shielding list, determining that the second DOIP message is a non-MCU flash writing request. In the above scheme, the DOIP gateway will receive various DOIP messages, so it is necessary to determine whether the received second DOIP message is an MCU flash writing request, so that only the MCU flash writing request sent by an internal diagnostic instrument can be sent to the MCU, while shielding the messages sent by other diagnostic instruments.
[0011] In an optional implementation, the shielding list includes 0x3E. In the above solution, since the external diagnostic instrument periodically sends a diagnostic instrument device online (Tester Present) message during the diagnostic flashing process of the domain controller, the shielding list may include the corresponding 0x3E service, thereby shielding the above Tester Present message.
[0012] In an optional implementation, before sending the MCU flash writing request to the MCU, the method further includes: upon receiving the second DOIP message, determining whether the source address corresponding to the second DOIP message is an internal diagnostic instrument; if the source address corresponding to the second DOIP message is the internal diagnostic instrument, determining the second DOIP message as the MCU flash writing request. In the above scheme, the DOIP gateway will receive various DOIP messages, so it is necessary to determine whether the received second DOIP message is an MCU flash writing request, so that only an MCU flash writing request sent by an internal diagnostic instrument can be sent to the MCU, while shielding messages sent by other diagnostic instruments.
[0013] In a second aspect, an embodiment of the present application provides a diagnostic flash system for a domain controller, comprising: a domain controller; an external diagnostic instrument, used to send a domain controller flash request and a function-addressed diagnostic instrument online request to the domain controller; the domain controller comprises: an MPU, an MCU and a switch, and the MPU comprises: an MPU diagnostic server, an internal diagnostic instrument and a DOIP gateway; the MPU diagnostic server is used to perform diagnostic flash on the MPU, the internal diagnostic instrument is used to receive the MCU flash request sent by the MPU diagnostic server, and the DOIP gateway is used to execute the diagnostic flash method for the domain controller as described in the first aspect.
[0014] In the above scheme, during the process of diagnostic flashing of the domain controller, if the internal diagnostic instrument in the MPU is used to perform diagnostic flashing on the MCU, a diagnostic flashing routing rule can be introduced; when the diagnostic flashing routing rule is turned on, the DOIP gateway only sends an MCU flashing request sent by an internal diagnostic instrument to the MCU, and blocks the messages sent by other diagnostic instruments. In this way, when the MCU can only process the request of a single diagnostic instrument at the same time, it can still meet the scenario where multiple diagnostic instruments coexist.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory and a bus; the processor and the memory communicate with each other through the bus; the memory stores computer program instructions that can be executed by the processor, and the processor calls the computer program instructions to execute the diagnostic flashing method of the domain controller as described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes instructions, and when the instructions are executed by a computer, the computer implements the diagnostic flashing method for the domain controller as described in the first aspect.
[0017] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions. When the computer program instructions are executed by a computer, the computer executes the diagnostic flashing method for the domain controller as described in the first aspect.
[0018] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the following specifically cites the embodiments of the present application and describes them in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A schematic diagram of a UDS flashing ECU provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of a diagnostic flashing domain controller provided in an embodiment of the present application;
[0022] Figure 3 A structural block diagram of a diagnostic flashing system for a domain controller provided in an embodiment of the present application;
[0023] Figure 4 A flowchart of a diagnostic flashing method for a domain controller provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of a routing rule change instruction provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of a process for implementing a diagnostic flash routing rule on or off provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of a process for implementing a diagnostic flash routing rule provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of another method for diagnosing and flashing a domain controller provided in an embodiment of the present application;
[0028] Fig. 9 A structural block diagram of an electronic device provided in an embodiment of the present application.
[0029] Icons: 300-diagnostic flash system of domain controller; 310-domain controller; 320-external diagnostic instrument; 311-MPU; 312-MCU; 313-switch; 314-MPU diagnostic server; 315-internal diagnostic instrument; 316-DOIP gateway. DETAILED DESCRIPTION
[0030] In the whole vehicle electronic and electrical architecture, it generally includes domain controllers and ECUs, which usually have the ability to be upgraded through diagnostic flashing. Among them, diagnostic flashing is a process of loading new software or firmware into ECU or domain controller through the vehicle's diagnostic interface (for example: On-Board Diagnostics-II (OBD-II) interface, etc.) and related communication protocols (for example: Controller Area Network (CAN), Unified Diagnostic Services (UDS), etc.).
[0031] For a domain controller with a high degree of integration, it generally includes an MPU and an MCU. During the diagnostic flashing process of the domain controller, the MPU and the MCU need to be consistent. Therefore, the diagnostic instrument can send an upgrade package containing MPU data and MCU data to the MPU, and then let the MPU complete the entire MPU and MCU installation process.
[0032] Please refer to Figure 1 , Figure 1 A schematic diagram of a UDS flashing ECU is provided in an embodiment of the present application. When the MPU executes the installation of the MCU, it usually reuses the UDS diagnostic flashing process. At this time, the MCU will simultaneously receive a TesterPresent request from an external diagnostic instrument and an ECU flashing-related diagnostic request from the MPU, that is, there are DOIP requests with two source logical addresses at the same time.
[0033] Please refer to Figure 2 , Figure 2 A schematic diagram of a diagnostic flash domain controller provided in an embodiment of the present application. An external diagnostic instrument sends a diagnostic message to an MPU server (i.e. Figure 2The UDS server in the DOIP gateway sends a diagnostic flash request, which includes an upgrade package for MPU data and MCU data; after receiving the above diagnostic flash request, the MPU diagnostic server performs a diagnostic flash of the MPU based on the upgrade package for the MPU data, and then sends a refresh MCU request to the internal diagnostic instrument, which includes an upgrade package for the MCU data; the internal diagnostic instrument sends a refresh MCU request to the DOIP gateway, and the DOIP gateway forwards the refresh request to the MCU; the external diagnostic instrument also sends a Tester Present request to the DOIP gateway, and the DOIP gateway forwards the Tester Present request to the MCU; the MCU will receive the refresh MCU request with the DOIP source address being the internal diagnostic instrument and the Tester Present request with the DOIP source address being the external diagnostic instrument.
[0034] In the above diagnostic flashing process, the DOIP protocol itself supports the simultaneous connection of multiple source addresses of diagnostic instruments, but some manufacturers only process requests from a single diagnostic instrument on resource-constrained MCUs, which cannot meet the above scenario of two diagnostic instruments coexisting. Since the ECU in the car usually comes from multiple suppliers, it is difficult to promote all suppliers to achieve unified implementation to meet the needs due to chip resources, development costs, etc.
[0035] Based on the above analysis, the embodiment of the present application provides a diagnostic flashing system and a diagnostic flashing method for a domain controller. Without changing the upstream external diagnostic instrument and the downstream MCU software, the diagnostic flashing routing rules are changed in real time by the domain control MPU to achieve a solution for making the MCU that only supports a single DOIP diagnostic instrument connection compatible with multiple diagnostic instruments for online scene diagnostic flashing. The technical solution in the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application.
[0036] Please refer to Figure 3 , Figure 3 The present invention provides a structural block diagram of a diagnostic flashing system for a domain controller, wherein the diagnostic flashing system 300 for a domain controller includes: a domain controller 310 and an external diagnostic instrument 320, wherein the domain controller 310 and the external diagnostic instrument 320 are connected.
[0037] Specifically, the domain controller 310 is an important component of the vehicle electronic system. As the hub of the entire vehicle electronic system, it is responsible for managing and controlling multiple embedded ECUs to achieve coordination and communication between the various ECUs, thereby achieving comprehensive control and optimization of the entire vehicle system.
[0038] The external diagnostic instrument 320 is an electronic device for diagnosing vehicle faults. It can be connected to the vehicle through the OBD interface and read and analyze data to determine whether the vehicle has a fault and the fault location. In the embodiment of the present application, the external diagnostic instrument 320 can be used to send a domain controller flash request and a Tester Present request to the domain controller 310.
[0039] The domain controller flashing request may include an installation package for performing diagnostic flashing on the domain controller 310. It should be noted that the domain controller flashing request may include only an installation package for performing diagnostic flashing on the MPU 311; or, may include only an installation package for performing diagnostic flashing on the MCU 312; or, may include both an installation package for performing diagnostic flashing on the MPU 311 and an installation package for performing diagnostic flashing on the MCU 312; the embodiment of the present application does not specifically limit this.
[0040] The Tester Present request is used to indicate that the external diagnostic instrument 320 is still connected to the network and that specific diagnostic services and / or communication functions previously activated remain activated; wherein, by periodically sending TesterPresent requests, the external diagnostic instrument 320 can ensure that the domain controller 310 remains in a non-default session mode, thereby allowing more diagnostic services and / or communication functions to be activated and used.
[0041] On the basis of the above-mentioned domain controller diagnostic flashing system 300, further, the domain controller 310 provided in the embodiment of the present application may include: MPU311, MCU312 and switch 313, wherein MPU311 and MCU312 are connected via switch 313, and both MPU311 and MCU312 can be connected to an external diagnostic instrument 320.
[0042] On the basis of the diagnostic flashing system 300 of the above-mentioned domain controller, further, the MPU311 provided in the embodiment of the present application may include: an MPU diagnostic server 314, an internal diagnostic instrument 315 and a DOIP gateway 316, wherein the MPU diagnostic server 314 is respectively connected to the internal diagnostic instrument 315 and the DOIP gateway 316, the MPU diagnostic server 314 is connected to the DOIP gateway 316, and the DOIP gateway 316 is connected to the MCU312 via a switch 313.
[0043] Among them, the MPU diagnostic server 314 is used to diagnose and analyze the memory usage of the system or application using the memory access control and isolation functions of the MPU 311; the internal diagnostic instrument 315 is used to diagnose faults inside the device; the DOIP gateway 316 is a host that supports the DOIP protocol and is used for diagnostic communication between the ECU in the vehicle and the external test equipment.
[0044] Based on the above-mentioned domain controller diagnostic flashing system 300, the embodiment of the present application also provides a domain controller diagnostic flashing method applied to the above-mentioned DOIP gateway 316. Figure 4 , Figure 4 A flowchart of a diagnostic flashing method for a domain controller provided in an embodiment of the present application, the diagnostic flashing method for the domain controller may specifically include the following steps:
[0045] Step S401: upon receiving a routing rule change instruction, the corresponding diagnostic flash routing rule is turned on or off according to the routing rule change instruction; wherein, when the diagnostic flash routing rule is turned on, the DOIP gateway will only send an MCU flash request sent by an internal diagnostic instrument to the MCU.
[0046] Step S402: When the diagnostic flash routing rule is enabled and an MCU flash request is received, the MCU flash request is sent to the MCU, so that the MCU performs diagnostic flash based on the MCU flash request.
[0047] Specifically, during the diagnostic flashing process of the domain controller, the external diagnostic instrument will use physical addressing to send upgrade-related messages to the ECU to be upgraded, and will periodically send functionally addressed diagnostic instrument online (Tester Present) requests to maintain the diagnostic session; when the MPU of the domain controller starts to execute the MCU installation task, an internal diagnostic instrument will be started in the MPU.
[0048] At this time, in order to prevent the MCU from receiving messages from both internal and external diagnostic instruments at the same time, the MPU installation program can send a routing rule change instruction to the DOIP gateway in the MPU to enable the diagnostic flash routing rule before flashing the MCU; after the diagnostic flash routing rule is enabled, the DOIP gateway in the MPU will not forward the diagnostic message from the external diagnostic instrument to the MCU. At this time, the diagnostic session of the MCU is maintained by the internal diagnostic instrument; after the internal diagnostic instrument finishes flashing the MCU, the installation program in the UDS diagnostic server in the MPU notifies the DOIP gateway to close the diagnostic flash routing rule to restore communication between the external diagnostic instrument and the MCU.
[0049] In the above step S401, the routing rule change instruction is used to instruct the DOIP gateway to turn on or off the corresponding diagnostic flash routing rule; wherein, when the above diagnostic flash routing rule is turned on, the DOIP gateway will only send an MCU flash request sent by an internal diagnostic instrument to the MCU, and when the above diagnostic flash routing rule is turned off, the DOIP gateway will send all messages sent by each diagnostic instrument (including internal diagnostic instruments and external diagnostic instruments) to the MCU.
[0050] The MCU flashing request may include an installation package for performing diagnostic flashing on the MCU, so that the MCU can perform diagnostic flashing on the MCU based on the MCU flashing request after receiving the MCU flashing request.
[0051] As an implementation method, when the DOIP gateway receives a DOIP message, it can determine whether the DOIP message belongs to a routing rule change instruction; if the DOIP message does not belong to a routing rule change instruction, other operations are performed; if the DOIP message belongs to a routing rule change instruction, the operation in the above step S401 can be performed.
[0052] It should be noted that the embodiment of the present application does not make any specific limitation on the specific implementation method of the routing rule change instruction, and those skilled in the art can make appropriate adjustments based on actual conditions; in addition, the embodiment of the present application also does not make any specific limitation on the specific implementation method of the MCU flash request, and those skilled in the art can make appropriate adjustments based on the existing technology.
[0053] In the above step S402, when the diagnostic flash routing rule is turned on and an MCU flash request is received, the DOIP may send the MCU flash request to the MCU, so that the MCU may perform diagnostic flash based on the MCU flash request.
[0054] As an implementation method, when the DOIP gateway receives a DOIP message, it can determine whether the DOIP message belongs to an MCU flash request; if the DOIP message does not belong to an MCU flash request, other operations are performed; if the DOIP message belongs to an MCU flash request, the operation in the above step S402 can be performed.
[0055] In the above scheme, during the process of diagnostic flashing of the domain controller, if the internal diagnostic instrument in the MPU is used to perform diagnostic flashing on the MCU, a diagnostic flashing routing rule can be introduced; when the diagnostic flashing routing rule is turned on, the DOIP gateway only sends an MCU flashing request sent by an internal diagnostic instrument to the MCU, and blocks the messages sent by other diagnostic instruments. In this way, when the MCU can only process the request of a single diagnostic instrument at the same time, it can still meet the scenario where multiple diagnostic instruments coexist.
[0056] Further, based on the above embodiment, the above routing rule change instruction may include: a service ID, a rule ID and a status bit.
[0057] Specifically, the service ID can be an ID other than a standard UDS service, used to trigger the routing rule change instruction; the rule ID can be an ID corresponding to the diagnostic flush routing rule, used to indicate which routing rule is controlled; the status bit is used to indicate whether the routing rule is turned on or off, for example: an on status bit can be defined as 01 (such as: the routing rule change instruction can be 0xEEEE01), and the corresponding off status bit can be defined as 00 (such as: the routing rule change instruction can be 0xEEEE00). As an implementation method, the service ID, rule ID and status bit can all be 1 byte in length.
[0058] It should be noted that, as another implementation, the above-mentioned routing rule change instruction may also only include: service ID and status bit, and the specific routing rules may be pre-configured in the DOIP gateway.
[0059] As another implementation, the routing rule change instruction may include a TCP header, a DOIP header, a DOIP source address, and a DOIP destination address in addition to the service ID, rule ID, and status bit. Figure 5 , Figure 5 A schematic diagram of a routing rule change instruction provided for an embodiment of the present application, wherein the content of the DOIP header can still use the definition of the DOIP diagnostic message 0x8001 (see ISO 13400-2), that is, this control instruction still conforms to the format of an ordinary DOIP diagnostic message, and the difference is that the subsequent payload part is designed as a control instruction; in addition, the DOIP gateway can distinguish whether it is a routing rule change instruction by the DOIP destination address.
[0060] In the above scheme, the routing rule change instruction may include a service ID, a rule ID and a status bit, so that after the DOIP gateway receives the above routing rule change instruction, it can turn on or off the corresponding diagnostic flash routing rule based on the service ID, rule ID and status bit, so that when the MCU can only process the request of a single diagnostic instrument at the same time, it can still meet the scenario where multiple diagnostic instruments coexist.
[0061] Further, based on the above embodiment, the above step S401 may specifically include the following steps:
[0062] Step 1), determine the diagnostic flash routing rule according to the service ID and the rule ID.
[0063] Step 2), enable or disable the diagnostic flash routing rule according to the status bit.
[0064] Specifically, in the above step 1), it can be determined that the current routing rule is a diagnostic flush routing rule according to the service ID and the rule ID in the routing rule change instruction.
[0065] In the above step 2), the diagnostic flash routing rule can be turned on or off according to the status bit in the routing rule change instruction; for example, when the status bit is 01, the diagnostic flash routing rule can be turned on, and when the status bit is 00, the diagnostic flash routing rule can be turned off.
[0066] In the above scheme, after the DOIP gateway receives the above-mentioned routing rule change instruction, it can determine the corresponding diagnostic flash routing rule based on the service ID and the rule ID, and turn on or off the above-mentioned diagnostic flash routing rule based on the status bit, so that when the MCU can only process the request of a single diagnostic instrument at the same time, it can still meet the scenario where multiple diagnostic instruments coexist.
[0067] Further, based on the above embodiment, before the above step S401, after receiving the DOIP message, the DOIP gateway may determine whether the above DOIP message belongs to a routing rule change instruction. At this time, the diagnostic flashing method of the domain controller provided in the embodiment of the present application may also include the following steps:
[0068] Step 1) When receiving a first DOIP message, determine whether the first DOIP message is a DOIP diagnostic message.
[0069] Step 2): if the first DOIP message is a DOIP diagnosis message, determine whether the target address of the first DOIP message is the virtual node address for receiving the routing rule change instruction.
[0070] Step 3), if the destination address of the first DOIP message is the address of the virtual node receiving the routing rule change instruction, it is determined whether the source address of the first DOIP message is in the whitelist.
[0071] Step 4): if the source address of the first DOIP message is in the whitelist, the first DOIP message is determined to be a routing rule change instruction.
[0072] Specifically, in the above step 1), the first DOIP message can be any type of DOIP message, and the DOIP gateway can first determine whether the first DOIP message is a DOIP diagnostic message. As an implementation method, the DOIP header in the first DOIP message can be identified; if the value of the message type field in the DOIP header is 0x8001, the first DOIP message can be considered to be a DOIP diagnostic message, otherwise the first DOIP message is not a DOIP diagnostic message.
[0073] In the above step 2), when the above first DOIP message is a DOIP diagnostic message, the DOIP gateway may further determine whether the target address of the first DOIP message is the virtual node address for receiving the routing rule change instruction.
[0074] Among them, the virtual node address for receiving the routing rule change instruction refers to an address outside the vehicle ECU address list preset in the DOIP gateway. It does not correspond to the actual ECU, but is only a virtual node defined in the DOIP gateway to receive the routing rule change instruction; therefore, the specific value of the virtual node address can be agreed upon in advance by the sender and the gateway, as long as it does not conflict with the address in the existing DOIP routing table.
[0075] In the above step 3), when the target address of the above first DOIP message is the address of the virtual node receiving the routing rule change instruction, the DOIP gateway can further determine whether the source address of the first DOIP message is in the whitelist.
[0076] Among them, the whitelist corresponding to the above-mentioned source address is used to distinguish whether the first DOIP message comes from the internal diagnostic instrument in the MPU. If the source address of the first DOIP message is in the whitelist, the first DOIP message comes from the internal diagnostic instrument in the MPU, otherwise the first DOIP message does not come from the internal diagnostic instrument in the MPU.
[0077] In the above step 4), when the source address of the above first DOIP message is in the whitelist, the DOIP gateway may determine that the first DOIP message is a routing rule change instruction, and execute the above step S401.
[0078] In the above scheme, the DOIP gateway will receive various DOIP messages, so it is necessary to determine whether the first DOIP message received is a routing rule change instruction, so that when the first DOIP message received is a routing rule change instruction, the corresponding diagnostic flushing routing rule can be turned on or off. Among them, by determining whether the source address of the first DOIP message is in the whitelist, security can be further improved.
[0079] Further, based on the above embodiments, please refer to Figure 6 , Figure 6 A schematic diagram of a process for implementing a diagnostic flushing routing rule on or off provided in an embodiment of the present application, wherein the process for implementing a diagnostic flushing routing rule on or off may specifically include the following steps:
[0080] Step 1) When receiving a first DOIP message, determine whether the first DOIP message is a DOIP diagnostic message.
[0081] Step 2), if the first DOIP message is a DOIP diagnosis message, determine whether the target address of the first DOIP message is the virtual node address for receiving the routing rule change instruction; otherwise, determine that the first DOIP message is not a routing rule change instruction and process it according to the normal message process.
[0082] Step 3), if the target address of the first DOIP message is the virtual node address that receives the routing rule change instruction, determine whether the source address of the first DOIP message is in the whitelist; otherwise, determine that the first DOIP message is not a routing rule change instruction and process it according to the normal message process.
[0083] Step 4), if the source address of the first DOIP message is in the whitelist, the first DOIP message is determined to be a routing rule change instruction; otherwise, the first DOIP message is determined to be a non-routing rule change instruction and is processed according to the ordinary message process.
[0084] Step 5), when a routing rule change instruction is received, the corresponding diagnostic flush routing rule is turned on or off according to the routing rule change instruction.
[0085] Further, based on the above embodiment, before the above step S402, after receiving the DOIP message, the DOIP gateway can determine whether the above DOIP message belongs to an MCU flash request. At this time, the diagnostic flash method of the domain controller provided in the embodiment of the present application can also include the following steps:
[0086] Step 1) When receiving the second DOIP message, determine whether the source address corresponding to the second DOIP message is an external diagnostic instrument.
[0087] Step 2): if the source address corresponding to the second DOIP message is an external diagnostic instrument, determine whether the target address corresponding to the second DOIP message is an MCU.
[0088] Step 3), if the target address corresponding to the second DOIP message is MCU, it is determined whether the service ID corresponding to the second DOIP message is in the shielding list.
[0089] Step 4): if the service ID corresponding to the second DOIP message is in the shielding list, it is determined that the second DOIP message is a non-MCU flashing request.
[0090] Specifically, in the above step 1), the second DOIP message may be any type of DOIP message, and the DOIP gateway may first determine whether the source address corresponding to the second DOIP message is an external diagnostic instrument.
[0091] In the above step 2), when the source address corresponding to the second DOIP message is an external diagnostic instrument, the DOIP gateway may further determine whether the target address corresponding to the second DOIP message is an MCU.
[0092] In the above step 3), when the target address corresponding to the above second DOIP message is MCU, the DOIP gateway can further determine whether the service ID corresponding to the second DOIP message is in the shielding list.
[0093] In the above step 4), when the service ID corresponding to the above second DOIP message is in the shielding list, the DOIP gateway may determine that the second DOIP message is a non-MCU flashing request, and execute the above step S402.
[0094] In the above scheme, the DOIP gateway will receive various DOIP messages, so it is necessary to determine whether the second DOIP message received is an MCU flash request, so that only the MCU flash request sent by an internal diagnostic instrument can be sent to the MCU, while the messages sent by other diagnostic instruments can be shielded.
[0095] Further, based on the above embodiment, the above shielding list may include 0x3E.
[0096] Specifically, because the external diagnostic instrument will periodically send a Tester Present request during diagnostic flashing, the shielding list corresponding to the above service ID may include 0x3E.
[0097] In the above scheme, since the external diagnostic instrument periodically sends a diagnostic instrument device online (Tester Present) message during the diagnostic flashing process of the domain controller, the corresponding 0x3E service can be included in the shielding list, thereby shielding the above Tester Present message.
[0098] Further, based on the above embodiment, before the above step S402, after receiving the DOIP message, the DOIP gateway can determine whether the above DOIP message belongs to an MCU flash request. At this time, the diagnostic flash method of the domain controller provided in the embodiment of the present application can also include the following steps:
[0099] Step 1) When receiving the second DOIP message, determine whether the source address corresponding to the second DOIP message is an internal diagnostic instrument.
[0100] Step 2): if the source address corresponding to the second DOIP message is an internal diagnostic instrument, the second DOIP message is determined to be an MCU flashing request.
[0101] In the above scheme, the DOIP gateway will receive various DOIP messages, so it is necessary to determine whether the second DOIP message received is an MCU flash request, so that only the MCU flash request sent by an internal diagnostic instrument can be sent to the MCU, while the messages sent by other diagnostic instruments can be shielded.
[0102] Further, based on the above embodiments, please refer to Figure 7 , Figure 7 A schematic diagram of a diagnostic flash routing rule implementation process provided in an embodiment of the present application, wherein the diagnostic flash routing rule implementation process may specifically include the following steps:
[0103] Step 1) When receiving the second DOIP message, determine whether the source address corresponding to the second DOIP message is an external diagnostic instrument.
[0104] Step 2): if the source address corresponding to the second DOIP message is an external diagnostic instrument, determine the type of the target address corresponding to the second DOIP message; otherwise, route the second DOIP message normally.
[0105] Step 3), if the target address type corresponding to the second DOIP message is functional addressing, traverse the target IP list forwarded by functional addressing, and determine whether the current corresponding target IP address is MCU; if the target address type corresponding to the second DOIP message is physical addressing, determine whether the target address corresponding to the second DOIP message is MCU.
[0106] Step 4), if the target address corresponding to the second DOIP message is MCU, determine whether the service ID corresponding to the second DOIP message is in the shielding list; otherwise, route the second DOIP message normally.
[0107] Step 5), if the service ID corresponding to the second DOIP message is in the shielding list, the second DOIP message is determined to be a non-MCU flashing request; otherwise, the second DOIP message is routed normally.
[0108] Step 6), when the diagnostic flash routing rule is enabled and an MCU flash request is received, the MCU flash request is sent to the MCU, so that the MCU performs diagnostic flash based on the MCU flash request.
[0109] Please refer to Figure 8 , Figure 8 A schematic diagram of another method for diagnosing and flashing a domain controller provided in an embodiment of the present application. An external diagnostic instrument starts to flash the domain controller; the external diagnostic instrument diagnoses and flashes the pre-process (pre-condition check, data transmission); after preparation, the MPU diagnostic server can install the installation package for diagnosing and flashing the MPU; the MPU diagnostic server sends a routing rule change instruction to the DOIP gateway, thereby turning on the specified routing rule and suspending routing of the external diagnostic instrument message to the MCU; the MPU diagnostic server can diagnose and flash the MCU; after the MCU is flashed, the MPU diagnostic server sends a routing rule change instruction to the DOIP gateway, thereby restoring the default routing rule; the MPU diagnostic server performs the closing process.
[0110] Please refer to Fig. 9 , Fig. 9 The structural block diagram of an electronic device provided in an embodiment of the present application, the electronic device 900 includes: at least one processor 901, at least one communication interface 902, at least one memory 903 and at least one communication bus 904. Among them, the communication bus 904 is used to realize the direct connection and communication of these components, the communication interface 902 is used to communicate signaling or data with other node devices, and the memory 903 stores machine-readable instructions executable by the processor 901. When the electronic device 900 is running, the processor 901 communicates with the memory 903 through the communication bus 904, and the diagnostic flashing method of the above-mentioned domain controller is executed when the machine-readable instruction is called by the processor 901.
[0111] For example, the processor 901 of the embodiment of the present application reads a computer program from the memory 903 through the communication bus 904 and executes the computer program to implement the following method: when a routing rule change instruction is received, the corresponding diagnostic flash routing rule is turned on or off according to the routing rule change instruction; wherein, when the diagnostic flash routing rule is turned on, the DOIP gateway will only send an MCU flash request sent by an internal diagnostic instrument to the MCU; when the diagnostic flash routing rule is turned on and the MCU flash request is received, the MCU flash request is sent to the MCU, so that the MCU performs a diagnostic flash based on the MCU flash request.
[0112] Among them, the processor 901 includes one or more, which can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 901 can be a general-purpose processor, including a central processing unit (CPU), a micro control unit (MCU), a network processor (NP) or other conventional processors; it can also be a dedicated processor, including a neural network processor (NPU), a graphics processor (GPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. In addition, when there are multiple processors 901, some of them can be general-purpose processors and the other part can be dedicated processors.
[0113] The memory 903 includes one or more, which may be, but not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0114] Understandably, Fig. 9 The structure shown is for illustration only. The electronic device 900 may also include Fig. 9 More or fewer components as shown, or with Fig. 9 Different configurations are shown. Fig. 9Each component shown in can be implemented by hardware, software or a combination thereof. In the embodiment of the present application, the electronic device 900 can be, but is not limited to, a physical device such as a desktop computer, a laptop computer, a smart phone, a smart wearable device, a vehicle-mounted device, etc., and can also be a virtual device such as a virtual machine. In addition, the electronic device 900 is not necessarily a single device, but can also be a combination of multiple devices, such as a server cluster, etc.
[0115] The method in the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM or other programmable device.
[0116] The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0117] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions. When the computer program instructions are executed by a computer, the computer executes the diagnostic flashing method for the domain controller described in the aforementioned method embodiment.
[0118] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0119] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0120] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0121] It should be noted that if the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM) random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0122] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0123] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A diagnostic flashing method for a domain controller, characterized in that: Applied to DOIP gateway, including: When receiving a routing rule change instruction, the corresponding diagnostic flash routing rule is turned on or off according to the routing rule change instruction; wherein, when the diagnostic flash routing rule is turned on, the DOIP gateway will only send an MCU flash request sent by an internal diagnostic instrument to the MCU; When the diagnostic flash routing rule is enabled and the MCU flash request is received, the MCU flash request is sent to the MCU, so that the MCU performs diagnostic flash based on the MCU flash request.
2. The diagnostic flashing method of a domain controller according to claim 1, characterized in that: The routing rule change instruction includes: a service ID, a rule ID, and a status bit; The service ID is an ID other than the UDS service, the rule ID is an ID corresponding to the diagnostic flash routing rule, and the status bit represents whether the diagnostic flash routing rule is turned on or off.
3. The diagnostic flashing method of a domain controller according to claim 2, characterized in that: The step of turning on or off the corresponding diagnostic flash routing rule according to the routing rule change instruction includes: Determine the diagnostic flash routing rule according to the service ID and the rule ID; The diagnostic flash routing rule is enabled or disabled according to the status bit.
4. The diagnostic flashing method for a domain controller according to any one of claims 1 to 3, characterized in that: Before turning on or off the corresponding diagnostic flash routing rule according to the routing rule change instruction, the method further includes: Upon receiving a first DOIP message, determining whether the first DOIP message is a DOIP diagnostic message; If the first DOIP message is the DOIP diagnosis message, determining whether the target address of the first DOIP message is the virtual node address for receiving the routing rule change instruction; If the destination address of the first DOIP message is the address of the virtual node receiving the routing rule change instruction, determining whether the source address of the first DOIP message is in the whitelist; If the source address of the first DOIP message is in the whitelist, it is determined that the first DOIP message is the routing rule change instruction.
5. The diagnostic flashing method for a domain controller according to any one of claims 1 to 3, characterized in that: Before sending the MCU flash writing request to the MCU, the method further includes: When receiving the second DOIP message, determining whether the source address corresponding to the second DOIP message is an external diagnostic instrument; If the source address corresponding to the second DOIP message is the external diagnostic instrument, determining whether the target address corresponding to the second DOIP message is the MCU; If the target address corresponding to the second DOIP message is the MCU, determining whether the service ID corresponding to the second DOIP message is in the shielding list; If the service ID corresponding to the second DOIP message is in the shielding list, it is determined that the second DOIP message is a non-MCU flashing request.
6. The diagnostic flashing method of a domain controller according to claim 5, characterized in that: The shield list includes 0x3E.
7. The diagnostic flashing method for a domain controller according to any one of claims 1 to 3, characterized in that: Before sending the MCU flash writing request to the MCU, the method further includes: Upon receiving the second DOIP message, determining whether the source address corresponding to the second DOIP message is an internal diagnostic instrument; If the source address corresponding to the second DOIP message is the internal diagnostic instrument, the second DOIP message is determined as the MCU flash writing request.
8. A diagnostic flashing system for a domain controller, characterized in that: include: Domain controller; An external diagnostic instrument, used for sending a domain controller flashing request and a function addressing diagnostic instrument online request to the domain controller; The domain controller includes: an MPU, an MCU and a switch, and the MPU includes: an MPU diagnostic server, an internal diagnostic instrument and a DOIP gateway; The MPU diagnostic server is used to perform diagnostic flashing on the MPU, the internal diagnostic instrument is used to receive the MCU flashing request sent by the MPU diagnostic server, and the DOIP gateway is used to execute the diagnostic flashing method of the domain controller as described in any one of claims 1-7.
9. An electronic device, characterized in that: include: processor, memory, and bus; The processor and the memory communicate with each other via the bus; The memory stores computer program instructions that can be executed by the processor, and the processor calls the computer program instructions to execute the diagnostic flashing method for the domain controller as described in any one of claims 1-7.
10. A computer program product, characterized in that The computer program product includes instructions, and when the instructions are executed by a computer, the computer implements the diagnostic flashing method for a domain controller according to any one of claims 1 to 7.
