Vehicle diagnosis method and device compatible with local diagnosis and remote diagnosis

By introducing the main control platform and communication connection channel into the vehicle diagnostic equipment, the problem of incompatibility between DOIP Internet remote diagnosis and local wireless diagnosis in the prior art is solved, and the flexibility and compatibility of vehicle diagnosis is improved, simplifying the diagnosis process And improve efficiency.

CN119109941APending Publication Date: 2024-12-10深圳鼎匠科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410986728.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

In the existing vehicle diagnostic systems, DOIP Internet remote diagnosis and local wireless diagnosis are independent and incompatible, resulting in low flexibility and compatibility of vehicle diagnostics.

Method used

A vehicle diagnosis method and device compatible with local diagnosis and remote diagnosis is designed. By introducing a main control platform in the vehicle diagnostic equipment, including the first sub-main control platform and the second sub-main control platform, it is established according to the diagnostic mode selected by the user. Communication connects the channel, acquires and sends diagnostic command packets, and collects diagnostic data returned by the target device to determine the diagnostic results. This method uses components such as application processes, independent processes, dynamic libraries and transmission control protocol threads to realize data transmission and exchange of third-party diagnostic platforms and vehicles.

Benefits of technology

Compatible and integrated remote or local diagnosis in a set of solutions or equipment improves the flexibility and compatibility of vehicle diagnosis, simplifies the diagnostic process, and improves diagnostic efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119109941A_ABST
    Figure CN119109941A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of vehicle diagnosis, and discloses a vehicle diagnosis method and device compatible with local diagnosis and remote diagnosis, and the method comprises the steps: obtaining a vehicle diagnosis mode selected by a user for a vehicle, and building a communication connection channel between a first sub-main-control platform and a second sub-main-control platform according to the vehicle diagnosis mode, and acquiring a diagnosis instruction data packet through a communication module corresponding to the vehicle diagnosis mode, sending the diagnosis instruction data packet to the target equipment through the main control platform, collecting target diagnosis data returned by the target equipment through the main control platform and the communication connection channel, and determining a diagnosis result for the vehicle according to the target diagnosis data. Visibly, remote or local diagnosis for the vehicle can be compatible and integrated in a set of scheme or equipment, the flexibility and compatibility degree of vehicle diagnosis are improved, the simplification and convenience of vehicle diagnosis are improved, and the diagnosis efficiency of the vehicle is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle diagnosis, and in particular to a vehicle diagnosis method and device compatible with local diagnosis and remote diagnosis. Background Art

[0002] With the continuous development of people's productivity, cars have gradually become an important means of transportation and production in people's daily lives. In order to ensure the safety of cars during operation, it is very important to diagnose cars. DOIP is a vehicle diagnostic protocol based on in-vehicle Ethernet. It has the advantages of high transmission rate and multiple application scenarios. It is the mainstream choice of vehicle diagnostic communication protocol.

[0003] However, the vehicle DOIP Internet remote diagnosis and vehicle DOIP local wireless diagnosis currently used in the market are independent and separate. The two are completely different solutions and are not compatible with each other, resulting in low flexibility and compatibility of vehicle diagnosis. Therefore, it is particularly important to propose a technical solution that can improve the flexibility and compatibility of vehicle diagnosis. Summary of the invention

[0004] The present invention provides a vehicle diagnosis method and device that are compatible with local diagnosis and remote diagnosis, which can help improve the flexibility and compatibility of vehicle diagnosis.

[0005] In order to solve the above technical problems, the first aspect of the present invention discloses a vehicle diagnosis method compatible with local diagnosis and remote diagnosis, the method is applied to a vehicle diagnosis device, the vehicle diagnosis device includes a main control platform, the main control platform includes a first sub-main control platform and a second sub-main control platform;

[0006] The method comprises:

[0007] Acquire a vehicle diagnostic mode for the vehicle selected by a user, and establish a communication connection channel between the first sub-main control platform and the second sub-main control platform according to the vehicle diagnostic mode;

[0008] Acquire a diagnostic instruction data packet through the communication module corresponding to the vehicle diagnostic mode, and send the diagnostic instruction data packet to the target device through the main control platform;

[0009] The target diagnostic data returned by the target device is collected through the main control platform and the communication connection channel, and a diagnostic result for the vehicle is determined according to the target diagnostic data.

[0010] As an optional implementation, in the first aspect of the present invention, the main control platform includes an application process and an independent process, and the target device includes a third-party diagnostic platform and the vehicle;

[0011] The step of sending the diagnostic instruction data packet to the target device through the main control platform includes:

[0012] The diagnostic instruction data packet is transferred to a dynamic library preset in the application process through a transfer interface preset in the application process;

[0013] Sending the diagnostic instruction data packet from the dynamic library to the independent process through the transmission control protocol thread in the dynamic library, and sending the diagnostic instruction data packet to the Ethernet card through the first target thread in the independent process;

[0014] Sending the diagnostic instruction data packet to the third-party diagnostic platform through the Ethernet card corresponding to the first sub-main control platform, and sending the diagnostic instruction data packet to the vehicle through the Ethernet card corresponding to the second sub-main control platform;

[0015] And, collecting the target diagnostic data returned by the target device through the main control platform and the communication connection channel includes:

[0016] collecting target diagnostic data returned by the target device through the Ethernet card, and sending the target diagnostic data to the independent process, the target diagnostic data including diagnostic communication data corresponding to the third-party diagnostic platform and vehicle data corresponding to the vehicle;

[0017] Sending the target diagnostic data to the dynamic library in the application process through a second target thread in the independent process;

[0018] The target diagnostic data is transmitted to a communication module corresponding to the vehicle diagnostic mode through the transmission interface in the application process.

[0019] As an optional implementation, in the first aspect of the present invention, the first target thread includes a first receiving thread and a first sending thread, and the second target thread includes a second receiving thread and a second sending thread;

[0020] The step of sending the diagnostic instruction data packet to the Ethernet card through the first target thread in the independent process includes:

[0021] Blocking the calling of the first target function in the first receiving thread to receive the diagnostic instruction data packet from the dynamic library, and extracting the first target data frame in the diagnostic instruction data packet;

[0022] Sending the first target data frame to the first sending thread, and sending the first target data frame to the Ethernet card through the first sending thread;

[0023] And, sending the target diagnostic data to the dynamic library in the application process through the second target thread in the independent process includes:

[0024] In the second receiving thread, blocking calling of a second target function receives the target diagnostic data from the Ethernet card, and determines whether the target diagnostic data meets a preset target condition;

[0025] When the target diagnostic data meets the target condition, the target diagnostic data is sent to the second sending thread, and the target diagnostic data is sent to the dynamic library in the application process through the second sending thread.

[0026] As an optional implementation manner, in the first aspect of the present invention, the determining whether the target diagnostic data meets a preset target condition includes:

[0027] Determine whether the source address and the destination address of the Ethernet frame of the target diagnostic data are equal to the media access control address of the Ethernet card, and when the source address or the destination address is not equal to the media access control address, obtain a target field value of a second target data frame corresponding to the target diagnostic data, the target field value including a type field value or a length field value;

[0028] Determine whether a target field value of the second target data frame satisfies a preset data frame format, and when the target field value does not satisfy the data frame format, determine whether the target field value is greater than a preset field length;

[0029] When the target field value is greater than the field length, it is determined that the target diagnostic data meets a preset target condition.

[0030] As an optional implementation, in the first aspect of the present invention, before sending the diagnostic instruction data packet from the dynamic library to the independent process through the transmission control protocol thread in the dynamic library, the method further includes:

[0031] Start an independent process with root privileges and shut down the client and server of the Dynamic Host Configuration Protocol;

[0032] Start the Ethernet card through a preset pin, and when it is detected that the Ethernet card has been started, set the Ethernet card to a target mode, wherein the target mode includes a promiscuous mode;

[0033] A transmission control protocol server is created in the independent process, and listens on the local loopback address and port. When a transmission control protocol client in the dynamic library is listened to apply for connection, the transmission control protocol server is connected to the transmission control protocol client.

[0034] As an optional embodiment, in the first aspect of the present invention, the method further comprises:

[0035] Loading the dynamic library in the application process, and starting the application in the dynamic library through a preset transfer interface;

[0036] Creating a transmission control protocol client and a transmission control protocol thread in the dynamic library, wherein the transmission control protocol client is used to connect to the transmission control protocol server in the independent process, and the transmission control protocol thread includes a transmission control protocol sending thread and a transmission control protocol receiving thread;

