Vehicle diagnosis method and device, electronic equipment and storage medium

By using a target style sheet and a diagnostic request message with format information in a vehicle diagnostic device, the problem of low transmission efficiency due to a fixed data format is solved, and more efficient data transmission and diagnosis are achieved.

CN120802903AActive Publication Date: 2025-10-17LAUNCH TECH CO LTD

Patent Information

Application Number
CN202510922692.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-10-17
Estimated Expiration
2045-07-04

AI Technical Summary

Technical Problem

In existing vehicle diagnostic equipment, data transmission efficiency is low because the data format cannot be changed after leaving the factory, resulting in low diagnostic efficiency.

Method used

By sending a diagnostic request message containing a target style sheet to the electronic control unit, the target style sheet includes target data items and target format information. The electronic control unit performs format conversion according to the target format information and replies with a diagnostic response message. The diagnostic device parses the message to obtain target vehicle data.

Benefits of technology

It improves data transmission efficiency and diagnostic efficiency, reduces redundant data acquisition and message encapsulation, and enhances the scalability and flexibility of the diagnostic system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120802903A_ABST
    Figure CN120802903A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a vehicle diagnosis method and device, electronic equipment and a storage medium, and the method comprises the steps that a diagnosis request message is sent to an electronic control unit, the diagnosis request message comprises a target style sheet, and the target style sheet comprises a target data item and target format information; the target data item is used for indicating a vehicle data type needing to be acquired, and the target format information is used for indicating a reply format of the target data item; a diagnosis response message is received from the electronic control unit, the diagnosis response message comprises target vehicle data, the target vehicle data is obtained by performing format conversion on initial vehicle data by the electronic control unit according to the reply format, and the initial vehicle data is vehicle data corresponding to the vehicle data type; analyzing the diagnosis response message to obtain target vehicle data; and diagnosing the electronic control unit according to the target vehicle data. According to the embodiment of the invention, when the vehicle is diagnosed, the diagnosis efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of vehicles, in particular to a vehicle diagnosis method and device, an electronic equipment and a storage medium. BACKGROUND

[0002] When diagnosing a vehicle using a diagnosis device, data of the vehicle needs to be acquired first. The acquisition of the vehicle data is achieved by sending a diagnosis request message by the diagnosis device, and then the electronic control unit of the vehicle replies the message to reply the requested data to the diagnosis device.

[0003] However, in the reply message, the format coding of the data and the byte position in the message are fixed and cannot be changed after the vehicle is shipped. Due to the fixed format, the data transmission efficiency is relatively low, which reduces the diagnosis efficiency. SUMMARY

[0004] To solve the above problems, the embodiments of the present application provide a vehicle diagnosis method, device, electronic equipment and storage medium, which can improve the diagnosis efficiency when diagnosing a vehicle.

[0005] In a first aspect, the embodiments of the present application provide a vehicle diagnosis method applied to a diagnosis device, comprising:

[0006] sending a diagnosis request message to an electronic control unit, wherein the diagnosis request message comprises a target style sheet, the target style sheet comprises a target data item and target format information, the target data item is used to indicate a vehicle data type to be acquired, and the target format information is used to indicate a reply format of the target data item;

[0007] receiving a diagnosis response message from the electronic control unit, wherein the diagnosis response message comprises target vehicle data, the target vehicle data is obtained by performing format conversion on initial vehicle data according to the reply format, and the initial vehicle data is vehicle data corresponding to the vehicle data type;

[0008] analyzing the diagnosis response message to obtain the target vehicle data;

[0009] diagnosing the electronic control unit according to the target vehicle data.

[0010] In a second aspect, the embodiments of the present application provide a vehicle diagnosis device, comprising a sending unit, a receiving unit and a processing unit.

[0011] The sending unit is configured to send a diagnosis request message to an electronic control unit, wherein the diagnosis request message comprises a target style sheet, the target style sheet comprises a target data item and target format information, the target data item is used to indicate a vehicle data type to be acquired, and the target format information is used to indicate a reply format of the target data item;

[0012] The receiving unit is configured to receive a diagnostic response message from the electronic control unit, wherein the diagnostic response message comprises target vehicle data, the target vehicle data being obtained by the electronic control unit from the initial vehicle data according to a reply format, and the initial vehicle data being vehicle data corresponding to a vehicle data type;

[0013] The processing unit is configured to parse the diagnostic response message to obtain the target vehicle data.

[0014] The electronic control unit is diagnosed according to the target vehicle data.

[0015] In a third aspect, an electronic device is provided, which includes a processor and a memory, the processor being connected to the memory, the memory being configured to store a computer program, and the processor being configured to execute the computer program stored in the memory, so that the electronic device executes the method according to the first aspect.

[0016] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the method according to the first aspect.

[0017] In a fifth aspect, a computer program product is provided, which includes a non-transitory computer readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute the method according to the first aspect.

[0018] By implementing the embodiments of the present application, the following beneficial effects can be achieved:

[0019] In the embodiment of the present application, a diagnostic request message is first sent to the electronic control unit, wherein the diagnostic request message comprises a target style sheet, the target style sheet comprises target data items and target format information, the target data items are used to indicate the types of vehicle data that need to be acquired, and the target format information is used to indicate the reply format of the target data items; then, a diagnostic response message is received from the electronic control unit, wherein the diagnostic response message comprises target vehicle data, the target vehicle data is obtained by performing format conversion on initial vehicle data according to the reply format, and the initial vehicle data is vehicle data corresponding to the types of vehicle data; next, the diagnostic response message is parsed to obtain the target vehicle data; and finally, the electronic control unit is diagnosed according to the target vehicle data. In this way, by sending the diagnostic request message to the electronic control unit, the diagnostic request message comprises target format information, the target format information reflects the data acquisition requirements and data packaging requirements of the diagnostic device, and then the electronic control unit can acquire data and package the diagnostic response message according to the target format information, and not according to the inherent format. The target format information can flexibly adjust the data acquisition items and packaging methods according to the requirements of the diagnostic device, avoids redundant data acquisition and message packaging, and can improve the transmission efficiency of data and the diagnostic efficiency when diagnosing the vehicle. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background art, the drawings needed to be used in the embodiments of the present application or the background art will be described below. Obviously, the drawings described below are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0021] Figure 1 is a schematic diagram of a vehicle diagnostic system architecture provided by the embodiment of the present application;

[0022] Figure 2 is a flowchart of a vehicle diagnostic method provided by the embodiment of the present application;

[0023] Figure 3 is a schematic diagram of a target style sheet provided by the embodiment of the present application;

