A vehicle diagnosis method and device based on ID allocation, equipment and storage medium
Patent Information
- Application Number
- CN202611257651.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-10-09
AI Technical Summary
固定系统ID模式的地址冲突风险高,后装设备接入、多平台共用ECU易出现ID重复,引发总线挂死、通信中断,影响车辆正常行驶;且扩展性差,新增ECU或调整配置需重新规划ID、更新相关数据库,适配成本高,诊断灵活性不足,诊断设备需预设固定ID数据库,无法自动识别ECU,跨车型诊断兼容性差
[0015]本申请在目标车辆上电后,向所述目标车辆各条总线上挂载的ECU发送地址分配请求,以便各所述ECU基于所述地址分配请求返回对应的地址申请报文,并利用所述地址申请报文构建申请列表;获取本次上电可用的ID地址池,基于所述ID地址池对所述申请列表中的各ECU分配对应的ID,并对分配结果进行冲突校验,并在校验通过后建立ECU和对应ID之间的映射关系;所述ID包括CAN ID和DoIP逻辑地址;获取诊断设备发送的ECU发现请求,基于所述ECU发现请求将所述映射关系发送至所述诊断设备,以便所述诊断设备基于所述映射关系确定待诊断的目标ECU对应的目标ID,基于针对所述目标ID的诊断指令完成相应的车辆诊断操作。
Smart Images