[0037] The transmission control protocol sending thread is used to send the diagnostic instruction data packet from the dynamic library to the independent process, and the transmission control protocol receiving thread is used to receive the target diagnostic data sent by the second target thread in the independent process.

[0038] As an optional implementation, in the first aspect of the present invention, the vehicle diagnostic mode includes a local diagnostic mode or a remote diagnostic mode;

[0039] The establishing of a communication connection channel between the first sub-main control platform and the second sub-main control platform according to the vehicle diagnostic mode includes:

[0040] When the vehicle diagnostic mode includes the local diagnostic mode, a first communication driver of a communication module corresponding to the local diagnostic mode is loaded, and the first sub-main control platform is controlled to connect to the second sub-main control platform according to a local area network type corresponding to the local diagnostic mode, so as to establish a communication connection channel between the first sub-main control platform and the second sub-main control platform, wherein the local area network type includes a Bluetooth type or a wireless broadband type;

[0041] When the vehicle diagnostic mode includes the remote diagnostic mode, the second communication driver of the communication module corresponding to the remote diagnostic mode is loaded, and when the communication module corresponding to the remote diagnostic mode is successfully connected to the network, the first sub-master control platform and the second sub-master control platform are controlled to respectively connect to the preset transit server as the transparent forwarding of data to establish a communication connection channel between the first sub-master control platform and the second sub-master control platform.

[0042] A second aspect of the present invention discloses a vehicle diagnostic device compatible with local diagnosis and remote diagnosis, the device is applied to a vehicle diagnostic device, the vehicle diagnostic device includes a main control platform, the main control platform includes a first sub-main control platform and a second sub-main control platform;

[0043] The device comprises:

[0044] An acquisition module, used for acquiring a vehicle diagnostic mode for a vehicle selected by a user, and establishing a communication connection channel between the first sub-main control platform and the second sub-main control platform according to the vehicle diagnostic mode;

[0045] A sending module, used for acquiring a diagnostic instruction data packet through a communication module corresponding to the vehicle diagnostic mode, and sending the diagnostic instruction data packet to a target device through the main control platform;

[0046] A collection module is used to collect target diagnostic data returned by the target device through the main control platform and the communication connection channel, and determine a diagnostic result for the vehicle based on the target diagnostic data.

[0047] As an optional implementation, in the second aspect of the present invention, the main control platform includes an application process and an independent process, and the target device includes a third-party diagnostic platform and the vehicle;

[0048] The method in which the sending module sends the diagnostic instruction data packet to the target device through the main control platform specifically includes:

[0049] The diagnostic instruction data packet is transferred to a dynamic library preset in the application process through a transfer interface preset in the application process;

[0050] Sending the diagnostic instruction data packet from the dynamic library to the independent process through the transmission control protocol thread in the dynamic library, and sending the diagnostic instruction data packet to the Ethernet card through the first target thread in the independent process;

[0051] Sending the diagnostic instruction data packet to the third-party diagnostic platform through the Ethernet card corresponding to the first sub-main control platform, and sending the diagnostic instruction data packet to the vehicle through the Ethernet card corresponding to the second sub-main control platform;

[0052] And, the collection module collects the target diagnostic data returned by the target device through the main control platform and the communication connection channel in a manner that specifically includes:

[0053] collecting target diagnostic data returned by the target device through the Ethernet card, and sending the target diagnostic data to the independent process, the target diagnostic data including diagnostic communication data corresponding to the third-party diagnostic platform and vehicle data corresponding to the vehicle;

[0054] Sending the target diagnostic data to the dynamic library in the application process through a second target thread in the independent process;

[0055] The target diagnostic data is transmitted to a communication module corresponding to the vehicle diagnostic mode through the transmission interface in the application process.

[0056] As an optional implementation, in the second aspect of the present invention, the first target thread includes a first receiving thread and a first sending thread, and the second target thread includes a second receiving thread and a second sending thread;

[0057] The method in which the sending module sends the diagnostic instruction data packet to the Ethernet card through the first target thread in the independent process specifically includes:

[0058] Blocking the calling of the first target function in the first receiving thread to receive the diagnostic instruction data packet from the dynamic library, and extracting the first target data frame in the diagnostic instruction data packet;

[0059] Sending the first target data frame to the first sending thread, and sending the first target data frame to the Ethernet card through the first sending thread;

[0060] And, the manner in which the collection module sends the target diagnostic data to the dynamic library in the application process through the second target thread in the independent process specifically includes:

[0061] In the second receiving thread, blocking calling of a second target function receives the target diagnostic data from the Ethernet card, and determines whether the target diagnostic data meets a preset target condition;

[0062] When the target diagnostic data meets the target condition, the target diagnostic data is sent to the second sending thread, and the target diagnostic data is sent to the dynamic library in the application process through the second sending thread.

[0063] As an optional implementation, in the second aspect of the present invention, the collection module determines whether the target diagnostic data meets the preset target condition in a manner that specifically includes:

[0064] Determine whether the source address and the destination address of the Ethernet frame of the target diagnostic data are equal to the media access control address of the Ethernet card, and when the source address or the destination address is not equal to the media access control address, obtain a target field value of a second target data frame corresponding to the target diagnostic data, the target field value including a type field value or a length field value;

[0065] Determine whether a target field value of the second target data frame satisfies a preset data frame format, and when the target field value does not satisfy the data frame format, determine whether the target field value is greater than a preset field length;

[0066] When the target field value is greater than the field length, it is determined that the target diagnostic data meets a preset target condition.

[0067] As an optional implementation, in the second aspect of the present invention, the device further includes:

[0068] A startup module, used to pull up an independent process with root authority and close a client and a server of a dynamic host configuration protocol before the sending module sends the diagnostic instruction data packet from the dynamic library to the independent process through a transmission control protocol thread in the dynamic library;

[0069] The startup module is further used to start the Ethernet card through a preset pin, and when it is detected that the startup of the Ethernet card is completed, set the Ethernet card to a target mode, wherein the target mode includes a promiscuous mode;

[0070] A creation module is used to create a transmission control protocol server in the independent process and monitor the local loopback address and port. When the transmission control protocol client in the dynamic library is monitored to apply for connection, the transmission control protocol server is connected to the transmission control protocol client.

[0071] As an optional implementation, in the second aspect of the present invention, the device further includes:

[0072] A loading module, used to load the dynamic library in the application process and start the application in the dynamic library through a preset transfer interface;

[0073] The creation module is further used to create a transmission control protocol client and a transmission control protocol thread in the dynamic library, the transmission control protocol client is used to connect to the transmission control protocol server in the independent process, and the transmission control protocol thread includes a transmission control protocol sending thread and a transmission control protocol receiving thread;

[0074] The transmission control protocol sending thread is used to send the diagnostic instruction data packet from the dynamic library to the independent process, and the transmission control protocol receiving thread is used to receive the target diagnostic data sent by the second target thread in the independent process.

[0075] As an optional implementation, in the second aspect of the present invention, the vehicle diagnostic mode includes a local diagnostic mode or a remote diagnostic mode;

[0076] The manner in which the acquisition module establishes a communication connection channel between the first sub-main control platform and the second sub-main control platform according to the vehicle diagnostic mode specifically includes:

[0077] When the vehicle diagnostic mode includes the local diagnostic mode, a first communication driver of a communication module corresponding to the local diagnostic mode is loaded, and the first sub-main control platform is controlled to connect to the second sub-main control platform according to a local area network type corresponding to the local diagnostic mode, so as to establish a communication connection channel between the first sub-main control platform and the second sub-main control platform, wherein the local area network type includes a Bluetooth type or a wireless broadband type;

[0078] When the vehicle diagnostic mode includes the remote diagnostic mode, the second communication driver of the communication module corresponding to the remote diagnostic mode is loaded, and when the communication module corresponding to the remote diagnostic mode is successfully connected to the network, the first sub-master control platform and the second sub-master control platform are controlled to respectively connect to the preset transit server as the transparent forwarding of data to establish a communication connection channel between the first sub-master control platform and the second sub-master control platform.

[0079] A third aspect of the present invention discloses another vehicle diagnostic device compatible with local diagnosis and remote diagnosis, the device comprising:

[0080] A memory storing executable program code;

[0081] a processor coupled to the memory;

[0082] The processor calls the executable program code stored in the memory to execute the vehicle diagnosis method compatible with local diagnosis and remote diagnosis disclosed in the first aspect of the present invention.

[0083] The fourth aspect of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the vehicle diagnosis method compatible with local diagnosis and remote diagnosis disclosed in the first aspect of the present invention.