[0024] Figure 4 is a vehicle diagnostic interaction process based on first verification provided by the embodiment of the present application;

[0025] Figure 5 is a vehicle diagnostic interaction process based on second verification provided by the embodiment of the present application;

[0026] Figure 6is a schematic diagram of an identifier verification method provided by an embodiment of the present application.

[0027] Figure 7 is a structural schematic diagram of a vehicle diagnosis device provided by an embodiment of the present application.

[0028] Figure 8 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0029] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0030] The terms "first", "second", "third", and "fourth" and the like in the specification and claims of the present application and the drawings are used to distinguish different objects, but not to describe a particular order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or modules is not limited to the listed steps or modules, but can optionally include other steps or modules not listed, or can optionally include other steps or modules inherent to the process, method, product or device.

[0031] In this document, the term "embodiment" means that a particular feature, result or characteristic described in connection with an embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment is referred to, nor does it mean that the embodiments are mutually exclusive or alternative to each other. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0032] The related content, concepts, technical problems, technical solutions, beneficial effects and the like involved in the embodiments of the present application will be described below.

[0033] In an automotive electronic control unit, the data format in the reply message is usually strictly defined according to a predetermined standard or protocol at the time of factory shipment, and the setting logic of parameters such as position, encoding type, byte and bit high and low is related. However, the fixed format limits the combination and transmission mode of data, resulting in low efficiency.

[0034] Referring to Figure 1 , Figure 1Fig. 1 is a schematic diagram of an architecture of a vehicle diagnostic system provided by an embodiment of the present application. The vehicle diagnostic system comprises a diagnostic device and an electronic control unit, and data interaction is performed between the diagnostic device and the electronic control unit, for example, the diagnostic device sends a diagnostic request message to the electronic control unit, and the electronic control unit sends a diagnostic response message to the diagnostic device.

[0035] It should be noted that the vehicle diagnostic method provided by an embodiment of the present application is applied to a diagnostic device. The electronic control unit (ECU) is a key component responsible for managing and controlling different systems in a vehicle. It collects data of an engine, a brake, a gearbox, etc. through sensors, optimizes fuel injection and ignition timing, and improves performance and efficiency. The ECU controls safety systems such as an antilock brake system (ABS) and an electronic stability program (ESP), ensures driving safety, communicates with other ECUs through a controller area network (CAN) bus, implements intelligent functions such as adaptive cruise control and automatic parking, and can also perform fault diagnosis and early warning to support intelligent, efficient and safe operation of a vehicle.

[0036] Referring to Figure 2 , Figure 2 Fig. 2 is a flowchart of a vehicle diagnostic method provided by an embodiment of the present application. The vehicle diagnostic method provided by an embodiment of the present application comprises but is not limited to the following steps.

[0037] Step S101: a diagnostic request message is sent to an electronic control unit.

[0038] The diagnostic request message comprises a target style sheet, the target style sheet comprises target data items and target format information, the target data items are used to indicate types of vehicle data to be acquired, and the target format information is used to indicate a reply format of the target data items.

[0039] Step S102: a diagnostic response message is received from the electronic control unit.

[0040] The diagnostic response message comprises target vehicle data, the target vehicle data is obtained by performing format conversion on initial vehicle data according to the reply format, and the initial vehicle data is vehicle data corresponding to the types of vehicle data.

[0041] Step S103: the diagnostic response message is parsed to obtain the target vehicle data.

[0042] Step S104: the electronic control unit is diagnosed according to the target vehicle data.

[0043] In one possible embodiment, for the diagnostic device, a target style sheet is first constructed, and a diagnostic request message is generated according to the target style sheet, then the message is assembled, and the diagnostic request message is sent to the electronic control unit.

[0044] Specifically, the diagnostic device generates a target style sheet locally according to diagnostic requirements. For example, if engine speed and coolant temperature data are to be acquired, "engine speed" and "coolant temperature" are written into the style sheet as target data items, and parameters such as starting byte, starting bit, byte size end, bit size end, bit length, and data encoding type are explicitly specified in the target format information. For example, it is specified that the engine speed data occupies 2 bytes, uses little-endian, linear encoding, and the scale factor is 0.1, and the coolant temperature data occupies 1 byte, uses big-endian, and is encoded as an unsigned integer.

[0045] Further, the constructed target style sheet is encapsulated into a diagnostic request message, and the format of the message complies with a predetermined communication protocol, such as a CAN bus-based diagnostic protocol or an ISO 14229 protocol. Taking the CAN bus as an example, the message includes an identity document (ID) and a data field, the target style sheet is filled as the content of the data field, and a suitable identifier is set to identify the message as a diagnostic request.

[0046] Further, the diagnostic device sends the assembled diagnostic request message to the electronic control unit through a vehicle-mounted communication network, such as a CAN bus, a vehicle-mounted Ethernet, or the like.

[0047] Correspondingly, when the electronic control unit processes the request according to the diagnostic request message, it first performs request analysis, then acquires data and performs format conversion according to the request, generates a diagnostic response message, and finally sends the diagnostic response message to the diagnostic device.

[0048] Specifically, after receiving the diagnostic request message, the ECU first parses the message, extracts the target style sheet, and according to the target data items in the target style sheet, the ECU obtains the corresponding initial vehicle data from internal storage or sensor acquisition module, for example, obtains the original data of engine speed from the engine control module, and reads the original measurement value of coolant temperature from the temperature sensor. Then, according to the target format information in the target style sheet, the ECU performs format conversion on the obtained initial vehicle data, such as arranging the original data of engine speed in little-endian order, calculating according to the linear coding rule and the scale factor, and adjusting the coolant temperature data to the unsigned integer form of big-endian order. Then, the ECU assembles the target vehicle data after format conversion into a diagnostic response message, also follows the communication protocol, fills the target vehicle data into the data field of the response message, and sets the correct identifier to indicate that this is a response to the diagnostic request. Finally, the ECU sends the diagnostic response message back to the diagnostic device through the same communication network.

[0049] Further, the diagnostic device parses the response message. The diagnostic device receives the diagnostic response message from the ECU, parses the diagnostic response message according to the format information defined in the target style sheet. Extract the target vehicle data from the message, determine the position of the data according to the starting byte and the starting bit, adjust the data order according to the byte size end and the bit size end rule, and extract the effective data according to the bit length to obtain the target vehicle data. In addition, binary data can also be converted into numerical values with actual physical meaning according to the data coding type, such as converting the converted engine speed data from binary to actual speed value in revolutions per minute (RPM).