Figure CN122883946A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle diagnostic technology, and in particular to a vehicle diagnostic method, apparatus, device, and storage medium based on ID allocation. Background Technology
[0002] As automotive electronics technology evolves towards intelligence, connectivity, and modularity, the number of ECUs (Electronic Control Units) in vehicles continues to increase, covering multiple areas such as engine control, body control, chassis control, and intelligent driving. These ECUs interact and coordinate control through buses such as CAN (Controller Area Network), CANFD (Controller Area Network with Flexible Data-rate), and in-vehicle Ethernet. Simultaneously, the widespread adoption of on-board diagnostic technology requires external diagnostic equipment to establish efficient, secure, and flexible communication with each ECU to meet core needs such as production testing, after-sales maintenance, and troubleshooting.
[0003] Currently, vehicle ECUs all use a fixed system ID allocation method, with the core definition as follows: The system ID (including node ID, logical address, diagnostic address, etc.) is preset by the automaker or ECU supplier during the production stage and hard-coded into the ECU firmware. Once determined, it remains unchanged and is unaffected by vehicle power-on, restart, ECU replacement, or other scenarios. Each ECU's fixed ID is pre-entered into the vehicle diagnostic database. External diagnostic devices (such as diagnostic tools and testing terminals) directly establish point-to-point communication with the target ECU through the preset fixed ID to complete diagnostics, flashing, fault reading, and other operations. The fixed system ID mode has a high risk of address conflicts. Aftermarket devices and ECUs shared across multiple platforms are prone to ID duplication, leading to bus hangs, communication interruptions, and affecting normal vehicle operation. Furthermore, it has poor scalability; adding a new ECU or adjusting configurations requires replanning IDs and updating the relevant database, resulting in high adaptation costs, insufficient diagnostic flexibility, and the need for diagnostic devices to pre-define a fixed ID database, making automatic ECU identification impossible and causing poor cross-vehicle diagnostic compatibility.
[0004] As can be seen from the above, how to prevent ID conflicts in order to improve the flexibility of vehicle diagnostics is an urgent problem to be solved. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a vehicle diagnostic method, apparatus, device, and storage medium based on ID allocation, which can prevent ID conflicts and improve the flexibility of vehicle diagnostics. The specific solution is as follows: Firstly, this application provides a vehicle diagnostic method based on ID allocation, applied to an in-vehicle network management module, wherein the in-vehicle network management module includes a vehicle gateway and a domain controller for the target vehicle, comprising: After the target vehicle is powered on, an address allocation request is sent to the ECUs connected to each bus of the target vehicle, so that each ECU returns a corresponding address request message based on the address allocation request and uses the address request message to construct an application list; Obtain the available ID address pool for this power-on, assign a corresponding ID to each ECU in the application list based on the ID address pool, perform conflict verification on the allocation results, and establish a mapping relationship between the ECU and the corresponding ID after the verification is successful; the ID includes CAN ID and DoIP logical address; The diagnostic device receives an ECU discovery request and sends the mapping relationship to the diagnostic device based on the ECU discovery request. The diagnostic device then determines the target ID corresponding to the target ECU to be diagnosed based on the mapping relationship and completes the corresponding vehicle diagnostic operation based on the diagnostic instructions for the target ID.
[0006] Optionally, after the target vehicle is powered on, an address allocation request is sent to the ECUs connected to each bus of the target vehicle, so that each ECU returns a corresponding address request message based on the address allocation request, and uses the address request message to construct a request list, including: After the target vehicle is powered on, an address allocation request is sent to the ECUs connected to each bus of the target vehicle, so that each ECU returns the corresponding address request message based on the address allocation request. The address application message is parsed to obtain the corresponding message information, and the message information is stored in the application list; the message information includes ECU identification information, ECU function type and hardware version.
[0007] Optionally, the step of obtaining the available ID address pool for this power-on, assigning corresponding IDs to each ECU in the application list based on the ID address pool, performing conflict verification on the allocation results, and establishing a mapping relationship between the ECU and the corresponding ID after the verification passes includes: Obtain the available ID address pool for this power-on, and assign corresponding IDs to each ECU in the application list based on the application order and the ID address pool to obtain the corresponding allocation results; Determine whether the allocation result results in an ID allocation conflict; If no ID allocation conflict occurs, the verification is successful, and a mapping relationship between ECU identification information and corresponding ID is established based on the allocation result.
[0008] Optionally, after establishing the mapping relationship between the ECU and the corresponding ID after successful verification, the method further includes: Based on the mapping relationship and the allocation result, a corresponding allocation confirmation broadcast message is generated and sent to the bus so that each ECU of the bus can return a corresponding response message based on the allocation confirmation broadcast message.
[0009] Optional, also includes: If an abnormal situation is detected in the target vehicle, the abnormal ECU is identified, and an address allocation request is sent to the abnormal ECU. Then, the process jumps to the step where each ECU returns the corresponding address request message based on the address allocation request, until the conflict verification is passed and the mapping relationship is updated based on the ID of the abnormal ECU. The abnormal situation includes ECU hot-plugging and restarting.
[0010] Optionally, obtaining the ECU discovery request sent by the diagnostic device and sending the mapping relationship to the diagnostic device based on the ECU discovery request includes: A connection between the diagnostic device and the target vehicle is established based on the target interface, and the ECU discovery request sent by the diagnostic device is obtained based on the connection; the target interface includes an OBD interface and an Ethernet interface; The request message corresponding to the ECU discovery request is subjected to protocol format verification and access permission verification. After both verifications pass, the mapping relationship is encapsulated to obtain the encapsulated mapping relationship. The ECU discovery response message including the encapsulated mapping relationship is sent to the diagnostic device.
[0011] Optionally, the step of sending the mapping relationship to the diagnostic device based on the ECU discovery request, so that the diagnostic device determines the target ID corresponding to the target ECU to be diagnosed based on the mapping relationship, and completes the corresponding vehicle diagnostic operation based on the diagnostic instructions for the target ID, includes: Based on the ECU discovery request, the mapping relationship is sent to the diagnostic device so that the diagnostic device can parse the mapping relationship and determine the target ID corresponding to the target ECU to be diagnosed based on the parsing result; The diagnostic command for the target ID is forwarded to the subnet channel of the target ECU so that the target ECU can return a corresponding diagnostic response message. The diagnostic response message is then routed to the diagnostic device to complete the corresponding vehicle diagnostic operation.
[0012] Secondly, this application provides a vehicle diagnostic device based on ID allocation, applied to an in-vehicle network management module, the in-vehicle network management module including a vehicle gateway and a domain controller of the target vehicle, comprising: The application list construction module is used to send address allocation requests to the ECUs connected to each bus of the target vehicle after the target vehicle is powered on, so that each ECU returns the corresponding address application message based on the address allocation request, and uses the address application message to construct an application list. The mapping relationship establishment module is used to obtain the ID address pool available for this power-on, assign corresponding IDs to each ECU in the application list based on the ID address pool, perform conflict verification on the allocation results, and establish a mapping relationship between the ECU and the corresponding ID after the verification is passed; the ID includes CAN ID and DoIP logical address; The vehicle diagnostic module is used to acquire ECU discovery requests sent by diagnostic equipment, and send the mapping relationship to the diagnostic equipment based on the ECU discovery request, so that the diagnostic equipment can determine the target ID corresponding to the target ECU to be diagnosed based on the mapping relationship, and complete the corresponding vehicle diagnostic operation based on the diagnostic instructions for the target ID.
[0013] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the aforementioned ID-based vehicle diagnostic method.
[0014] Fourthly, this application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned vehicle diagnostic method based on ID allocation.
[0015] After the target vehicle is powered on, this application sends address allocation requests to the ECUs connected to each bus of the target vehicle, so that each ECU returns a corresponding address request message based on the address allocation request, and constructs an application list using the address request message; obtains the ID address pool available for this power-on, allocates a corresponding ID to each ECU in the application list based on the ID address pool, performs conflict verification on the allocation results, and establishes a mapping relationship between the ECU and the corresponding ID after the verification is successful; the ID includes CAN ID and DoIP logical address; obtains an ECU discovery request sent by a diagnostic device, and sends the mapping relationship to the diagnostic device based on the ECU discovery request, so that the diagnostic device determines the target ID corresponding to the target ECU to be diagnosed based on the mapping relationship, and completes the corresponding vehicle diagnostic operation based on the diagnostic instructions for the target ID.
[0016] As can be seen from the above, after the target vehicle is powered on, the vehicle network management module broadcasts an address allocation request to all ECUs on the bus, collects the application messages from each ECU, and centrally constructs an application list to ensure that all online ECUs are included in the allocation scope during this power-on cycle, with no nodes missing. The module then calls the available ID address pool for this power-on cycle to complete the allocation. After conflict verification, a mapping relationship between ECUs and IDs is established to ensure that all allocated IDs are globally unique, eliminating address duplication from the source. In this way, after the diagnostic equipment connects, it obtains the mapping relationship through a discovery request, locates the dynamic ID of the target ECU based on the mapping table, and performs diagnostic operations. The diagnostic equipment does not need to pre-set an ID database, supports cross-vehicle diagnostics, improves maintenance efficiency, and enhances diagnostic flexibility. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0018] Figure 1 This is a flowchart of a vehicle diagnostic method based on ID allocation disclosed in this application; Figure 2 This is a schematic diagram of the structure of a vehicle diagnostic device based on ID allocation disclosed in this application; Figure 3 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] Currently, vehicle ECUs all use a fixed system ID allocation method, which is hard-coded into the ECU firmware. Once determined, it remains unchanged and is unaffected by vehicle power-on, restart, or ECU replacement. However, the fixed system ID mode has a high risk of address conflicts. Aftermarket devices and ECUs shared across multiple platforms are prone to ID duplication, leading to bus hangs, communication interruptions, and affecting normal vehicle operation. Furthermore, it has poor scalability; adding a new ECU or adjusting the configuration requires replanning IDs and updating the relevant database, resulting in high adaptation costs, insufficient diagnostic flexibility, and diagnostic equipment requiring a pre-set fixed ID database. It cannot automatically identify ECUs and has poor cross-vehicle diagnostic compatibility. Therefore, this application provides a vehicle diagnostic method based on ID allocation. After the diagnostic equipment connects, it obtains the mapping relationship through a discovery request, locates the dynamic ID of the target ECU based on the mapping table, and performs diagnostic operations. The diagnostic equipment does not need a pre-set ID database, supports cross-vehicle diagnostics, improves maintenance efficiency, and enhances diagnostic flexibility.
[0021] See Figure 1 As shown, this embodiment of the invention discloses a vehicle diagnostic method based on ID allocation, applied to an in-vehicle network management module. The in-vehicle network management module includes a vehicle gateway and a domain controller for the target vehicle, comprising: Step S11: After the target vehicle is powered on, an address allocation request is sent to the ECUs connected to each bus of the target vehicle, so that each ECU returns a corresponding address request message based on the address allocation request and uses the address request message to construct an application list.
[0022] In this embodiment, after the target vehicle is powered on, the vehicle network management module sends address allocation request broadcast messages to the ECUs connected to each bus of the target vehicle, so that each ECU returns a corresponding address application message to the vehicle network management module based on the address allocation request; it supports mainstream buses such as CAN, CAN FD, and vehicle Ethernet. The vehicle network management module parses all address application messages, extracts message information, and constructs an application list. The message information includes the ECU's unique fixed identification information (UUID (Universally Unique Identifier) / serial number), ECU function type (such as EMS (Engine Management System), BCM (Body Control Module), etc.), and hardware version information.
[0023] Specifically, after the target vehicle is powered on, an address allocation request is sent to the ECUs connected to each bus of the target vehicle, so that each ECU returns a corresponding address request message based on the address allocation request, and an application list is constructed using the address request message. This includes: after the target vehicle is powered on, sending an address allocation request to the ECUs connected to each bus of the target vehicle, so that each ECU returns a corresponding address request message based on the address allocation request; parsing the address request message to obtain the corresponding message information, and storing the message information in the application list; the message information includes ECU identification information, ECU function type, and hardware version.
[0024] Step S12: Obtain the ID address pool available for this power-on, assign corresponding IDs to each ECU in the application list based on the ID address pool, perform conflict verification on the allocation results, and establish a mapping relationship between the ECU and the corresponding ID after the verification is passed; the ID includes CAN ID and DoIP logical address.
[0025] In this embodiment, the available ID address pool for the current power-on cycle is obtained, and IDs are allocated to each ECU in sequence based on the application order in the application list and the ID address pool. After obtaining the allocation result, it is determined whether there is an ID allocation conflict. If there is no ID allocation conflict, it indicates that the verification is successful, and a mapping relationship between the unique identification information of the ECU and the corresponding ID is established based on the allocation result.
[0026] Specifically, the step of obtaining the ID address pool available for this power-on, assigning corresponding IDs to each ECU in the application list based on the ID address pool, performing conflict verification on the allocation results, and establishing a mapping relationship between the ECU and the corresponding ID after the verification passes, includes: obtaining the ID address pool available for this power-on, assigning corresponding IDs to each ECU in the application list based on the application order in the application list and the ID address pool to obtain the corresponding allocation results; determining whether the allocation results have ID allocation conflicts; if no ID allocation conflicts occur, it indicates that the verification has passed, and establishing a mapping relationship between ECU identification information and the corresponding ID based on the allocation results.
[0027] It is understandable that if an ID allocation conflict occurs in the allocation results, the entire allocation results are traversed first to locate the duplicate ID values, and all ECU nodes that have been assigned the duplicate ID are selected and marked as nodes to be reassigned; the allocation results of the remaining ECUs that do not have ID conflicts are temporarily locked, and the IDs corresponding to the locked ECUs are removed from the available ID address pool and do not participate in the subsequent reassignment process to avoid secondary occupation. The system retrieves the number of unallocated available IDs remaining in the available ID address pool and determines whether this number is not less than the number of ECUs corresponding to the node to be reassigned. If it is, the system proceeds directly to the reassignment step. If it is less than the number of ECUs corresponding to the node to be reassigned, the system calls a preset backup ID address range to expand the available ID address pool. If there is no backup ID range available, the system sorts the ECUs according to their functional priority. For example, safety-related ECUs such as those in the powertrain and chassis domains have the highest priority, followed by those in the body and entertainment domains. The system retains the allocated IDs of high-priority ECUs and only includes conflicting low-priority ECUs in the reassignment range. In other words, the system allocates new IDs to each ECU to be reassigned sequentially from the available address pool according to the order of address requests or functional priority. Real-time verification is performed during the reassignment process to prevent newly allocated IDs from being duplicated with locked IDs or IDs reassigned in the same batch.
[0028] Furthermore, after successful verification and the establishment of the mapping relationship, the vehicle network management module generates an allocation confirmation broadcast message based on the mapping relationship and the allocation result, and sends the allocation confirmation broadcast message to each bus. This allows each ECU on each bus to receive the allocation confirmation broadcast message, initialize its own dynamic ID, and initiate bus communication based on the dynamic ID. Specifically, after establishing the mapping relationship between the ECU and the corresponding ID after successful verification, the process further includes: generating a corresponding allocation confirmation broadcast message based on the mapping relationship and the allocation result, and sending the allocation confirmation broadcast message to the bus. This allows each ECU on the bus to return a corresponding response message based on the allocation confirmation broadcast message.
[0029] In this embodiment, if the vehicle network management module detects an abnormal situation in the target vehicle, it identifies the abnormal ECU and sends an address allocation request to the abnormal ECU. The address application, ID allocation, and conflict verification process is then re-executed until the conflict verification passes. Afterward, the mapping relationship is updated based on the newly allocated ID of the abnormal ECU. The abnormal situation includes ECU hot-plugging and ECU restart to ensure uninterrupted bus communication when the ECU's state changes during vehicle operation. Specifically, the process also includes: if an abnormal situation is detected in the target vehicle, identifying the abnormal ECU and sending an address allocation request to it, then proceeding to the step where each ECU returns a corresponding address application message based on the address allocation request, until the conflict verification passes and the mapping relationship is updated based on the ID of the abnormal ECU. The abnormal situation includes ECU hot-plugging and restart.
[0030] Step S13: Obtain the ECU discovery request sent by the diagnostic device, and send the mapping relationship to the diagnostic device based on the ECU discovery request, so that the diagnostic device can determine the target ID corresponding to the target ECU to be diagnosed based on the mapping relationship, and complete the corresponding vehicle diagnostic operation based on the diagnostic instructions for the target ID.
[0031] In this embodiment, a connection is first established between the diagnostic device and the target vehicle via the OBD interface or the vehicle Ethernet interface. An ECU discovery request sent by the diagnostic device is then obtained. This ECU discovery request message supports UDS (Unified Diagnostic Services) diagnostic services and the DoIP protocol format. The ECU discovery request undergoes protocol format verification to determine if it conforms to the specifications of the corresponding diagnostic protocol. Subsequently, access permission verification is performed to verify the access permissions of the diagnostic device, ensuring the security of the diagnostic operation. If either the protocol format verification or the access permission verification fails, a rejection response is returned to the diagnostic device. If both verifications pass, the mapping relationship is encapsulated to generate an ECU discovery response message containing the encapsulated mapping relationship, which is then fed back to the diagnostic device via broadcast or unicast.
[0032] Specifically, the step of obtaining the ECU discovery request sent by the diagnostic device and sending the mapping relationship to the diagnostic device based on the ECU discovery request includes: establishing a connection relationship between the diagnostic device and the target vehicle based on a target interface, and obtaining the ECU discovery request sent by the diagnostic device based on the connection relationship; the target interface includes an OBD interface and an Ethernet interface; performing protocol format verification and access permission verification on the request message corresponding to the ECU discovery request, and encapsulating the mapping relationship after both verifications pass to obtain the encapsulated mapping relationship, and sending the ECU discovery response message including the encapsulated mapping relationship to the diagnostic device.
[0033] Understandably, the mapping relationship is sent to the diagnostic device so that the device can parse it, obtain and display information such as the unique identifier, function type, and dynamic ID of all ECUs, and thus determine the target ECU to be diagnosed. This eliminates the need to pre-set a fixed ID database in the diagnostic device, allowing identification of all ECUs in the vehicle and supporting cross-vehicle diagnostics. The process involves determining the target ID corresponding to the target ECU, obtaining a diagnostic command for that target ID, performing routing based on the target ID in the diagnostic command, and forwarding the diagnostic command to the subnet channel where the target ECU resides. This allows the target ECU to execute the operation corresponding to the diagnostic command, generate a diagnostic response message, and send it to the vehicle network management module. The vehicle network management module then routes and forwards the diagnostic response message to the diagnostic device, completing one diagnostic interaction. Repeating this command sending and receiving process completes the entire vehicle diagnostic operation.
[0034] Specifically, the step of sending the mapping relationship to the diagnostic device based on the ECU discovery request, so that the diagnostic device can determine the target ID corresponding to the target ECU to be diagnosed based on the mapping relationship, and complete the corresponding vehicle diagnostic operation based on the diagnostic command for the target ID, includes: sending the mapping relationship to the diagnostic device based on the ECU discovery request, so that the diagnostic device can parse the mapping relationship and determine the target ID corresponding to the target ECU to be diagnosed based on the parsing result; forwarding the diagnostic command for the target ID to the subnet channel of the target ECU, so that the target ECU can return a corresponding diagnostic response message; and routing the diagnostic response message to the diagnostic device to complete the corresponding vehicle diagnostic operation.
[0035] As can be seen from the above, after the target vehicle is powered on, the vehicle network management module broadcasts an address allocation request to all ECUs on the bus, collects the application messages from each ECU, and centrally constructs an application list to ensure that all online ECUs are included in the allocation scope during this power-on cycle, with no nodes missing. The module then calls the available ID address pool for this power-on cycle to complete the allocation. After conflict verification, a mapping relationship between ECUs and IDs is established to ensure that all allocated IDs are globally unique, eliminating address duplication from the source. In this way, after the diagnostic equipment connects, it obtains the mapping relationship through a discovery request, locates the dynamic ID of the target ECU based on the mapping table, and performs diagnostic operations. The diagnostic equipment does not need to pre-set an ID database, supports cross-vehicle diagnostics, improves maintenance efficiency, and enhances diagnostic flexibility.
[0036] Accordingly, see Figure 2 As shown, this application also provides a vehicle diagnostic device based on ID allocation, applied to an in-vehicle network management module. The in-vehicle network management module includes a vehicle gateway and a domain controller for the target vehicle, comprising: The application list construction module 11 is used to send address allocation requests to the ECUs connected to each bus of the target vehicle after the target vehicle is powered on, so that each ECU returns the corresponding address application message based on the address allocation request and uses the address application message to construct an application list. The mapping relationship establishment module 12 is used to obtain the ID address pool available for this power-on, allocate corresponding IDs to each ECU in the application list based on the ID address pool, perform conflict verification on the allocation results, and establish a mapping relationship between the ECU and the corresponding ID after the verification is passed; the ID includes CAN ID and DoIP logical address; The vehicle diagnostic module 13 is used to acquire the ECU discovery request sent by the diagnostic device, and send the mapping relationship to the diagnostic device based on the ECU discovery request, so that the diagnostic device can determine the target ID corresponding to the target ECU to be diagnosed based on the mapping relationship, and complete the corresponding vehicle diagnostic operation based on the diagnostic instructions for the target ID.
[0037] In some specific embodiments, the application list construction module 11 may specifically include: The application message return unit is used to send an address allocation request to the ECUs connected to each bus of the target vehicle after the target vehicle is powered on, so that each ECU returns a corresponding address application message based on the address allocation request; The message information storage unit is used to parse the address application message to obtain the corresponding message information and store the message information in the application list; the message information includes ECU identification information, ECU function type and hardware version.
[0038] In some specific embodiments, the mapping relationship establishment module 12 may specifically include: The ID allocation unit is used to obtain the ID address pool available for this power-on, and allocate the corresponding ID to each ECU in the application list based on the application order in the application list and the ID address pool, so as to obtain the corresponding allocation result; A conflict determination unit is used to determine whether an ID allocation conflict occurs in the allocation result; The mapping relationship establishment unit is used to indicate that the verification is successful if no ID allocation conflict occurs, and to establish a mapping relationship between ECU identification information and corresponding ID based on the allocation result.
[0039] In some specific embodiments, the vehicle diagnostic device based on ID allocation may further include: The response message return unit is used to generate a corresponding allocation confirmation broadcast message based on the mapping relationship and the allocation result, and send the allocation confirmation broadcast message to the bus so that each ECU of the bus can return a corresponding response message based on the allocation confirmation broadcast message.
[0040] In some specific embodiments, the vehicle diagnostic device based on ID allocation may further include: The mapping relationship update unit is used to identify the abnormal ECU if an abnormal situation is detected in the target vehicle, send an address allocation request to the abnormal ECU, and then jump to the step of each ECU returning the corresponding address application message based on the address allocation request, until the conflict verification is passed and the mapping relationship is updated based on the ID of the abnormal ECU; the abnormal situation includes ECU hot-plugging and restarting.
[0041] In some specific embodiments, the vehicle diagnostic module 13 may specifically include: The discovery request acquisition unit is used to establish a connection relationship between the diagnostic device and the target vehicle based on the target interface, and to acquire the ECU discovery request sent by the diagnostic device based on the connection relationship; the target interface includes an OBD interface and an Ethernet interface; The message sending unit is used to perform protocol format verification and access permission verification on the request message corresponding to the ECU discovery request, and after both verifications pass, encapsulate the mapping relationship to obtain the encapsulated mapping relationship, and send the ECU discovery response message including the encapsulated mapping relationship to the diagnostic device.
[0042] In some specific embodiments, the vehicle diagnostic module 13 may specifically include: The target ID determination unit is used to send the mapping relationship to the diagnostic device based on the ECU discovery request, so that the diagnostic device can parse the mapping relationship and determine the target ID corresponding to the target ECU to be diagnosed based on the parsing result; The message routing unit is used to forward the diagnostic command for the target ID to the subnet channel of the target ECU, so that the target ECU can return the corresponding diagnostic response message, and route the diagnostic response message to the diagnostic device to complete the corresponding vehicle diagnostic operation.
[0043] Furthermore, embodiments of this application also disclose an electronic device, Figure 3 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the ID-based vehicle diagnostic method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0044] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0045] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0046] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the ID-based vehicle diagnostic method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0047] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned ID-based vehicle diagnostic method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0048] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0049] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0050] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0051] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0052] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A vehicle diagnostic method based on ID allocation, characterized in that, Applied to an in-vehicle network management module, the in-vehicle network management module includes a vehicle gateway and a domain controller for the target vehicle, including: After the target vehicle is powered on, an address allocation request is sent to the ECUs connected to each bus of the target vehicle, so that each ECU returns a corresponding address request message based on the address allocation request and uses the address request message to construct an application list; Obtain the available ID address pool for this power-on, assign a corresponding ID to each ECU in the application list based on the ID address pool, perform conflict verification on the allocation results, and establish a mapping relationship between the ECU and the corresponding ID after the verification is successful; the ID includes CAN ID and DoIP logical address; The diagnostic device receives an ECU discovery request and sends the mapping relationship to the diagnostic device based on the ECU discovery request. The diagnostic device then determines the target ID corresponding to the target ECU to be diagnosed based on the mapping relationship and completes the corresponding vehicle diagnostic operation based on the diagnostic instructions for the target ID.
2. The vehicle diagnostic method based on ID allocation according to claim 1, characterized in that, After the target vehicle is powered on, an address allocation request is sent to the ECUs connected to each bus of the target vehicle. Each ECU then returns a corresponding address request message based on the address allocation request and uses the address request message to construct a request list, including: After the target vehicle is powered on, an address allocation request is sent to the ECUs connected to each bus of the target vehicle, so that each ECU returns the corresponding address request message based on the address allocation request. The address application message is parsed to obtain the corresponding message information, and the message information is stored in the application list; the message information includes ECU identification information, ECU function type and hardware version.
3. The vehicle diagnostic method based on ID allocation according to claim 2, characterized in that, The process of obtaining the available ID address pool for this power-on, assigning corresponding IDs to each ECU in the application list based on the ID address pool, performing conflict verification on the allocation results, and establishing a mapping relationship between the ECU and the corresponding ID after the verification passes includes: Obtain the available ID address pool for this power-on, and assign corresponding IDs to each ECU in the application list based on the application order and the ID address pool to obtain the corresponding allocation results; Determine whether the allocation result results in an ID allocation conflict; If no ID allocation conflict occurs, the verification is successful, and a mapping relationship between ECU identification information and corresponding ID is established based on the allocation result.
4. The vehicle diagnostic method based on ID allocation according to claim 1, characterized in that, After establishing the mapping relationship between the ECU and the corresponding ID after successful verification, the process also includes: Based on the mapping relationship and the allocation result, a corresponding allocation confirmation broadcast message is generated and sent to the bus so that each ECU of the bus can return a corresponding response message based on the allocation confirmation broadcast message.
5. The vehicle diagnostic method based on ID allocation according to claim 1, characterized in that, Also includes: If an abnormal situation is detected in the target vehicle, the abnormal ECU is identified, and an address allocation request is sent to the abnormal ECU. Then, the process jumps to the step where each ECU returns the corresponding address request message based on the address allocation request, until the conflict verification is passed and the mapping relationship is updated based on the ID of the abnormal ECU. The abnormal situation includes ECU hot-plugging and restarting.
6. The vehicle diagnostic method based on ID allocation according to claim 1, characterized in that, The step of acquiring the ECU discovery request sent by the diagnostic device and sending the mapping relationship to the diagnostic device based on the ECU discovery request includes: A connection between the diagnostic device and the target vehicle is established based on the target interface, and the ECU discovery request sent by the diagnostic device is obtained based on the connection; the target interface includes an OBD interface and an Ethernet interface; The request message corresponding to the ECU discovery request is subjected to protocol format verification and access permission verification. After both verifications pass, the mapping relationship is encapsulated to obtain the encapsulated mapping relationship. The ECU discovery response message including the encapsulated mapping relationship is sent to the diagnostic device.
7. The vehicle diagnostic method based on ID allocation according to any one of claims 1 to 6, characterized in that, The process involves sending the mapping relationship to the diagnostic device based on the ECU discovery request, so that the diagnostic device can determine the target ID corresponding to the target ECU to be diagnosed based on the mapping relationship, and complete the corresponding vehicle diagnostic operation based on the diagnostic instructions for the target ID, including: Based on the ECU discovery request, the mapping relationship is sent to the diagnostic device so that the diagnostic device can parse the mapping relationship and determine the target ID corresponding to the target ECU to be diagnosed based on the parsing result; The diagnostic command for the target ID is forwarded to the subnet channel of the target ECU so that the target ECU can return a corresponding diagnostic response message. The diagnostic response message is then routed to the diagnostic device to complete the corresponding vehicle diagnostic operation.
8. A vehicle diagnostic device based on ID allocation, characterized in that, Applied to an in-vehicle network management module, the in-vehicle network management module includes a vehicle gateway and a domain controller for the target vehicle, including: The application list construction module is used to send address allocation requests to the ECUs connected to each bus of the target vehicle after the target vehicle is powered on, so that each ECU returns the corresponding address application message based on the address allocation request, and uses the address application message to construct an application list. The mapping relationship establishment module is used to obtain the ID address pool available for this power-on, assign corresponding IDs to each ECU in the application list based on the ID address pool, perform conflict verification on the allocation results, and establish a mapping relationship between the ECU and the corresponding ID after the verification is passed; the ID includes CAN ID and DoIP logical address; The vehicle diagnostic module is used to acquire ECU discovery requests sent by diagnostic equipment, and send the mapping relationship to the diagnostic equipment based on the ECU discovery request, so that the diagnostic equipment can determine the target ID corresponding to the target ECU to be diagnosed based on the mapping relationship, and complete the corresponding vehicle diagnostic operation based on the diagnostic instructions for the target ID.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the vehicle diagnostic method based on ID allocation as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the vehicle diagnostic method based on ID allocation as described in any one of claims 1 to 7.