[0084] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0085] In the embodiment of the present invention, the vehicle diagnostic mode selected by the user for the vehicle is obtained, and a communication connection channel between the first sub-main control platform and the second sub-main control platform is established according to the vehicle diagnostic mode, a diagnostic instruction data packet is obtained through the communication module corresponding to the vehicle diagnostic mode, and the diagnostic instruction data packet is sent to the target device through the main control platform, the target diagnostic data returned by the target device is collected through the main control platform and the communication connection channel, and the diagnostic result for the vehicle is determined according to the target diagnostic data. It can be seen that the implementation of the present invention can be compatible with and integrate remote or local diagnosis for vehicles in a set of solutions or equipment, improve the flexibility and compatibility of vehicle diagnosis, improve the simplicity and convenience of vehicle diagnosis, and improve the efficiency of vehicle diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS

[0086] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0087] Figure 1 It is a flow chart of a vehicle diagnosis method compatible with local diagnosis and remote diagnosis disclosed in an embodiment of the present invention;

[0088] Figure 2 It is a flow chart of another vehicle diagnosis method compatible with local diagnosis and remote diagnosis disclosed in an embodiment of the present invention;

[0089] Figure 3 is a structural schematic diagram of a vehicle diagnostic device disclosed in an embodiment of the present invention;

[0090] Figure 4 It is a structural schematic diagram of a vehicle diagnostic device compatible with local diagnosis and remote diagnosis disclosed in an embodiment of the present invention;

[0091] Figure 5 It is a structural schematic diagram of another vehicle diagnostic device compatible with local diagnosis and remote diagnosis disclosed in an embodiment of the present invention;

[0092] Figure 6 It is a structural schematic diagram of another vehicle diagnostic device compatible with local diagnosis and remote diagnosis disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0093] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0094] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.

[0095] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0096] The present invention discloses a vehicle diagnosis method and device that is compatible with local diagnosis and remote diagnosis, which can integrate remote or local diagnosis for a vehicle in a set of solutions or equipment, improve the flexibility and compatibility of vehicle diagnosis, improve the simplicity and convenience of vehicle diagnosis, and improve the efficiency of vehicle diagnosis. The following are detailed descriptions.

[0097] Embodiment 1

[0098] See also Figure 1 , Figure 1 1 is a flow chart of a vehicle diagnosis method compatible with local diagnosis and remote diagnosis disclosed in an embodiment of the present invention. Figure 1 The vehicle diagnostic method compatible with local diagnosis and remote diagnosis described above can be applied to a vehicle diagnostic device, which may include a main control platform and a vehicle diagnostic device compatible with local diagnosis and remote diagnosis, wherein the main control platform includes a first sub-main control platform and a second sub-main control platform, and the vehicle diagnostic device compatible with local diagnosis and remote diagnosis may include an intelligent server or intelligent platform for performing diagnostic analysis on the vehicle, and the intelligent server includes a local server or a cloud server, which is not limited in the embodiments of the present invention. Figure 1 As shown, the vehicle diagnosis method compatible with local diagnosis and remote diagnosis may include the following operations:

[0099] 101. Obtain a vehicle diagnostic mode for a vehicle selected by a user, and establish a communication connection channel between a first sub-main control platform and a second sub-main control platform according to the vehicle diagnostic mode.

[0100] In an embodiment of the present invention, optionally, a vehicle diagnostic mode for a vehicle may include a local diagnostic mode or a remote diagnostic mode, i.e., DOIP Internet remote diagnosis or DOIP local wireless diagnosis, where DOIP (Diagnostics over Internet Protocol) represents a diagnostic communication protocol based on an IP network, wherein when the vehicle diagnostic mode includes a local diagnostic mode, the communication connection channel between the first sub-master control platform and the second sub-master control platform may include a Bluetooth communication connection channel or a WIFI communication connection channel, and when the vehicle diagnostic mode includes a remote diagnostic mode, the communication connection channel between the first sub-master control platform and the second sub-master control platform may include a wireless network communication connection channel, such as a 5G communication connection channel, which is not limited by the present invention.

[0101] 102. Obtain a diagnostic instruction data packet through a communication module corresponding to the vehicle diagnostic mode, and send the diagnostic instruction data packet to a target device through a main control platform.

[0102] In an embodiment of the present invention, optionally, the communication module corresponding to the local diagnostic mode includes a Bluetooth module or a WIFI module, the communication module corresponding to the remote diagnostic mode includes a 5G module, the target device may include a third-party diagnostic platform and a vehicle, the third-party diagnostic platform may include diagnostic software and / or diagnostic equipment, and sending a diagnostic instruction data packet to the target device through the main control platform may include sending the diagnostic instruction data packet to the third-party diagnostic platform through the first sub-main control platform, and sending the diagnostic instruction data packet to the vehicle through the second sub-main control platform, which is not limited by the present invention.

[0103] 103. Collect target diagnostic data returned by the target device through the main control platform and the communication connection channel, and determine the diagnostic result for the vehicle according to the target diagnostic data.

[0104] In an embodiment of the present invention, optionally, the target diagnostic data returned by the target device can be collected by the main control platform. Specifically, the target diagnostic data returned by the third-party diagnostic platform can be collected by the first sub-main control platform, and the target diagnostic data returned by the vehicle can be collected by the second sub-main control platform. Then, data exchange between the first sub-main control platform and the second sub-main control platform can be achieved through the communication connection channel, and the diagnostic result for the vehicle can be determined based on the target diagnostic data.

[0105] It can be seen that implementation Figure 1The described vehicle diagnosis method compatible with local diagnosis and remote diagnosis can obtain the vehicle diagnosis mode selected by the user for the vehicle, and establish a communication connection channel between the first sub-main control platform and the second sub-main control platform according to the vehicle diagnosis mode, obtain the diagnosis instruction data packet through the communication module corresponding to the vehicle diagnosis mode, and send the diagnosis instruction data packet to the target device through the main control platform, collect the target diagnosis data returned by the target device through the main control platform and the communication connection channel, and determine the diagnosis result for the vehicle according to the target diagnosis data. It can integrate remote or local diagnosis for the vehicle in a set of solutions or equipment, improve the flexibility and compatibility of vehicle diagnosis, improve the simplicity and convenience of vehicle diagnosis, and improve the efficiency of vehicle diagnosis.

[0106] In an optional embodiment, the vehicle diagnostic mode includes a local diagnostic mode or a remote diagnostic mode;

[0107] Establishing a communication connection channel between the first sub-main control platform and the second sub-main control platform according to the vehicle diagnosis mode may include the following operations:

[0108] When the vehicle diagnostic mode includes a local diagnostic mode, a first communication driver of a communication module corresponding to the local diagnostic mode is loaded, and the first sub-main control platform is controlled to connect to the second sub-main control platform according to a local area network type corresponding to the local diagnostic mode, so as to establish a communication connection channel between the first sub-main control platform and the second sub-main control platform, wherein the local area network type includes a Bluetooth type or a wireless broadband type;

[0109] When the vehicle diagnostic mode includes a remote diagnostic mode, a second communication driver of a communication module corresponding to the remote diagnostic mode is loaded, and when the communication module corresponding to the remote diagnostic mode is successfully connected to the network, the first sub-master control platform and the second sub-master control platform are controlled to respectively connect to a preset transit server as a transparent forwarding of data to establish a communication connection channel between the first sub-master control platform and the second sub-master control platform.

[0110] In an embodiment of the present invention, optionally, when the vehicle diagnostic mode includes a local diagnostic mode, the local area network type corresponding to the local diagnostic mode may include a Bluetooth type or a wireless broadband type, and the communication module corresponding to the local diagnostic mode may include a Bluetooth communication module or a wireless broadband communication module (i.e., a WIFI communication module), wherein the first communication driver corresponding to the Bluetooth communication module includes a Bluetooth driver, and the first communication driver corresponding to the wireless broadband communication module includes a WIFI driver. When the local area network type corresponding to the local diagnostic mode includes a Bluetooth type, after the Bluetooth driver is loaded, the Bluetooth module of the second sub-master control platform may be set to broadcast the Bluetooth name, wait for the addition of the first sub-master control platform, and set the first sub-master control platform to automatically connect to the second sub-master The Bluetooth of the control platform, the Bluetooth connection between the first sub-main control platform and the second sub-main control platform is successful, which means that the communication connection channel between the first sub-main control platform and the second sub-main control platform is established; when the LAN type corresponding to the local diagnostic mode includes a wireless broadband type, after the WIFI driver is loaded, the WIFI module of the second sub-main control platform can be set to AP hotspot mode, and the WIFI module of the first sub-main control platform can be set to STA mode, and the WIFI hotspot of the second sub-main control platform can be actively connected, and the password is a user preset or system fixed password. The WIFI connection between the first sub-main control platform and the second sub-main control platform is successful, which means that the communication connection channel between the first sub-main control platform and the second sub-main control platform is established.