[0050] Further, the diagnostic device analyzes the target vehicle data obtained by parsing. For example, compare the engine speed with the normal speed range to determine whether the engine is working in normal state, analyze whether the coolant temperature is too high, whether there is a cooling system failure, etc. According to the analysis result, generate a diagnostic report, which lists the detected vehicle data, the comparison between the data and the normal range, the possible fault points and the fault cause analysis, etc. Finally, the diagnostic report is displayed in a visual form to the maintenance personnel, such as displayed on the display screen of the diagnostic device, or transmitted to the maintenance management system through the network, to provide basis for vehicle maintenance.

[0051] In the embodiment of the present application, the complexity and uncertainty of data analysis are reduced by the explicit format definition of the target style, the diagnostic equipment does not need to perform complex format adaptation on ECU data from different sources, can quickly and accurately analyze the response message, obtain target vehicle data, thereby accelerating the diagnostic efficiency, at the same time, the ECU converts and sends data according to the predetermined format, which also improves the efficiency of data processing. In addition, when new diagnostic functions or diagnostic data types need to be added, only the related content in the target style table needs to be modified, without the need to make large-scale changes to the underlying communication logic of the diagnostic equipment and the ECU. For example, if the battery voltage needs to be added, only the battery voltage needs to be added as a target data item in the style table and its format information needs to be defined, so that the new data can be obtained and diagnosed, thereby enhancing the expansibility and flexibility of the diagnostic system.

[0052] Optionally, the reply format comprises: start byte, start bit, byte size end, bit size end, bit length, data encoding type; and step S103 comprises the following steps:

[0053] Step S201: parsing the vehicle data type from the diagnostic response message;

[0054] Step S202: determining the reply format according to the vehicle data type;

[0055] Step S203: determining the data storage position of the vehicle data type corresponding to the vehicle data in the diagnostic response message according to the start byte, the start bit and the bit length;

[0056] Step S204: determining the data storage order according to the byte size end, the bit size end and the data encoding type;

[0057] Step S205: analyzing the diagnostic response message according to the data storage position and the data storage order to obtain the target vehicle data.

[0058] In a possible embodiment, the vehicle data type is parsed from the diagnostic response message, first the protocol header in the message is identified, then the data item identifier is extracted, and finally verification and mapping are performed.

[0059] Specifically, the diagnostic response message usually contains a protocol header, by parsing the header information, the message type can be determined, such as fault code response, real-time data stream, etc. For example, if the message ID is 0x7E8, it is determined as an ECU response message. The data field in the message usually contains a data item identifier (Diagnostic Identifier, DID), which is used to uniquely identify the vehicle data type. For example, if the DID is 0x010C, it can be determined as engine speed, and if the DID is 0x0105, it can be determined as coolant temperature. The extracted DID is compared with the local data dictionary to ensure the validity of the data type, and if the DID does not exist or is invalid, an error code is returned.

[0060] In one possible embodiment, according to the vehicle data type, the reply format is determined, and according to the target style sheet pre-stored by the diagnostic device, the vehicle data type is mapped and searched to obtain the reply format corresponding to the vehicle data type. For example, if the DID is 0x22010C, the reply format can be 2 bytes, little-endian, linear encoding.

[0061] In one possible embodiment, the data storage location is determined. First, the byte offset is calculated and the bit offset is processed, and then the bit length is checked. Specifically, according to the starting byte, such as the starting byte being 2, the data starting position is located by offsetting from the message header. For example, if the message is 0x42010C07D0, the 3rd byte 0x07 is parsed. If the starting bit is not 0, for example, the starting byte is 4, the bit boundary across the bytes needs to be calculated, for example, if the data crosses byte 2 (bit 4-7) and byte 3 (bit 0-3), the two bytes of data need to be merged by bit. Ensure that the parsed bit length does not exceed the message boundary to avoid out-of-bound reading.

[0062] In one possible embodiment, the data storage sequence is determined. First, the byte sequence is adjusted, for example, little-endian is used to indicate that the low byte is in the front, for example, for 0x07D0, the actual value is 0xD007, and big-endian is used to indicate that the high byte is in the front, for example, for 0x07D0, the actual value is 0x07D0. Then, the bit sequence is adjusted, if the reply format indicates that the least significant bit is first, then bit 0 is the least significant bit, and it is parsed in natural order, if the reply format indicates that the most significant bit is first, then bit 0 is the most significant bit, and the bit order needs to be reversed, for example, if the bit length is 4 and occupies the high 4 bits of the byte, such as 0x07, it can be converted to 00000111 first, if the reply format indicates that the most significant bit is first, it needs to be inverted to 01110000. Then, the mask and bit shift operation is performed, using the bit mask, for example, 0xFF, and the bit shift operation, for example, <<, to extract the valid bits, if the reply format indicates byte&0xF0>>4, the high 4 bits of the byte are extracted.

[0063] In the embodiments of the present application, the complex message analysis is split into independent steps of data type identification, format matching, position calculation, sequence adjustment, and encoding conversion, and strict endianness rules and bit boundary calculation are followed to ensure accurate analysis of multi-byte and cross-byte data. Only target data items are analyzed to avoid full analysis and reduce the consumption of computing resources, and the method is particularly suitable for resource-limited vehicle diagnostic devices.

[0064] Optionally, before the diagnostic request message is sent to the electronic control unit in step S101, the following steps can also be included:

[0065] Step S301: determining target data items and target format information;

[0066] Step S302: generating a target style sheet according to the target data items and the target format information;

[0067] Step S303: generating a diagnostic request message according to the target style sheet.

[0068] Specifically, the target data items can be set by the user, for example, by the user checking the target data items to be obtained on the interactive interface of the diagnostic device, or the diagnostic device can automatically determine the target data items according to historical diagnostic data items, for example, according to the historical diagnostic data items, a diagnostic data item rule is obtained, and according to the rule, the target data items currently to be diagnosed are predicted, or the target data items corresponding to the diagnostic function currently selected by the user can be automatically generated, for example, if the current diagnostic function is to detect whether the vehicle is in a working state, the target data items can include the speed, engine temperature, etc.

[0069] Specifically, the target format information can be set by the user or automatically generated by the diagnostic device, and the diagnostic device can determine different target format information according to different application scenarios.