[0111] In an embodiment of the present invention, optionally, when the vehicle diagnostic mode includes a remote diagnostic mode, the communication module corresponding to the remote diagnostic mode may include a 5G communication module, and the second communication driver may include a 5G driver. When the 5G communication module is successfully connected to the network, the first sub-master control platform and the second sub-master control platform are controlled to respectively connect to a preset transit server as a transparent forwarding of data to establish a communication connection channel between the first sub-master control platform and the second sub-master control platform.

[0112] It can be seen that the implementation of this optional embodiment can load the first communication driver of the communication module corresponding to the local diagnostic mode when the vehicle diagnostic mode includes the local diagnostic mode, and control the first sub-master control platform to connect to the second sub-master control platform according to the LAN type corresponding to the local diagnostic mode to establish a communication connection channel between the first sub-master control platform and the second sub-master control platform. When the vehicle diagnostic mode includes the remote diagnostic mode, load the second communication driver of the communication module corresponding to the remote diagnostic mode. When the communication module corresponding to the remote diagnostic mode is successfully connected to the network, control the first sub-master control platform and the second sub-master control platform to respectively connect to the preset transfer server as data transparent forwarding to establish a communication connection channel between the first sub-master control platform and the second sub-master control platform. It can realize the Bluetooth or WIFI connection between the first sub-master control platform and the second sub-master control platform in the local diagnostic mode, and realize the connection of the first sub-master control platform and the second sub-master control platform to the transfer server in the remote diagnosis. It can be compatible with and integrate remote or local diagnosis for vehicles in a set of solutions or equipment, improve the flexibility and compatibility of vehicle diagnosis, improve the simplicity and convenience of vehicle diagnosis, and improve the efficiency of vehicle diagnosis.

[0113] Embodiment 2

[0114] See also Figure 2 , Figure 2 1 is a flow chart of a vehicle diagnosis method compatible with local diagnosis and remote diagnosis disclosed in an embodiment of the present invention. Figure 2 The vehicle diagnostic method compatible with local diagnosis and remote diagnosis described above can be applied to a vehicle diagnostic device, which may include a main control platform and a vehicle diagnostic device compatible with local diagnosis and remote diagnosis, wherein the main control platform includes a first sub-main control platform and a second sub-main control platform, and the vehicle diagnostic device compatible with local diagnosis and remote diagnosis may include an intelligent server or intelligent platform for performing diagnostic analysis on the vehicle, and the intelligent server includes a local server or a cloud server, which is not limited in the embodiments of the present invention. Figure 2 As shown, the vehicle diagnosis method compatible with local diagnosis and remote diagnosis may include the following operations:

[0115] 201. Obtain a vehicle diagnostic mode for a vehicle selected by a user, and establish a communication connection channel between a first sub-main control platform and a second sub-main control platform according to the vehicle diagnostic mode.

[0116] In the embodiment of the present invention, for other descriptions of step 201, please refer to the detailed description of step 101 in the first embodiment, and the embodiment of the present invention will not be repeated.

[0117] 202. Obtain a diagnostic instruction data packet through a communication module corresponding to the vehicle diagnostic mode, and transmit the diagnostic instruction data packet to a dynamic library preset in the application process through a transmission interface preset in the application process.

[0118] In the embodiment of the present invention, optionally, Figure 3 As shown, Figure 3 is a schematic diagram of the structure of a vehicle diagnostic device disclosed in an embodiment of the present invention, wherein the vehicle diagnostic device may include a main control platform, and the main control platform may include a first sub-main control platform and a second sub-main control platform, such as Figure 3 As shown, the communication module corresponding to the local diagnostic mode includes a Bluetooth module or a WIFI module, the communication module corresponding to the remote diagnostic mode includes a 5G module, the target device may include a third-party diagnostic platform and a vehicle, the third-party diagnostic platform may include diagnostic software and / or diagnostic equipment, the main control platform may include an application process (i.e., an APP process) and an independent process, specifically, the first sub-main control platform and the second sub-main control platform may include an application process and an independent process, respectively, and the preset transfer interface in the application process may include a JNI communication interface, wherein the JNI communication interface represents a Java Native Interface, which is a standard that provides a large number of APIs, enabling Java to communicate with other languages ​​​​(mainly C and C++).

[0119] In the embodiment of the present invention, optionally, Figure 3 As shown, the dynamic library preset in the application process may include a C++ dynamic library so, wherein the C++ dynamic library so and the APP interface in the application process may exchange data through a JNI communication interface.

[0120] 203. Send the diagnostic instruction data packet from the dynamic library to the independent process through the transmission control protocol thread in the dynamic library, and send the diagnostic instruction data packet to the Ethernet card through the first target thread in the independent process.

[0121] In the embodiment of the present invention, optionally, the transmission control protocol thread is a TCP thread, wherein the transmission control protocol thread may include a transmission control protocol sending thread and a transmission control protocol receiving thread, and the diagnostic instruction data packet may be sent from the dynamic library to the independent process through the transmission control protocol sending thread, and the first target thread in the independent process may include a first receiving thread and a first sending thread, and the diagnostic instruction data packet may be sent to the Ethernet card through the first sending thread, wherein, Figure 2 As shown, the Ethernet card may include an eth0 network card and the present invention does not limit this.

[0122] 204. Send the diagnostic instruction data packet to the third-party diagnostic platform through the Ethernet card corresponding to the first sub-main control platform, and send the diagnostic instruction data packet to the vehicle through the Ethernet card corresponding to the second sub-main control platform.

[0123] 205. Collect target diagnostic data returned by the target device through the Ethernet card, and send the target diagnostic data to an independent process.

[0124] In the embodiment of the present invention, optionally, the target diagnostic data may include diagnostic communication data corresponding to the third-party diagnostic platform and vehicle data corresponding to the vehicle.

[0125] 206. Send the target diagnostic data to the dynamic library in the application process through the second target thread in the independent process.

[0126] In the embodiment of the present invention, optionally, the second target thread may include a second receiving thread and a second sending thread, and the target diagnostic data may be sent to a dynamic library in the application process through the second sending thread.

[0127] 207. The target diagnostic data is transmitted to a communication module corresponding to the vehicle diagnostic mode through a transmission interface in the application process, and a diagnostic result for the vehicle is determined according to the target diagnostic data.

[0128] It can be seen that implementation Figure 2The described vehicle diagnosis method compatible with local diagnosis and remote diagnosis can obtain a vehicle diagnosis mode selected by a user for a vehicle, and establish a communication connection channel between a first sub-master control platform and a second sub-master control platform according to the vehicle diagnosis mode, obtain a diagnosis instruction data packet through a communication module corresponding to the vehicle diagnosis mode, transfer the diagnosis instruction data packet to a dynamic library preset in the application process through a transfer interface preset in the application process, send the diagnosis instruction data packet from the dynamic library to an independent process through a transmission control protocol thread in the dynamic library, send the diagnosis instruction data packet to an Ethernet card through a first target thread in the independent process, send the diagnosis instruction data packet to a third-party diagnosis platform through the Ethernet card corresponding to the first sub-master control platform, and send the diagnosis instruction data packet to a third-party diagnosis platform through the Ethernet card corresponding to the second sub-master control platform. Sending to the vehicle can send data packets to a third-party diagnostic platform and the vehicle through the first sub-main control platform and the second sub-main control platform, thereby improving data distribution efficiency, collecting target diagnostic data returned by the target device through the Ethernet card, and sending the target diagnostic data to an independent process, sending the target diagnostic data to a dynamic library in the application process through the second target thread in the independent process, and transferring the target diagnostic data to a communication module corresponding to the vehicle diagnostic mode through the transfer interface in the application process, and determining the diagnostic result for the vehicle based on the target diagnostic data, thereby improving the recovery efficiency of diagnostic data, being able to integrate remote or local diagnosis for the vehicle in a set of solutions or equipment, improving the flexibility and compatibility of vehicle diagnosis, improving the simplicity and convenience of vehicle diagnosis, and improving the diagnostic efficiency of the vehicle.

[0129] In an optional embodiment, the first target thread includes a first receiving thread and a first sending thread, and the second target thread includes a second receiving thread and a second sending thread;

[0130] Sending the diagnostic instruction data packet to the Ethernet card through the first target thread in the independent process may include the following operations:

[0131] In the first receiving thread, the first target function is blocked and called to receive the diagnostic instruction data packet from the dynamic library, and the first target data frame in the diagnostic instruction data packet is extracted;

[0132] Sending a first target data frame to a first sending thread, and sending the first target data frame to an Ethernet card through the first sending thread;

[0133] And, sending the target diagnostic data to the dynamic library in the application process through the second target thread in the independent process may include the following operations:

[0134] In the second receiving thread, the second target function is blocked and called to receive the target diagnostic data from the Ethernet card, and determine whether the target diagnostic data meets the preset target condition;

[0135] When the target diagnostic data meets the target condition, the target diagnostic data is sent to the second sending thread, and the target diagnostic data is sent to the dynamic library in the application process through the second sending thread.

[0136] In an embodiment of the present invention, optionally, the first target thread may include a first receiving thread and a first sending thread, wherein the first receiving thread may include a TCP receiving thread, and the first sending thread may include an original socket sending thread, and the second target thread may include a second receiving thread and a second sending thread, wherein the second receiving thread may include an original socket receiving thread, and the second sending thread may include a TCP sending thread, which is not limited in this embodiment.

[0137] In an embodiment of the present invention, optionally, the first target function may include a system function recv, and blocking calling the first target function in the first receiving thread to receive a diagnostic instruction data packet from a dynamic library may include blocking calling the system function recv in the TCP receiving thread to receive a TCP data frame of a diagnostic instruction data packet from a dynamic library. The first target data frame in the diagnostic instruction data packet may include a MAC data frame, that is, after receiving the complete TCP data frame, extracting the MAC data frame, sending the first target data frame to the first sending thread, and sending a signal to wake up the first sending thread. The original socket sending thread can be used to send a data link layer MAC frame to the Ethernet card eth0. In the original socket sending thread, it is cyclically determined whether the queue is empty. If the queue is empty, the thread is suspended to sleep. Otherwise, the data in the queue is read and the MAC frame is sent to the Ethernet card, that is, the first target data frame is sent to the Ethernet card through the first sending thread. This is not limited in this embodiment.

[0138] In an embodiment of the present invention, optionally, the second receiving thread may include an original socket receiving thread, which is used to receive a data link layer MAC frame of the Ethernet card. The second target function may include a system function recvfrom, which blocks the call to the system function recvfrom in the original socket receiving thread to receive target diagnostic data from the Ethernet card, and determines whether the target diagnostic data meets a preset target condition. When the target diagnostic data meets the target condition, the target diagnostic data is sent to the second sending thread. The second sending thread may include a TCP sending thread, which is used to send data to a C++ dynamic library in the APP process. In the TCP sending thread, it is cyclically determined whether the queue is empty. If the queue is empty, the thread is suspended to sleep. Otherwise, the target diagnostic data in the queue is read and the target diagnostic data is sent to the dynamic library in the application process.

[0139] It can be seen that the implementation of this optional embodiment can block the call of the first target function in the first receiving thread to accept the diagnostic instruction data packet from the dynamic library, and extract the first target data frame in the diagnostic instruction data packet, send the first target data frame to the first sending thread, and send the first target data frame to the Ethernet card through the first sending thread, and block the call of the second target function in the second receiving thread to accept the target diagnostic data from the Ethernet card, and determine whether the target diagnostic data meets the preset target condition. When the target diagnostic data meets the target condition, the target diagnostic data is sent to the second sending thread, and the target diagnostic data is sent to the dynamic library in the application process through the second sending thread. Data can be sent and received through TCP threads and socket threads, thereby improving the data transmission efficiency and security in the vehicle diagnosis process, thereby improving the flexibility and efficiency of vehicle detection.

[0140] In another optional embodiment, determining whether the target diagnostic data meets the preset target condition may include the following operations:

[0141] Determine whether the source address and the destination address of the Ethernet frame of the target diagnostic data are equal to the media access control address of the Ethernet card, and when the source address or the destination address is not equal to the media access control address, obtain the target field value of the second target data frame corresponding to the target diagnostic data, the target field value including the type field value or the length field value;

[0142] Determine whether a target field value of the second target data frame satisfies a preset data frame format, and when the target field value does not satisfy the data frame format, determine whether the target field value is greater than a preset field length;

[0143] When the target field value is greater than the field length, it is determined that the target diagnostic data meets the preset target condition.

[0144] In an embodiment of the present invention, optionally, the source address of the Ethernet frame of the target diagnostic data includes the source MAC address, the destination address includes the destination MAC address, and the media access control address of the Ethernet card includes the MAC address of the Ethernet card. When the source MAC address or the destination MAC address of the Ethernet frame of the target diagnostic data is not equal to the MAC address of the Ethernet card, the target field value of the second target data frame corresponding to the target diagnostic data is obtained. The second target data frame corresponding to the target diagnostic data may include a data link layer MAC frame of the Ethernet card. The target field value may include a type field value or a length field value, which is not limited in this embodiment.

[0145] In an embodiment of the present invention, optionally, it is determined whether the target field value of the second target data frame satisfies a preset data frame format, that is, it is determined whether the type field value or the length field value of the data link layer MAC frame of the Ethernet card is greater than a first preset value and equal to a second preset value, wherein the first preset value is 0x0600 and the second preset value is 0x86dd. When the target field value of the second target data frame satisfies the preset data frame format, it indicates that the MAC frame is in the frame format of IPV6, and the MAC frame is discarded. When the target field value does not satisfy the data frame format, it is determined whether the target field value is greater than a preset field length, and the preset field length is 0x05DC. When the target field value is less than or equal to the preset field length, it indicates that the MAC frame is in the IEEE802.3 format, and the MAC frame is discarded. When the target field value is greater than the field length, it is determined that the target diagnostic data meets the preset target condition, and the MAC frame is entered into the second sending thread, and a signal is sent to wake up the second sending thread. This embodiment does not limit this.

[0146] It can be seen that the implementation of this optional embodiment is capable of determining whether the source address and destination address of the Ethernet frame of the target diagnostic data are equal to the media access control address of the Ethernet card. When the source address or the destination address is not equal to the media access control address, the target field value of the second target data frame corresponding to the target diagnostic data is obtained, and it is determined whether the target field value of the second target data frame satisfies the preset data frame format. When the target field value does not satisfy the data frame format, it is determined whether the target field value is greater than the preset field length. When the target field value is greater than the field length, it is determined that the target diagnostic data satisfies the preset target conditions. When receiving the data returned by the Ethernet card, it is possible to filter out the data that does not meet the requirements, thereby improving the efficiency of subsequent vehicle diagnosis.

[0147] In yet another optional embodiment, before sending the diagnostic instruction data packet from the dynamic library to the independent process through the transmission control protocol thread in the dynamic library, the vehicle diagnostic method compatible with local diagnosis and remote diagnosis may further include the following operations:

[0148] Start an independent process with root privileges and shut down the client and server of the Dynamic Host Configuration Protocol;

[0149] The Ethernet card is started through a preset pin, and when it is detected that the Ethernet card has been started, the Ethernet card is set to a target mode, wherein the target mode includes a promiscuous mode;

[0150] A transmission control protocol server is created in an independent process, and listens on the local loopback address and port. When a transmission control protocol client in a dynamic library is listened to and applies for connection, the transmission control protocol server is connected to the transmission control protocol client.

[0151] In an embodiment of the present invention, optionally, an independent process is started with root privileges, that is, an independent process is started with root privileges, and the client and server of the Dynamic Host Configuration Protocol are closed. The Dynamic Host Configuration Protocol (DHCP) represents a computer network protocol for automatically allocating IP addresses, subnet masks, gateways, DNS and other network parameters to client devices in a local area network, thereby simplifying the management of IP addresses by network administrators. Starting the Ethernet card through a preset pin may include controlling the power switch of the Ethernet card through a preset pin, powering the Ethernet card, cyclically querying and waiting for the Ethernet card to start up. When it is detected that the Ethernet card has started up, creating an original socket corresponding to the independent process, binding the Ethernet card, and setting the Ethernet card to a target mode. The target mode may include a promiscuous mode, which is not limited in this embodiment.

[0152] In an embodiment of the present invention, optionally, a transmission control protocol server, i.e., a TCP server, is created in an independent process, and listens on a local loopback address and port, where the local loopback address is 127.0.0.1 and the port is 22499. When a transmission control protocol client in a dynamic library is monitored to apply for a connection, the transmission control protocol server is connected to the transmission control protocol client.