[0070] In a possible embodiment, a target stylesheet is generated according to target data items and target format information. According to diagnostic requirements, vehicle data types that need to be acquired are selected from a predefined data item library, such as engine speed, coolant temperature, fault code, and the like, and a unique DID is assigned to each data item, for example, the DID of engine speed is 0x010C, the DID of coolant temperature is 0x0105, and the DID of fault code is 0x03. Detailed format information is configured for each data item, wherein the start byte is used to indicate the start byte position of the data in the message, the start bit is used to indicate the start bit position of the data in the byte, the byte size end is used to indicate the storage order of multi-byte data, specifically including little-endian or big-endian, the bit size end is used to indicate the storage order of the bit field, specifically including least significant bit first or most significant bit first, the bit length is used to indicate the total number of bits occupied by the data, and the data encoding type is used to indicate the encoding mode of the data. Then, the data items and the format information are combined into a structured stylesheet, which can be in JSON format or XML format.

[0071] In a possible embodiment, a diagnostic request message is generated according to the target stylesheet. The diagnostic request message needs to comply with a specific communication protocol, such as ISO 14229, OBD-II, and encapsulates the target stylesheet therein. First, a suitable protocol is selected according to the diagnostic scenario, and then a message header is constructed according to an identifier and a control field, wherein the identifier is used to specify the target ECU and the priority of the message, in the OBD-II standard, the request message ID is 0x7DF, and the response message ID is 0x7E8, and the control field is used to specify message type, length, and the like. Next, the target stylesheet is converted into a protocol-compatible format and added to the message data field. For example, for the ISO 14229 format, the message data field can be composed of: [service ID]+[DID high byte]+[DID low byte]+[data length]+[stylesheet data].

[0072] For example, refer to Figure 3 , Figure 3 is a schematic diagram of a target stylesheet provided in an embodiment of the present application. As shown in Figure 3 , the target stylesheet includes information such as DID, start byte, start bit, byte size end, bit size end, bit length, and encoding type, for example, the DID is 0x010C, which refers to engine speed, the start byte is 2, the start bit is 0, the byte size end is little-endian, the bit size end is least significant bit first, the bit length is 16, and the encoding type is enumeration encoding.

[0073] In an embodiment of the present application, the explicit data format definition reduces redundant information, optimizes the message length, and improves communication efficiency and diagnostic efficiency.

[0074] Optionally, in step S301, the determining of the target format information can include the following steps:

[0075] Step S401: Obtain historical usage data of the diagnostic device.

[0076] Step S402: Determine an application scenario of the diagnostic device according to the historical usage data, wherein the application scenario is used to indicate at least one of the following data modes of the diagnostic device: a data display mode, a data transmission mode, and a data processing mode.

[0077] Step S403: Determine the target format information according to the application scenario and a preset first mapping relationship, wherein the first mapping relationship is used to reflect a corresponding relationship between the application scenario and the target format information.

[0078] In a possible embodiment, the historical usage data of the diagnostic device is obtained. The historical usage data includes device logs, user configuration information, and a diagnostic report. The device logs record information such as time, data type, and operation result of each diagnostic operation. The user configuration information includes settings such as a user's preferred display format and transmission protocol. The diagnostic report is a complete report generated in a historical diagnostic process, containing full-process records of data acquisition, processing, and display. The historical usage data is used to reflect operation records, data formats, and device states. The operation records can be the frequency and time of operations such as "reading engine speed" and "checking fault code P0101". The data formats can be format parameters used in the historical usage, such as start byte and big-endian or little-endian. The device states include working modes of the diagnostic device such as offline or online, and connected ECU types.

[0079] In a possible embodiment, the application scenario of the diagnostic device is determined according to the historical usage data. The operation behaviors in the historical usage data can be grouped by a clustering algorithm, and a classification model can be trained to predict the current application scenario. If a current operation of a user is received, the corresponding application scenario can be adjusted in real time, wherein the application scenario is used to indicate at least one of the following data modes of the diagnostic device: a data display mode, a data transmission mode, and a data processing mode.

[0080] In a possible embodiment, the target format information is determined according to an application scenario and a preset first mapping relationship, where the first mapping relationship is used to reflect a corresponding relationship between the application scenario and the target format information. The first mapping relationship can be determined based on a preset rule base or a dynamic mapping table. For the preset rule base, if the application scenario is real-time monitoring, the target format information can be little-endian, fixed bit length, and linear encoding, so as to facilitate fast parsing; if the application scenario is remote diagnosis, the target format information can be big-endian and compressed encoding, so as to reduce transmission volume; and if the application scenario is fault diagnosis, the target format information can be enumeration encoding, so as to facilitate direct mapping of fault description. For the dynamic mapping table, an association rule of the scene and the format is automatically generated based on historical data. For example, if 90% of the "real-time monitoring" scene uses little-endian, a strong association is established. The start byte and the start bit can be determined according to the most common offset based on historical usage frequency, and the endianness can be selected according to the scene priority, for example, real-time monitoring preferentially selects little-endian. For frequently used data items, high-efficiency encoding such as linear mapping is used, and for infrequently used data, compressed encoding is used to save space.

[0081] For example, if the diagnostic device detects high-frequency reading of engine parameters, it automatically selects little-endian and linear encoding to ensure fast data display. If the device detects that data needs to be transmitted to the cloud, it automatically selects big-endian and compressed encoding to reduce network traffic. If the device detects that the user frequently exports historical data, it automatically optimizes the report format to improve data readability.

[0082] In the embodiments of the present application, the diagnostic device automatically selects the optimal format without manual configuration by the user, improves operation efficiency, and dynamically adjusts the format according to different application scenarios to ensure optimization of data processing and transmission.

[0083] Optionally, in step S301, determining the target format information can include the following steps:

[0084] Step S501: Obtain historical data item information of a target data item.

[0085] Step S502: Predict a data item character type and a data item character quantity of the target data item according to the historical data item information, where the data item character type includes at least one of the following: a numerical type, a text type, and a language type.

[0086] Step S503: Determine at least one character occupation ratio according to the data item character type and the data item character quantity.

[0087] Step S504: Determine the target format information according to the at least one character occupation ratio and a preset second mapping relationship, where the second mapping relationship is used to reflect a corresponding relationship between the at least one character occupation ratio and the target format information.

[0088] Specifically, the historical data information of the target data item includes original values, timestamps, associated ECUs, etc., for reflecting the value characteristics, timing characteristics and context characteristics of the target data item, wherein the value characteristics include maximum value, minimum value, average value, standard deviation, etc., the timing characteristics include data change trend, periodic fluctuation, etc., and the context characteristics include associated data items, such as the correlation between speed and load.