[0153] It can be seen that the implementation of this optional embodiment can start an independent process with root authority, and close the client and server of the Dynamic Host Configuration Protocol, start the Ethernet card through the preset pin, and when it is detected that the Ethernet card has been started, set the Ethernet card to target mode, create a Transmission Control Protocol server in the independent process, and listen on the local loopback address and port. When the Transmission Control Protocol client in the dynamic library is monitored to apply for a connection, the Transmission Control Protocol server is connected to the Transmission Control Protocol client. The independent process can be started in advance and used for data transmission, thereby improving the efficiency of data transmission and thus improving the efficiency of vehicle diagnosis.

[0154] In yet another optional embodiment, the vehicle diagnosis method compatible with local diagnosis and remote diagnosis may further include the following operations:

[0155] Load the dynamic library in the application process and start the application in the dynamic library through a preset transfer interface;

[0156] Creating a transmission control protocol client and a transmission control protocol thread in a dynamic library, the transmission control protocol client is used to connect with the transmission control protocol server in an independent process, and the transmission control protocol thread includes a transmission control protocol sending thread and a transmission control protocol receiving thread;

[0157] The transmission control protocol sending thread is used to send the diagnostic instruction data packet from the dynamic library to the independent process, and the transmission control protocol receiving thread is used to receive the target diagnostic data sent by the second target thread in the independent process.

[0158] In the embodiment of the present invention, optionally, Figure 3 As shown, when the APP process is started, the C++ dynamic library so is recorded, and the application in the dynamic library is started through the JNI communication interface. A transmission control protocol client and a transmission control protocol thread are created in the dynamic library. The transmission control protocol client is a TCP client. The transmission control protocol client is used to connect to the transmission control protocol server in the independent process. The transmission control protocol thread includes a transmission control protocol sending thread and a transmission control protocol receiving thread, that is, the transmission control protocol thread includes a TCP sending thread and a TCP receiving thread, wherein the transmission control protocol sending thread is used to send the diagnostic instruction data packet from the dynamic library to the independent process. Specifically, in the transmission control protocol sending thread, a loop is used to determine whether the queue is empty. If the queue is empty, the thread is suspended to sleep. Otherwise, the data packet in the queue is read and sent to the TCP receiving thread in the independent process. The transmission control protocol receiving thread is used to receive the target diagnostic data sent by the second target thread in the independent process. Specifically, in the transmission control protocol receiving thread, a blocking call is made to the system function recv to receive the target diagnostic data sent by the second target thread in the independent process. After receiving the complete data packet, it is sent to the APP interface through the JNI communication interface.

[0159] It can be seen that the implementation of this optional embodiment can load the dynamic library in the application process, and start the application in the dynamic library through a preset transfer interface, create a transmission control protocol client and a transmission control protocol thread in the dynamic library, and can process and transfer data in the dynamic library, thereby improving data transmission and processing efficiency, thereby improving the efficiency of vehicle diagnosis.

[0160] Embodiment 3

[0161] See also Figure 4 , Figure 4 : is a schematic diagram of a vehicle diagnostic device compatible with local diagnosis and remote diagnosis disclosed in an embodiment of the present invention. Figure 4The vehicle diagnostic device compatible with local diagnosis and remote diagnosis described above can be applied to vehicle diagnostic equipment. The vehicle diagnostic device compatible with local diagnosis and remote diagnosis can include an intelligent server or intelligent platform for performing diagnostic analysis on the vehicle. The intelligent server includes a local server or a cloud server, which is not limited in the embodiment of the present invention. Figure 4 As shown, the vehicle diagnostic device compatible with local diagnosis and remote diagnosis may include:

[0162] The acquisition module 301 is used to acquire the vehicle diagnostic mode selected by the user for the vehicle, and establish a communication connection channel between the first sub-main control platform and the second sub-main control platform according to the vehicle diagnostic mode;

[0163] The sending module 302 is used to obtain a diagnostic instruction data packet through a communication module corresponding to the vehicle diagnostic mode, and send the diagnostic instruction data packet to a target device through a main control platform;

[0164] The collection module 303 is used to collect the target diagnostic data returned by the target device through the main control platform and the communication connection channel, and determine the diagnostic result for the vehicle according to the target diagnostic data.

[0165] It can be seen that the implementation Figure 4 The described vehicle diagnostic device compatible with local diagnosis and remote diagnosis can obtain the vehicle diagnostic mode selected by the user for the vehicle, and establish a communication connection channel between the first sub-main control platform and the second sub-main control platform according to the vehicle diagnostic mode, obtain the diagnostic instruction data packet through the communication module corresponding to the vehicle diagnostic mode, and send the diagnostic instruction data packet to the target device through the main control platform, collect the target diagnostic data returned by the target device through the main control platform and the communication connection channel, and determine the diagnostic result for the vehicle according to the target diagnostic data. It can be compatible with integrating remote or local diagnosis for the vehicle in a set of solutions or equipment, thereby improving the flexibility and compatibility of vehicle diagnosis, improving the simplicity and convenience of vehicle diagnosis, and improving the diagnostic efficiency of the vehicle.

[0166] In an optional embodiment, if Figure 5 As shown, the main control platform includes application processes and independent processes, and the target devices include third-party diagnostic platforms and vehicles;

[0167] The specific manner in which the sending module 302 sends the diagnostic instruction data packet to the target device through the main control platform includes:

[0168] The diagnostic instruction data packet is transmitted to the dynamic library preset in the application process through the transmission interface preset in the application process;

[0169] Sending the diagnostic instruction data packet from the dynamic library to the independent process through the transmission control protocol thread in the dynamic library, and sending the diagnostic instruction data packet to the Ethernet card through the first target thread in the independent process;

[0170] Sending the diagnostic instruction data packet to the third-party diagnostic platform through the Ethernet card corresponding to the first sub-main control platform, and sending the diagnostic instruction data packet to the vehicle through the Ethernet card corresponding to the second sub-main control platform;

[0171] And, the specific manner in which the collection module 303 collects the target diagnostic data returned by the target device through the main control platform and the communication connection channel includes:

[0172] Collect target diagnostic data returned by the target device through an Ethernet card, and send the target diagnostic data to an independent process, wherein the target diagnostic data includes diagnostic communication data corresponding to a third-party diagnostic platform and vehicle data corresponding to the vehicle;

[0173] Sending target diagnostic data to a dynamic library in the application process through a second target thread in the independent process;

[0174] The target diagnostic data is delivered to the communication module corresponding to the vehicle diagnostic mode through the delivery interface in the application process.

[0175] It can be seen that implementation Figure 5The described vehicle diagnostic device compatible with local diagnosis and remote diagnosis can obtain a vehicle diagnostic mode selected by a user for a vehicle, and establish a communication connection channel between a first sub-master control platform and a second sub-master control platform according to the vehicle diagnostic mode, obtain a diagnostic instruction data packet through a communication module corresponding to the vehicle diagnostic mode, transfer the diagnostic instruction data packet to a dynamic library preset in the application process through a transfer interface preset in the application process, send the diagnostic instruction data packet from the dynamic library to an independent process through a transmission control protocol thread in the dynamic library, send the diagnostic instruction data packet to an Ethernet card through a first target thread in the independent process, send the diagnostic instruction data packet to a third-party diagnostic platform through the Ethernet card corresponding to the first sub-master control platform, and send the diagnostic instruction data packet to a third-party diagnostic platform through the Ethernet card corresponding to the second sub-master control platform Sending to the vehicle can send data packets to a third-party diagnostic platform and the vehicle through the first sub-main control platform and the second sub-main control platform, thereby improving data distribution efficiency, collecting target diagnostic data returned by the target device through the Ethernet card, and sending the target diagnostic data to an independent process, sending the target diagnostic data to a dynamic library in the application process through the second target thread in the independent process, and transferring the target diagnostic data to a communication module corresponding to the vehicle diagnostic mode through the transfer interface in the application process, and determining the diagnostic result for the vehicle based on the target diagnostic data, thereby improving the recovery efficiency of diagnostic data, being able to integrate remote or local diagnosis for the vehicle in a set of solutions or equipment, improving the flexibility and compatibility of vehicle diagnosis, improving the simplicity and convenience of vehicle diagnosis, and improving the diagnostic efficiency of the vehicle.

[0176] In another optional embodiment, Figure 5 As shown, the first target thread includes a first receiving thread and a first sending thread, and the second target thread includes a second receiving thread and a second sending thread;

[0177] The specific manner in which the sending module 302 sends the diagnostic instruction data packet to the Ethernet card through the first target thread in the independent process includes:

[0178] In the first receiving thread, the first target function is blocked and called to receive the diagnostic instruction data packet from the dynamic library, and the first target data frame in the diagnostic instruction data packet is extracted;

[0179] Sending a first target data frame to a first sending thread, and sending the first target data frame to an Ethernet card through the first sending thread;

[0180] And, the specific manner in which the collection module 303 sends the target diagnostic data to the dynamic library in the application process through the second target thread in the independent process includes:

[0181] In the second receiving thread, the second target function is blocked and called to receive the target diagnostic data from the Ethernet card, and determine whether the target diagnostic data meets the preset target condition;

[0182] When the target diagnostic data meets the target condition, the target diagnostic data is sent to the second sending thread, and the target diagnostic data is sent to the dynamic library in the application process through the second sending thread.

[0183] It can be seen that implementation Figure 5 The described vehicle diagnostic device, which is compatible with local diagnosis and remote diagnosis, can block calling the first target function in the first receiving thread to accept a diagnostic instruction data packet from a dynamic library, extract the first target data frame in the diagnostic instruction data packet, send the first target data frame to the first sending thread, and send the first target data frame to the Ethernet card through the first sending thread. In the second receiving thread, the second target function is blocked and called to accept target diagnostic data from the Ethernet card, and it is determined whether the target diagnostic data meets the preset target condition. When the target diagnostic data meets the target condition, the target diagnostic data is sent to the second sending thread, and the target diagnostic data is sent to the dynamic library in the application process through the second sending thread. Data can be sent and received through TCP threads and socket threads, thereby improving the data transmission efficiency and security in the vehicle diagnosis process, thereby improving the flexibility and efficiency of vehicle detection.

[0184] In yet another optional embodiment, Figure 5 As shown, the specific manner in which the collection module 303 determines whether the target diagnostic data meets the preset target condition includes:

[0185] Determine whether the source address and the destination address of the Ethernet frame of the target diagnostic data are equal to the media access control address of the Ethernet card, and when the source address or the destination address is not equal to the media access control address, obtain the target field value of the second target data frame corresponding to the target diagnostic data, the target field value includes the type field value or the length field value;

[0186] Determine whether a target field value of the second target data frame satisfies a preset data frame format, and when the target field value does not satisfy the data frame format, determine whether the target field value is greater than a preset field length;

[0187] When the target field value is greater than the field length, it is determined that the target diagnostic data meets the preset target condition.

[0188] It can be seen that implementation Figure 5The described vehicle diagnostic device compatible with local diagnosis and remote diagnosis can determine whether the source address and destination address of the Ethernet frame of the target diagnostic data are equal to the media access control address of the Ethernet card. When the source address or the destination address is not equal to the media access control address, the target field value of the second target data frame corresponding to the target diagnostic data is obtained, and it is determined whether the target field value of the second target data frame satisfies the preset data frame format. When the target field value does not satisfy the data frame format, it is determined whether the target field value is greater than the preset field length. When the target field value is greater than the field length, it is determined that the target diagnostic data satisfies the preset target conditions. When receiving the data returned by the Ethernet card, it is possible to filter out the data that does not meet the requirements, thereby improving the efficiency of subsequent vehicle diagnosis.

[0189] In yet another optional embodiment, Figure 5 As shown, the vehicle diagnostic device compatible with local diagnosis and remote diagnosis may also include:

[0190] The startup module 304 is used to start the independent process with root privileges and close the client and server of the dynamic host configuration protocol before the sending module sends the diagnostic instruction data packet from the dynamic library to the independent process through the transmission control protocol thread in the dynamic library;

[0191] The startup module 304 is further used to start the Ethernet card through a preset pin, and when it is detected that the Ethernet card has been started, the Ethernet card is set to a target mode, where the target mode includes a promiscuous mode;

[0192] The creation module 305 is used to create a transmission control protocol server in an independent process and monitor the local loopback address and port. When the transmission control protocol client in the dynamic library is monitored to apply for connection, the transmission control protocol server is connected to the transmission control protocol client.

[0193] It can be seen that implementation Figure 5 The described vehicle diagnostic device, which is compatible with local diagnosis and remote diagnosis, can start an independent process with root authority, close the client and server of the dynamic host configuration protocol, start the Ethernet card through a preset pin, and when it is detected that the Ethernet card has been started, set the Ethernet card to target mode, create a transmission control protocol server in the independent process, and listen on the local loopback address and port. When the transmission control protocol client in the dynamic library is monitored to apply for a connection, the transmission control protocol server is connected to the transmission control protocol client. The independent process can be started in advance and used for data transmission, thereby improving the efficiency of data transmission and thus improving the efficiency of vehicle diagnosis.

[0194] In yet another optional embodiment, Figure 5 As shown, the vehicle diagnostic device compatible with local diagnosis and remote diagnosis may also include:

[0195] The loading module 306 is used to load the dynamic library in the application process and start the application in the dynamic library through a preset transfer interface;

[0196] The creation module 305 is also used to create a transmission control protocol client and a transmission control protocol thread in the dynamic library, the transmission control protocol client is used to connect to the transmission control protocol server in the independent process, and the transmission control protocol thread includes a transmission control protocol sending thread and a transmission control protocol receiving thread;

[0197] The transmission control protocol sending thread is used to send the diagnostic instruction data packet from the dynamic library to the independent process, and the transmission control protocol receiving thread is used to receive the target diagnostic data sent by the second target thread in the independent process.

[0198] It can be seen that implementation Figure 5 The described vehicle diagnostic device compatible with local diagnosis and remote diagnosis can load the dynamic library in the application process, and start the application in the dynamic library through a preset transfer interface, create a transmission control protocol client and a transmission control protocol thread in the dynamic library, and can process and transfer data in the dynamic library, thereby improving data transmission and processing efficiency, thereby improving the efficiency of vehicle diagnosis.

[0199] In yet another optional embodiment, Figure 5 As shown, the vehicle diagnostic mode includes a local diagnostic mode or a remote diagnostic mode;

[0200] The specific manner in which the acquisition module 301 establishes a communication connection channel between the first sub-main control platform and the second sub-main control platform according to the vehicle diagnosis mode includes:

[0201] When the vehicle diagnostic mode includes a local diagnostic mode, a first communication driver of a communication module corresponding to the local diagnostic mode is loaded, and the first sub-main control platform is controlled to connect to the second sub-main control platform according to a local area network type corresponding to the local diagnostic mode, so as to establish a communication connection channel between the first sub-main control platform and the second sub-main control platform, wherein the local area network type includes a Bluetooth type or a wireless broadband type;

[0202] When the vehicle diagnostic mode includes a remote diagnostic mode, a second communication driver of a communication module corresponding to the remote diagnostic mode is loaded, and when the communication module corresponding to the remote diagnostic mode is successfully connected to the network, the first sub-master control platform and the second sub-master control platform are controlled to respectively connect to a preset transit server as a transparent forwarding of data to establish a communication connection channel between the first sub-master control platform and the second sub-master control platform.

[0203] It can be seen that implementation Figure 5The described vehicle diagnostic device compatible with local diagnosis and remote diagnosis can, when the vehicle diagnostic mode includes a local diagnostic mode, load the first communication driver of the communication module corresponding to the local diagnostic mode, and control the first sub-master control platform to connect to the second sub-master control platform according to the LAN type corresponding to the local diagnostic mode to establish a communication connection channel between the first sub-master control platform and the second sub-master control platform; when the vehicle diagnostic mode includes a remote diagnostic mode, load the second communication driver of the communication module corresponding to the remote diagnostic mode; when the communication module corresponding to the remote diagnostic mode is successfully connected to the network, control the first sub-master control platform and the second sub-master control platform to respectively connect to a preset transfer server as data transparent forwarding to establish a communication connection channel between the first sub-master control platform and the second sub-master control platform; can realize Bluetooth or WIFI connection between the first sub-master control platform and the second sub-master control platform in the local diagnostic mode; realize the connection of the first sub-master control platform and the second sub-master control platform to the transfer server in the remote diagnosis; can be compatible with and integrate remote or local diagnosis for vehicles in a set of solutions or equipment, improve the flexibility and compatibility of vehicle diagnosis, improve the simplicity and convenience of vehicle diagnosis, and improve the efficiency of vehicle diagnosis.

[0204] Embodiment 4

[0205] See also Figure 6 , Figure 6 FIG. 1 is a schematic diagram of the structure of another vehicle diagnostic device compatible with local diagnosis and remote diagnosis disclosed in an embodiment of the present invention. Figure 6 As shown, the vehicle diagnostic device compatible with local diagnosis and remote diagnosis may include:

[0206] A memory 401 storing executable program codes;