[0089] In a possible embodiment, according to the historical data item information, the data item character type and the data item character quantity of the target data item are predicted, wherein the data item character type includes at least one of the following: numerical type, text type, language type. Based on the numerical range and the precision characteristics, integer, floating point number, percentage, etc. are distinguished for numerical type identification, regular expression matching is used to identify text types such as fault codes and fault descriptions, and N-gram features are used to determine text languages such as ASCII and UTF-8 multi-byte characters for language type identification. According to a time series model such as a long short-term memory network, the change trend of the data item length over time and the association rules between the data item length and the working condition parameters are predicted, wherein the working condition parameters can be vehicle speed, engine load, etc.

[0090] In a possible embodiment, according to the data item character type and the data item character quantity, at least one character occupation ratio is determined. The character occupation ratio includes a space occupation ratio, a time occupation ratio and an importance weight ratio, wherein the space occupation ratio is obtained by calculating the proportion of different character types in the total storage space, such as 80% for numerical type and 20% for text type, the time occupation ratio is determined according to the time consumption proportion of different character types in the data transmission process, such as numerical type priority in real-time transmission, and the importance weight ratio is determined based on information entropy to calculate the information value weight of each character type, such as fault code text weight higher than ordinary state indication. Moreover, the proportion threshold is dynamically adjusted according to the application scenario, such as preferentially compressing text data in the remote diagnosis scenario.

[0091] In a possible embodiment, the target format information is determined according to the at least one character proportion and a preset second mapping relationship, where the second mapping relationship is used to reflect a corresponding relationship between the at least one character proportion and the target format information. Specifically, the second mapping relationship can be determined according to a proportion-format mapping table and a fuzzy matching algorithm. According to the proportion-format mapping table, the target format information can be determined according to a character proportion combination. For example, if the character proportion combination is a number type > 80%, the target format information can be little-endian, fixed bit length, and binary encoding. If the character proportion combination is a text type > 50% and contains multi-byte characters, the target format information can be UTF-8 encoding, a variable length field, and big-endian alignment. If the character proportion combination is a mixed type and has high real-time requirements, the target format information can be segmented encoding and a parallel transmission mechanism. According to the fuzzy matching algorithm, when the actual proportion combination does not hit the preset rule, a nearest neighbor algorithm is used to select the most similar format configuration. In addition, more bit width is allocated to a high-weight character type to ensure accuracy, for example, 16-bit encoding is used for fault codes. For mixed data types, a composite encoding scheme is used, for example, the first 8 bits are state flags and the last 24 bits are numerical values.

[0092] In the embodiments of the present application, characteristics of different character types are considered, for example, a number type is suitable for binary compression, and a text type needs character set adaptation. An encoding scheme is optimized to enable the same storage space to carry more effective information, and to automatically adapt to different language environments, for example, a Chinese diagnostic report uses UTF-8 encoding and English uses ASCII encoding. On a device with limited computing resources, decoding complexity is reduced by optimizing character proportion.

[0093] Optionally, in step S301, determining the target format information can include the following steps:

[0094] Step S601: Obtain a remaining storage space of an electronic control unit.

[0095] Step S602: Obtain a candidate format information corresponding to the electronic control unit.

[0096] Step S603: Predict a byte occupation space corresponding to each candidate format information, to obtain a byte occupation space.

[0097] Step S604: Determine the target format information from the a candidate format information according to the remaining storage space and the a byte occupation space.

[0098] Specifically, the storage information request and interaction are first performed, the diagnostic device sends a request instruction for obtaining the storage state to the electronic control unit through a diagnostic communication protocol, for example, a specific service ID is sent, the ECU parses the instruction and extracts the remaining storage space information from the internal storage management module after receiving the request. Then, information parsing and verification are performed, the ECU encapsulates the remaining storage space data into a storage response message and returns it to the diagnostic device, and the diagnostic device receives the data, parses the data according to the protocol rules, and verifies the information accuracy through checksum, data range check and other methods to ensure that the obtained remaining storage space value is real and reliable.

[0099] In a possible embodiment, a candidate format information library is established in advance, which covers a plurality of combinations of data encoding and storage formats, including but not limited to different byte size end modes such as big-endian and little-endian, bit length settings such as 8 bits, 16 bits, 32 bits, etc., and data encoding types such as linear encoding, enumeration encoding, compression encoding, etc. According to the type, function and diagnostic requirements of the electronic control unit, a plurality of adapted candidate format information are selected from the candidate format library. For example, for the ECU with limited storage resources, the format with compression encoding and short bit length is preferentially selected as a candidate, and for the ECU with strong processing capability, more complex but efficient encoding formats are determined to form a candidate format set.

[0100] In a possible embodiment, the byte occupation space corresponding to each candidate format information is predicted, and a plurality of byte occupation spaces are obtained. A byte occupation space prediction model based on format parameters is established, and the key parameters in each candidate format information are comprehensively considered. For the linear encoding format, the occupation space is calculated according to the data range, precision requirement and bit length, and for the compression encoding format, the number of compressed bytes is estimated in combination with the data characteristics such as redundancy and distribution law, and the characteristics of the compression algorithm. For each candidate format information, if it is a fixed bit length format, the byte occupation space is directly calculated according to the bit length: byte occupation space = bit length / 8, and is rounded up, and if it is a variable length or compression format, the average occupation space is estimated through historical data simulation, sample test and other methods, for example, the number of bytes is counted after a group of sample data is encoded by the format, and the average value is taken as the byte occupation space.

[0101] Further, the target format information is determined from the a candidate format information according to the remaining storage space and the byte occupation space. The byte occupation space of each candidate format is compared with the remaining storage space of the ECU, and the candidate format satisfying the byte occupation space less than or equal to the remaining storage space of the ECU is screened to form a feasible format subset. If the feasible format subset contains multiple elements, the following strategies are further used for screening: a space utilization priority method is used to select the format with the byte occupation space closest to the remaining storage space, so as to maximize the utilization of the storage space; a performance priority method is used to preferentially select the format with high parsing efficiency and low consumption of ECU computing resources; and a compatibility priority method is used to select the format with the best compatibility with other system modules, such as a communication module and a display module. The above strategies are used to determine the final target format information from the feasible format subset.

[0102] In the embodiment of the application, the format information is dynamically adapted, so that the problems of storage space waste or shortage caused by improper format selection are avoided.

[0103] Optionally, after the step S101 of sending the diagnosis request message to the electronic control unit, the following steps can be further included:

[0104] Step S701: receiving a diagnosis verification message from the electronic control unit, wherein the diagnosis verification message is used to indicate verification of the diagnosis response message, and the diagnosis verification message includes a target verification item, and the target verification item is format information in the target style sheet that does not have a mapping relationship with the preset style sheet;

[0105] Step S702: determining a first format of vehicle data corresponding to the target verification item in the diagnosis response message;

[0106] Step S703: determining a second format corresponding to the target verification item in the diagnosis request message;

[0107] Step S704: performing format conversion on the vehicle data corresponding to the target verification item in the diagnosis response message according to the second format and the first format, to obtain a verified diagnosis response message.

[0108] Specifically, the CAN bus ID or the unified diagnosis service ID is used to identify the verification request, and the target verification item field contains the DID and the format parameter of the un-mapped format information.

[0109] In a possible embodiment, the diagnosis device listens to the communication bus, extracts the verification message of a specific ID, parses the message content according to the protocol specification, identifies the target verification item, and distinguishes between the mandatory verification item and the optional verification item, wherein the mandatory verification item is a parameter affecting data security, and the optional verification item is a parameter only affecting display effect.

[0110] In a possible embodiment, the first format of the vehicle data corresponding to the target check item in the diagnostic response message is determined, the corresponding data field is located from the diagnostic response message according to the DID of the target check item, for example, if the check item is the engine speed DID = 0x010C, 0x07D0 is extracted from the response message 0x42010C07D0 as the original data. Then, byte sequence analysis and bit field identification are performed, the byte sequence is inferred through data characteristics, for example, if the parsed speed value is 2000 RPM and the data is 0x07D0, it is inferred that it is big-endian, that is, 0x07D0 = 2000, the data boundary is analyzed, and whether the bit length meets the expectation, such as 16-bit integer, is verified.

[0111] In a possible embodiment, the second format corresponding to the target check item in the diagnostic request message is determined, the target style sheet is extracted from the diagnostic request message, and the format definition corresponding to the target check item is located, such as little-endian and linear encoding.

[0112] In a possible embodiment, the vehicle data corresponding to the target check item in the diagnostic response message is format-converted according to the second format and the first format, to obtain the checked diagnostic response message. The format conversion includes byte sequence conversion, bit field rearrangement, and encoding type conversion. If the first format is big-endian and the second format is little-endian, the byte order is exchanged, such as 0x07D0 converted to 0xD007, the bit order is adjusted through bit shifting and masking operation, if different encodings are involved, the corresponding algorithm is converted, and the data bit sequence and byte sequence are reorganized according to the requirement of the second format.

[0113] Further, the checked diagnostic response message is parsed to obtain the first vehicle data, and finally the electronic control unit is diagnosed according to the first vehicle data.

[0114] For example, refer to Figure 4 , Figure 4 is a vehicle diagnosis interaction process based on first check provided by an embodiment of the present application. First, the diagnostic device sends a diagnostic request message to the vehicle bus, receives a diagnostic check message, and if the diagnostic check message indicates that there is no data missing in the target check item, only the data format check is performed, and the diagnostic response message is checked after receiving the diagnostic response message, to obtain the checked diagnostic response message.

[0115] In a possible embodiment, if the diagnostic check message indicates that there is data that cannot be checked in the target check item, for example, the data that cannot be checked can be data loss caused by inconsistent DID, the diagnostic request message is checked, the original DID in the diagnostic request message is checked, the checked DID is matched with the electronic control unit, and the checked diagnostic request message is sent to the electronic control unit, so that the electronic control unit generates a corresponding check diagnostic response message according to the checked diagnostic request message, and then the check diagnostic response message is received from the electronic control unit, the check diagnostic response message is analyzed to obtain check target vehicle data, and finally the electronic control unit is diagnosed according to the check target vehicle data.

[0116] For example, refer to Figure 5 , Figure 5 is a vehicle diagnosis interaction process based on second check provided by an embodiment of the present application. First, the diagnostic device sends a diagnostic request message 1 to the vehicle bus, receives a diagnostic check message 1, and if the diagnostic check message 1 indicates that there is data loss in the target check item 1, the target vehicle data cannot be obtained by checking the diagnostic response message 1 corresponding to the diagnostic request message 1, then according to the diagnostic check message 1, a diagnostic request message 2 is sent to the vehicle bus, and a diagnostic check message 2 is received, if the diagnostic check message 2 indicates that there is no data loss in the target check item 2, only data format check, according to the target data item 2 in the diagnostic check message 2, the diagnostic response message 2 is checked, and the checked diagnostic response message 2 is obtained.

[0117] In the embodiment of the present application, the diagnostic request message is checked by the electronic control unit, the diagnostic check message is sent to the diagnostic device when the target check item exists, it is ensured that the diagnostic device can check the diagnostic reply response returned by the electronic control unit to the diagnostic device according to the target check item, to obtain the correct data required, and when the diagnostic device cannot check the target check item due to data loss or too many target check items, the diagnostic request response can also be checked by the diagnostic device, and the checked diagnostic request response is re-sent to the electronic control unit, so that the electronic control unit can generate the diagnostic reply response required by the diagnostic device according to the checked diagnostic request response, and the diagnosis efficiency is improved.

[0118] In a specific embodiment, when requesting data from a vehicle ECU, the diagnostic device can set a style sheet. This style sheet defines the number of vehicle data items to be requested, as well as the starting position of each data item, the byte data occupied, the big and small endianness of the bytes, and the encoding type, which may include ASCII, UNICODE, numeric, or UTF8. The style sheet is then inserted into the request command and sent to the vehicle ECU. Upon receiving the request, the ECU formats the corresponding data items in the style sheet according to the format specified in the style sheet, and then inserts the format into the reply command and sends it back to the diagnostic device. This allows the diagnostic device to customize the return format of vehicle data, making it easier to parse and understand. After obtaining the vehicle data, it can be used directly without further encoding conversion, thereby improving diagnostic efficiency.

[0119] Specifically, before requesting data from the vehicle ECU, the diagnostic device can define a style sheet. This style sheet supports defining format information for the data values ​​of multiple data items, including the starting byte, starting bit, byte endianness, bit endianness, bit length, and data encoding type. The starting byte refers to the byte where the data value begins to be stored in the reply command, with the subscript starting at 0. The starting bit refers to the byte bit where the data value begins to be stored, with the subscript starting at 0. A byte contains 8 bits, and the bit length indicates how many bits are used to store the data value. For example, if the vehicle voltage data starts with byte 2, the starting bit is 0, and the bit length is 16, then the voltage value should be stored in bytes 3 and 4 of the reply command, totaling 16 bits. Byte endianness refers to which byte comes first, the high byte or the low byte, in the reply command. The big endian flag can be 1 to indicate the big endianness, while the little endian flag can be 0 to indicate the little endianness. For example, if the voltage data is to be stored in bytes 3 and 4, then big endianness places the high byte first, the third byte, and the low byte fourth byte. Little endianness places the low byte first, the high byte last. The big-endian and small-endian bits represent 8 bits in a byte, from bit 7 to bit 0. The big-endian bit is bit 7, and the little-endian bit is bit 0. The data encoding type refers to the format in which the data value is stored. Different encodings are used in different scenarios. For example, ASCII is generally used to display English characters, while UNICODE is generally used to display characters in other languages. UTF-8 is generally used for network transmission. Numerical values ​​can be directly converted to results. For example, if the voltage value is 12V, the numerical encoding is 12, and the ASCII code is 0x3132.