[0207] a processor 402 coupled to the memory 401;

[0208] The processor 402 calls the executable program code stored in the memory 401 to execute the steps of the vehicle diagnosis method compatible with local diagnosis and remote diagnosis described in the first embodiment of the present invention or the second embodiment of the present invention.

[0209] Embodiment 5

[0210] An embodiment of the present invention discloses a computer storage medium storing computer instructions. When the computer instructions are called, they are used to execute the steps of the vehicle diagnosis method compatible with local diagnosis and remote diagnosis described in Embodiment 1 or Embodiment 2 of the present invention.

[0211] Embodiment 6

[0212] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps of the vehicle diagnostic method compatible with local diagnosis and remote diagnosis described in embodiment one or embodiment two.

[0213] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0214] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0215] Finally, it should be noted that the vehicle diagnostic method and device compatible with local diagnosis and remote diagnosis disclosed in the embodiment of the present invention discloses only the preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A vehicle diagnosis method compatible with local diagnosis and remote diagnosis, It is characterized in that The method is applied to a vehicle diagnostic device, wherein the vehicle diagnostic device comprises a main control platform, and the main control platform comprises a first sub-main control platform and a second sub-main control platform; The method comprises: Acquire a vehicle diagnostic mode for the vehicle selected by a user, and establish a communication connection channel between the first sub-main control platform and the second sub-main control platform according to the vehicle diagnostic mode; Acquire a diagnostic instruction data packet through the communication module corresponding to the vehicle diagnostic mode, and send the diagnostic instruction data packet to the target device through the main control platform; The target diagnostic data returned by the target device is collected through the main control platform and the communication connection channel, and a diagnostic result for the vehicle is determined according to the target diagnostic data.

2. The vehicle diagnosis method compatible with local diagnosis and remote diagnosis according to claim 1, It is characterized in that The main control platform includes an application process and an independent process, and the target device includes a third-party diagnostic platform and the vehicle; The step of sending the diagnostic instruction data packet to the target device through the main control platform includes: The diagnostic instruction data packet is transferred to a dynamic library preset in the application process through a transfer interface preset in the application process; Sending the diagnostic instruction data packet from the dynamic library to the independent process through the transmission control protocol thread in the dynamic library, and sending the diagnostic instruction data packet to the Ethernet card through the first target thread in the independent process; Sending the diagnostic instruction data packet to the third-party diagnostic platform through the Ethernet card corresponding to the first sub-main control platform, and sending the diagnostic instruction data packet to the vehicle through the Ethernet card corresponding to the second sub-main control platform; And, collecting the target diagnostic data returned by the target device through the main control platform and the communication connection channel includes: collecting target diagnostic data returned by the target device through the Ethernet card, and sending the target diagnostic data to the independent process, the target diagnostic data including diagnostic communication data corresponding to the third-party diagnostic platform and vehicle data corresponding to the vehicle; Sending the target diagnostic data to the dynamic library in the application process through a second target thread in the independent process; The target diagnostic data is transmitted to a communication module corresponding to the vehicle diagnostic mode through the transmission interface in the application process.

3. The vehicle diagnosis method compatible with local diagnosis and remote diagnosis according to claim 2, It is characterized in that The first target thread includes a first receiving thread and a first sending thread, and the second target thread includes a second receiving thread and a second sending thread; The step of sending the diagnostic instruction data packet to the Ethernet card through the first target thread in the independent process includes: Blocking the calling of the first target function in the first receiving thread to receive the diagnostic instruction data packet from the dynamic library, and extracting the first target data frame in the diagnostic instruction data packet; Sending the first target data frame to the first sending thread, and sending the first target data frame to the Ethernet card through the first sending thread; And, sending the target diagnostic data to the dynamic library in the application process through the second target thread in the independent process includes: In the second receiving thread, blocking calling of a second target function receives the target diagnostic data from the Ethernet card, and determines whether the target diagnostic data meets a preset target condition; When the target diagnostic data meets the target condition, the target diagnostic data is sent to the second sending thread, and the target diagnostic data is sent to the dynamic library in the application process through the second sending thread.

4. The vehicle diagnosis method compatible with local diagnosis and remote diagnosis according to claim 3, It is characterized in that The determining whether the target diagnostic data meets a preset target condition includes: Determine whether the source address and the destination address of the Ethernet frame of the target diagnostic data are equal to the media access control address of the Ethernet card, and when the source address or the destination address is not equal to the media access control address, obtain a target field value of a second target data frame corresponding to the target diagnostic data, the target field value including a type field value or a length field value; Determine whether a target field value of the second target data frame satisfies a preset data frame format, and when the target field value does not satisfy the data frame format, determine whether the target field value is greater than a preset field length; When the target field value is greater than the field length, it is determined that the target diagnostic data meets a preset target condition.

5. The vehicle diagnosis method compatible with local diagnosis and remote diagnosis according to any one of claims 2 to 4, It is characterized in that Before sending the diagnostic instruction data packet from the dynamic library to the independent process through the transmission control protocol thread in the dynamic library, the method further includes: Start an independent process with root privileges and shut down the client and server of the Dynamic Host Configuration Protocol; Start the Ethernet card through a preset pin, and when it is detected that the Ethernet card has been started, set the Ethernet card to a target mode, wherein the target mode includes a promiscuous mode; A transmission control protocol server is created in the independent process, and listens on the local loopback address and port. When a transmission control protocol client in the dynamic library is listened to apply for connection, the transmission control protocol server is connected to the transmission control protocol client.

6. The vehicle diagnosis method compatible with local diagnosis and remote diagnosis according to claim 5, It is characterized in that The method further comprises: Loading the dynamic library in the application process, and starting the application in the dynamic library through a preset transfer interface; Creating a transmission control protocol client and a transmission control protocol thread in the dynamic library, wherein the transmission control protocol client is used to connect to the transmission control protocol server in the independent process, and the transmission control protocol thread includes a transmission control protocol sending thread and a transmission control protocol receiving thread; The transmission control protocol sending thread is used to send the diagnostic instruction data packet from the dynamic library to the independent process, and the transmission control protocol receiving thread is used to receive the target diagnostic data sent by the second target thread in the independent process.

7. The vehicle diagnosis method compatible with local diagnosis and remote diagnosis according to any one of claims 1, 2, 3, 4 and 6, It is characterized in that The vehicle diagnostic mode includes a local diagnostic mode or a remote diagnostic mode; The establishing of a communication connection channel between the first sub-main control platform and the second sub-main control platform according to the vehicle diagnostic mode includes: When the vehicle diagnostic mode includes the local diagnostic mode, a first communication driver of a communication module corresponding to the local diagnostic mode is loaded, and the first sub-main control platform is controlled to connect to the second sub-main control platform according to a local area network type corresponding to the local diagnostic mode, so as to establish a communication connection channel between the first sub-main control platform and the second sub-main control platform, wherein the local area network type includes a Bluetooth type or a wireless broadband type; When the vehicle diagnostic mode includes the remote diagnostic mode, the second communication driver of the communication module corresponding to the remote diagnostic mode is loaded, and when the communication module corresponding to the remote diagnostic mode is successfully connected to the network, the first sub-master control platform and the second sub-master control platform are controlled to respectively connect to the preset transit server as the transparent forwarding of data to establish a communication connection channel between the first sub-master control platform and the second sub-master control platform.

8. A vehicle diagnostic device compatible with local diagnosis and remote diagnosis, It is characterized in that The device is applied to a vehicle diagnostic device, wherein the vehicle diagnostic device comprises a main control platform, and the main control platform comprises a first sub-main control platform and a second sub-main control platform; The device comprises: An acquisition module, used for acquiring a vehicle diagnostic mode for a vehicle selected by a user, and establishing a communication connection channel between the first sub-main control platform and the second sub-main control platform according to the vehicle diagnostic mode; A sending module, used for acquiring a diagnostic instruction data packet through a communication module corresponding to the vehicle diagnostic mode, and sending the diagnostic instruction data packet to a target device through the main control platform; A collection module is used to collect target diagnostic data returned by the target device through the main control platform and the communication connection channel, and determine a diagnostic result for the vehicle based on the target diagnostic data.

9. A vehicle diagnostic device compatible with local diagnosis and remote diagnosis, It is characterized in that The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the vehicle diagnosis method compatible with local diagnosis and remote diagnosis as described in any one of claims 1-7.

10. A computer storage medium, It is characterized in that The computer storage medium stores computer instructions, which, when called, are used to execute the vehicle diagnosis method compatible with local diagnosis and remote diagnosis as described in any one of claims 1-7.