[0120] Further, the format of multiple data items can be defined in the style sheet at the same time, and the DID of different data items are different, for example, the DID of voltage + the starting byte of voltage + the end flag of voltage byte + the starting bit of voltage + the end flag of voltage bit + the length of voltage bit + the encoding of voltage +

the DID of temperature + the starting byte of temperature + the end flag of temperature byte + the starting bit of temperature + the end flag of temperature bit + the length of temperature bit + the encoding of temperature

[0121] In the style sheet, the information can be manually specified or automatically defined by the use scene of the diagnostic device. For example, if it is required to be displayed on the webpage, the encoding mode can be automatically set to UTF8 format, and if the diagnostic data needs to be transmitted on the network, the byte can be automatically set to big-end mode, because the byte sequence on the network is big-end, and if it needs to be processed locally, the little-end mode can be used, because the processor or ARM processes data in little-end mode. If there are multiple use scenes, the encoding type of the data can be determined according to the maximum supported encoding, for example, in the scene of including English characters, other language characters, and network transmission, if UTF8 occupies more bytes, UTF8 is determined as the target data encoding type, and UTF8 encoding is converted into other encoding formats for use in different scenes.

[0122] Further, after the style sheet is generated, the diagnostic device can fill the style sheet in the request command and send it to the corresponding vehicle ECU to request the data of the vehicle.

[0123] Further, after receiving the request command, the vehicle ECU can parse the style sheet in the request. Then, the style sheet is analyzed and judged, if the style sheet has errors, such as the DID requested does not exist in the ECU at all, the end flag of the size is wrong, etc., the ECU will reply to the diagnostic device that the style sheet has errors and cannot obtain data. For example, refer to Figure 6 , Figure 6is a schematic diagram of an identifier verification method provided by an embodiment of the present application. A diagnostic request message is received by a vehicle bus, and each ECU determines whether to perform an operation corresponding to the diagnostic request message according to the diagnostic request message. For example, the first ECU, the second ECU, and the third ECU obtain the diagnostic request message from the vehicle bus, parse the message to obtain a DID, and if the DID of a certain ECU matches the DID in the diagnostic request message, it is determined that the ECU can process the request, the ECU is determined to be a target ECU, and subsequent data processing procedures are continued. If the DID of all ECUs cannot match the DID in the diagnostic request message, a diagnostic verification message is returned to the diagnostic device through the vehicle bus, and it is prompted that the request cannot be responded.

[0124] Correspondingly, if the vehicle ECU analysis style sheet is correct, the values of the corresponding data are converted according to the format definition in the style sheet, filled in the bytes and bits specified in the reply command, and after the values of each data item requested in the style sheet are filled, the reply command is sent to the diagnostic device. The diagnostic device can parse the values of each data item requested according to the definition in the style sheet, and perform display or upload to a background server and the like. Since the values of the data items have been converted according to the encoding in the style sheet, they can be directly used without conversion by the diagnostic device, for example, the voltage value in UTF8 encoding is directly uploaded to the background interface.

[0125] In summary, in the embodiment of the present application, a diagnostic request message is first sent to an electronic control unit, wherein the diagnostic request message includes a target style sheet, the target style sheet includes target data items and target format information, the target data items are used to indicate the types of vehicle data that need to be obtained, and the target format information is used to indicate the reply format of the target data items. Then, a diagnostic response message is received from the electronic control unit, wherein the diagnostic response message includes target vehicle data, the target vehicle data is obtained by performing format conversion on initial vehicle data according to the reply format by the electronic control unit, and the initial vehicle data is vehicle data corresponding to the types of vehicle data. Next, the diagnostic response message is parsed to obtain the target vehicle data. Finally, the electronic control unit is diagnosed according to the target vehicle data. Thus, by sending a diagnostic request message to an electronic control unit, the diagnostic request message includes target format information, a diagnostic response message is received from the electronic control unit, the target vehicle data in the diagnostic response message is obtained by performing format conversion on initial vehicle data according to the reply format by the electronic control unit, and finally the target vehicle data is obtained by parsing and the electronic control unit is diagnosed according to the target vehicle data. When diagnosing the vehicle, the diagnostic efficiency can be improved.

[0126] The above describes the method of the embodiment of the present application in detail, and the device of the embodiment of the present application is provided below.

[0127] Referring to Figure 7 , Figure 7 is a structural schematic diagram of a vehicle diagnosis device provided by an embodiment of the present application. As shown in Figure 7 , the vehicle diagnosis device 800 comprises a sending unit 801, a receiving unit 802 and a processing unit 803; the sending unit 801 is configured to send a diagnosis request message to an electronic control unit, wherein the diagnosis request message comprises a target style sheet, the target style sheet comprises a target data item and target format information, the target data item is used to indicate a vehicle data type to be acquired, and the target format information is used to indicate a reply format of the target data item; the receiving unit 802 is configured to receive a diagnosis response message from the electronic control unit, wherein the diagnosis response message comprises target vehicle data, the target vehicle data is obtained by performing format conversion on initial vehicle data according to the reply format, and the initial vehicle data is vehicle data corresponding to the vehicle data type; and the processing unit 803 is configured to parse the diagnosis response message to obtain the target vehicle data, and diagnose the electronic control unit according to the target vehicle data.

[0128] In a specific implementation, the sending unit 801, the receiving unit 802 and the processing unit 803 in the embodiment of the present application can also perform other implementation manners described in the vehicle diagnosis method of the embodiment of the present application, which will not be described here.

[0129] Referring to Figure 8 , Figure 8 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. As shown in Figure 8 , the electronic device 900 comprises a transceiver 901, a processor 902 and a memory 903, which are connected through a bus 904. The memory 903 is configured to store computer programs and data, and can transmit data stored in the memory 903 to the processor 902. The electronic device 900 can be the vehicle diagnosis device 800 or the diagnosis device described above, and the processor 902 can be the sending unit 801, the receiving unit 802 and the processing unit 803 described above. In the embodiment of the present application, the processor 902 is configured to read the computer programs in the memory 903 to execute part or all of the steps of the vehicle diagnosis method described above.

[0130] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement part or all of the steps of any one of the vehicle diagnosis methods described in the above method embodiments.

[0131] The embodiment of the present application further provides a computer program product, which comprises a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps of any of the vehicle diagnosis methods described in the above method embodiments.

[0132] It should be noted that, for the above-mentioned method embodiments, in order to simply describe, they are all described as a combination of a series of actions, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0133] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0134] In several embodiments provided by the present application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the above-described apparatus embodiments are merely schematic, for example, the division of the modules is only a logical function division, and actual implementation can have another division manner, for example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed modules can be indirect coupling or communication connection through some interfaces, apparatuses or modules, and can be electrical or other forms.

[0135] The modules described as separate components can or can not be physically separated, and the components displayed as modules can or can not be physical modules, that is, they can be located in one place, or can be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment.

[0136] In addition, each functional module in each embodiment of the present application can be integrated in one processing module, or each module can exist physically, or two or more modules can be integrated in one module. The above integrated module can be realized in the form of hardware or in the form of a software program module.

[0137] The integrated module, if implemented in the form of a software program module and sold or used as an independent product, can be stored in a computer readable memory. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a memory and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned memory includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.

[0138] The embodiments of the present application are described in detail above, and the specific examples are applied to the principles and implementation modes of the present application. The above description of the embodiments is only used to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed; in summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A vehicle diagnostic method, characterized in that: Applied to diagnostic equipment, the method comprises: Sending a diagnostic request message to an electronic control unit, wherein the diagnostic request message includes a target style sheet, the target style sheet includes a target data item and target format information, the target data item is used to indicate the type of vehicle data to be obtained, and the target format information is used to indicate a reply format of the target data item; receiving a diagnostic response message from the electronic control unit, wherein the diagnostic response message includes target vehicle data, the target vehicle data being obtained by the electronic control unit converting initial vehicle data according to the reply format, the initial vehicle data being vehicle data corresponding to the vehicle data type; Parsing the diagnostic response message to obtain the target vehicle data; The electronic control unit is diagnosed according to the target vehicle data.

2. The method according to claim 1, wherein The reply format includes: starting byte, starting bit, byte endian, bit endian, bit length, and data encoding type; parsing the diagnostic response message to obtain the target vehicle data includes: Parsing the vehicle data type from the diagnostic response message; Determining the reply format according to the vehicle data type; Determining a data storage location of the vehicle data corresponding to the vehicle data type in the diagnostic response message according to the start byte, the start bit, and the bit length; Determining a data storage order according to the byte endianness, the bit endianness, and the data encoding type; The diagnostic response message is parsed according to the data storage location and the data storage order to obtain the target vehicle data.

3. The method according to claim 1 or 2, wherein: Before sending the diagnostic request message to the electronic control unit, the method further includes: determining the target data item and the target format information; generating the target style sheet according to the target data item and the target format information; The diagnosis request message is generated according to the target style sheet.

4. The method according to claim 3, wherein Determining the target format information includes: obtaining historical usage data of the diagnostic device; Determining an application scenario of the diagnostic device based on the historical usage data, wherein the application scenario is used to indicate at least one of the following data modes of the diagnostic device: a data display mode, a data transmission mode, and a data processing mode; The target format information is determined according to the application scenario and a preset first mapping relationship, wherein the first mapping relationship is used to reflect the corresponding relationship between the application scenario and the target format information.

5. The method according to claim 3, wherein Determining the target format information includes: Acquire historical data item information of the target data item; Predicting a data item character type and a data item character quantity of the target data item based on the historical data item information, wherein the data item character type includes at least one of the following: a numeric type, a text type, and a language type; Determining at least one character occupancy ratio based on the character type and the number of characters in the data item; The target format information is determined according to the at least one character occupancy ratio and a preset second mapping relationship, wherein the second mapping relationship is used to reflect the corresponding relationship between the at least one character occupancy ratio and the target format information.

6. The method according to claim 3, wherein Determining the target format information includes: Obtaining the remaining storage space of the electronic control unit; Obtaining a candidate format information corresponding to the electronic control unit; Predict the byte space occupied by each candidate format information and obtain a byte space occupied; The target format information is determined from the a pieces of candidate format information according to the remaining storage space and the a bytes of occupied space.

7. The method according to claim 1, wherein After sending the diagnostic request message to the electronic control unit, the method further includes: receiving a diagnostic verification message from the electronic control unit, wherein the diagnostic verification message is used to instruct verification of the diagnostic response message, the diagnostic verification message including a target verification item, the target verification item being format information in the target style sheet that has no mapping relationship with the preset style sheet; determining a first format of vehicle data corresponding to the target check item in the diagnostic response message; Determining a second format corresponding to the target check item in the diagnosis request message; According to the second format and the first format, the vehicle data corresponding to the target verification item in the diagnosis response message is format-converted to obtain a verified diagnosis response message.

8. A vehicle diagnostic device, characterized in that: Applied to diagnostic equipment, the device comprises a sending unit, a receiving unit and a processing unit; The sending unit is configured to send a diagnostic request message to the electronic control unit, wherein the diagnostic request message includes a target style sheet, the target style sheet includes a target data item and target format information, the target data item is used to indicate the type of vehicle data to be obtained, and the target format information is used to indicate a reply format of the target data item; The receiving unit is configured to receive a diagnostic response message from the electronic control unit, wherein the diagnostic response message includes target vehicle data, the target vehicle data being obtained by the electronic control unit by converting initial vehicle data according to the reply format, the initial vehicle data being vehicle data corresponding to the vehicle data type; The processing unit parses the diagnostic response message to obtain the target vehicle data; The electronic control unit is diagnosed according to the target vehicle data.

9. An electronic device, characterized in that: include: A processor and a memory, the processor being connected to the memory, the memory being used to store a computer program, and the processor being used to execute the computer program stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Vehicle diagnosis method, device and system

    CN114995353A

  • Vehicle remote diagnosis system and method

    CN116112514A

  • Vehicle remote detection method and device, readable storage medium and vehicle

    CN117253300A

  • Automobile diagnosis method and device, medium and equipment

    CN118259642A

  • Vehicle diagnosis method, vehicle diagnosis server and storage medium

    CN119493412A

Cited By

  • Adaptive aggregation and transmission methods, systems, devices, media, and products for vehicle diagnostic data

    CN122420388A