Vehicle message processing method and device, equipment, storage medium and program product

By parsing and converting DOIP protocol diagnostic messages into DOCAN protocol diagnostic messages through vehicle gateway devices, the problem of low conversion efficiency of DOIP protocol is solved, compatibility and interoperability of different communication protocols are achieved, and vehicle diagnostic efficiency and flexibility are improved.

CN118890408AInactive Publication Date: 2024-11-01CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD

Patent Information

Application Number
CN202411167962.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-11-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing technology, the conversion of diagnostic requests from the DOIP protocol to the traditional DOCAN protocol is inefficient, resulting in low efficiency in vehicle diagnostic communication.

Method used

The vehicle gateway device receives diagnostic messages in the DOIP protocol, parses and processes them to construct diagnostic messages in the DOCAN protocol, and sends them to the vehicle diagnostic unit through the CAN network, thereby achieving compatibility and interoperability between different communication protocols.

Benefits of technology

It improves the efficiency of vehicle diagnostics and the flexibility of diagnostic message usage protocols, supports the acquisition of diagnostic messages through high-speed Ethernet networks, simplifies the diagnostic process, and reduces system upgrade costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118890408A_ABST
    Figure CN118890408A_ABST
Patent Text Reader

Abstract

The invention relates to a vehicle message processing method, device and equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: in response to a diagnosis request, receiving a first diagnosis message associated with the diagnosis request; the first diagnosis message corresponds to a first network protocol; analyzing the first diagnosis message to obtain first diagnosis information corresponding to the first diagnosis message, and constructing a second diagnosis message by using the first diagnosis information; the second diagnosis message corresponds to a second network protocol, and the second network protocol is different from the first network protocol; and sending the second diagnosis message to the vehicle diagnosis unit through the CAN network. By adopting the method, compatibility and interoperability among different communication protocols can be realized, and the efficiency of vehicle diagnosis and the flexibility of a diagnosis message using protocol are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automotive electronic technology, and in particular to a vehicle message processing method, device, vehicle-mounted equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the development of automotive electronic technology, the role of on-board diagnostic systems in vehicle fault detection and maintenance is becoming increasingly important. The Unified Diagnostic Services (UDS) protocol is a standard protocol for modern vehicle diagnosis. It usually communicates through the Controller Area Network (CAN), that is, DOCAN for diagnostic operations. However, with the rise of Internet of Vehicles technology, vehicle diagnosis over the Internet (DOP, Diagnostic Communication over Internet Protocol) has gradually become a concept. The DOIP protocol is a protocol for automotive diagnostic communications, which allows diagnosis over IP networks (such as Ethernet). However, the current method of converting DOIP protocol diagnostic requests into traditional DOCAN protocol diagnostic requests has the problem of low conversion efficiency. Summary of the invention

[0003] Based on this, it is necessary to provide a vehicle message processing method, device, vehicle-mounted equipment, computer-readable storage medium and computer program product that can improve conversion efficiency in response to the above technical problems.

[0004] In a first aspect, the present application provides a vehicle message processing method, comprising:

[0005] In response to a diagnostic request, receiving a first diagnostic message associated with the diagnostic request; the first diagnostic message corresponds to a first network protocol;

[0006] Parsing the first diagnostic message to obtain first diagnostic information corresponding to the first diagnostic message, and constructing a second diagnostic message using the first diagnostic information; the second diagnostic message corresponds to a second network protocol, and the second network protocol is different from the first network protocol;

[0007] The second diagnostic message is sent to the vehicle diagnostic unit via the CAN network.

[0008] In one embodiment, the parsing of the first diagnostic message to obtain first diagnostic information corresponding to the first diagnostic message includes:

[0009] Parsing the first diagnostic message to obtain a diagnostic service identifier and diagnostic parameters;

[0010] Performing parameter analysis on the diagnostic service identifier and the diagnostic parameter to obtain service information and sub-function information corresponding to the first diagnostic message;

[0011] The diagnostic service identifier, the service information, and the sub-function information are determined as first diagnostic information corresponding to the first diagnostic message.

[0012] In one embodiment, the step of constructing a second diagnostic message using the first diagnostic information includes:

[0013] Identify the protocol type of the second network protocol, and obtain structural requirement information corresponding to the second diagnostic message and a mapping strategy corresponding to the second network protocol according to the protocol type;

[0014] According to the mapping strategy, mapping the first diagnostic information to obtain second diagnostic information;

[0015] constructing at least one message frame according to the structural requirement information and the second diagnostic information;

[0016] Fill the second diagnostic information into the message frame to obtain the second diagnostic message.

[0017] In one of the embodiments, the structural requirement information includes a frame format and a data length threshold of the message frame;

[0018] The constructing at least one message frame according to the structural requirement information and the second diagnostic information includes:

[0019] When the data length of the second diagnostic information is less than or equal to the data length threshold, constructing a message frame according to the frame format;

[0020] The step of filling the second diagnostic information into the message frame to obtain the second diagnostic message includes:

[0021] The second diagnostic information and the control bit information corresponding to the second diagnostic information are filled into the message frame, and the filled message frame is determined as a second diagnostic message; the control bit information includes a complete message identifier and a data length of the second diagnostic information.

[0022] In one of the embodiments, the structural requirement information includes a frame format and a data length threshold of the message frame; the second diagnostic message includes an initial second diagnostic message;

[0023] The constructing at least one message frame according to the structural requirement information and the second diagnostic information includes:

[0024] When the data length of the second diagnostic information is greater than the data length threshold, constructing an initial message frame according to the frame format;

[0025] The step of filling the second diagnostic information into the message frame to obtain the second diagnostic message includes:

[0026] The initial part of the second diagnostic information and the first control bit information are filled into the initial message frame to obtain the initial second diagnostic message; the first control bit information includes a first frame identifier and a data length of the second diagnostic information.

[0027] In one of the embodiments, the second diagnostic message further includes remaining second diagnostic messages other than the initial second diagnostic message;

[0028] After sending the initial second diagnostic message to the vehicle diagnostic unit via the CAN network, the method further includes:

[0029] receiving a response message returned by the vehicle diagnostic unit based on the initial second diagnostic message; the response message includes data receiving capability information of the vehicle diagnostic unit;

[0030] Obtaining the number of remaining message frames to be constructed according to the data length of the second diagnostic information and the data length threshold;

[0031] According to the number of remaining message frames to be constructed, constructing a number of remaining message frames matching the number of remaining message frames according to the frame format;

[0032] Filling the remaining part of the second diagnostic information and the second control bit information into the remaining message frame to obtain the remaining second diagnostic message; the second control bit information includes a continuous frame identifier and a sequence number corresponding to the order of the remaining part in the second diagnostic information, and the sequence number is used to indicate the order in which the vehicle diagnostic unit identifies each of the remaining second diagnostic messages;

[0033] According to the data receiving capability information, the remaining second diagnostic messages are sent to the vehicle diagnostic unit via the CAN network.

[0034] In one embodiment, sending the second diagnostic message to the vehicle diagnostic unit via the CAN network includes:

[0035] Determining, according to a preset message priority, a sending priority of a second diagnosis message corresponding to a plurality of diagnosis requests;

[0036] According to the sending priority, the second diagnostic message is sent to the vehicle diagnostic unit through the CAN network.

[0037] In one of the embodiments, the vehicle message processing method is applied to a vehicle gateway device, the vehicle gateway device includes a data cache unit, the data cache unit is used to store historical diagnostic requests and historical response data of vehicle diagnostic units corresponding to the historical diagnostic requests;

[0038] The vehicle message processing method further includes:

[0039] In response to a diagnosis request, if there is a historical diagnosis request matching the diagnosis request in the data cache unit, historical response data corresponding to the matching historical diagnosis request is obtained, and the historical response data is determined as response data to the diagnosis request.

[0040] In a second aspect, the present application also provides a vehicle message processing device, comprising:

[0041] A message receiving module, configured to receive, in response to a diagnostic request, a first diagnostic message associated with the diagnostic request; the first diagnostic message corresponds to a first network protocol;

[0042] a message parsing and constructing module, used to parse the first diagnostic message to obtain first diagnostic information corresponding to the first diagnostic message, and construct a second diagnostic message using the first diagnostic information; the second diagnostic message corresponds to a second network protocol, and the second network protocol is different from the first network protocol;

[0043] The message sending module is used to send the second diagnostic message to the vehicle diagnostic unit through the CAN network.

[0044] In a third aspect, the present application further provides a vehicle-mounted device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described in the first aspect when executing the computer program.

[0045] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in the first aspect.

[0046] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which implements the steps of the method described in the first aspect when executed by a processor.

[0047] The above-mentioned vehicle message processing method, device, vehicle-mounted device, computer-readable storage medium and computer program product, in response to a diagnostic request through a vehicle gateway device, receives a first diagnostic message associated with the diagnostic request; the first diagnostic message corresponds to a first network protocol; the first diagnostic message is parsed and processed to obtain first diagnostic information corresponding to the first diagnostic message, and a second diagnostic message is constructed using the first diagnostic information; the second diagnostic message corresponds to a second network protocol, and the second network protocol is different from the first network protocol; the second diagnostic message is sent to the vehicle diagnostic unit through the CAN network. In this application, the first diagnostic message received from the OBD diagnostic instrument is parsed and processed by the vehicle gateway device, and the second diagnostic message is constructed by the first diagnostic information obtained by the parsing process, and then the second diagnostic message is sent to the vehicle diagnostic unit through the CAN network, so that the first diagnostic message corresponding to the first network protocol can be converted to the second diagnostic message corresponding to the second network protocol, thereby achieving compatibility and interoperability between different communication protocols, and can be applied to a variety of vehicle diagnostic scenarios. Through the above-mentioned message conversion process, it supports obtaining diagnostic messages from the OBD diagnostic instrument through a high-speed network such as Ethernet, which improves the efficiency of vehicle diagnosis and the flexibility of the diagnostic message use protocol. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 An application environment diagram of a vehicle message processing method in an embodiment;

[0050] Figure 2 A schematic diagram of a process flow of a vehicle message processing method in one embodiment;

[0051] Figure 3 A schematic diagram of a process of parsing a first diagnostic message to obtain first diagnostic information corresponding to the first diagnostic message in an embodiment;

[0052] Figure 4 A schematic diagram of a process of constructing a second diagnostic message using the first diagnostic information in an embodiment;

[0053] Figure 5 A schematic diagram of the composition of a message processing system in another embodiment;

[0054] Figure 6A schematic diagram of the timing of multi-frame message processing and sending in another embodiment;

[0055] Figure 7 is a structural block diagram of a vehicle message processing device in one embodiment;

[0056] Figure 8 FIG. 4 is a diagram showing the internal structure of a vehicle-mounted device in one embodiment. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0058] The vehicle message processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the OBD diagnostic instrument 102 communicates with the vehicle gateway device 104 through an IP network (such as Ethernet), and the vehicle 100 includes the vehicle gateway device 104 and the vehicle diagnostic unit 106. The vehicle gateway device 104 communicates with the vehicle diagnostic unit 106 through the network inside the vehicle. In response to the diagnostic request, the vehicle gateway device 104 receives a first diagnostic message associated with the diagnostic request from the OBD diagnostic instrument 102 through Ethernet; the first diagnostic message corresponds to the first network protocol; the vehicle gateway device 104 parses and processes the first diagnostic message to obtain the first diagnostic information corresponding to the first diagnostic message, and constructs a second diagnostic message using the first diagnostic information; the second diagnostic message corresponds to the second network protocol, and the second network protocol is different from the first network protocol; the vehicle gateway device 104 sends the second diagnostic message to the vehicle diagnostic unit 106 through the CAN network.

[0059] In an exemplary embodiment, Figure 2 As shown, a vehicle message processing method is provided, and the method is applied to Figure 1 The vehicle gateway device in the example is used as an example to illustrate, including the following steps S202 to S206. Among them:

[0060] Step S202: In response to the diagnosis request, receiving a first diagnosis message associated with the diagnosis request.

[0061] Among them, the diagnostic request can be a request triggered when the user needs to send a diagnostic message to the vehicle gateway device through the OBD diagnostic instrument; the OBD (On-Board Diagnostics) diagnostic instrument can be an electronic device used to detect and diagnose faults and problems of automobile-related systems, which can be connected to the vehicle through Ethernet for communication; the first diagnostic message corresponds to the first network protocol, the first diagnostic message can contain diagnostic information, and the first network protocol can be a network protocol suitable for high-speed data transmission environment to improve the efficiency of diagnostic communication. Specifically, the first network protocol can be the DOIP (Diagnostic Communication over Internet Protocol) protocol, which is a protocol specifically used for diagnostic communication in automobile diagnostic systems. It allows remote diagnostic equipment to be connected to the diagnostic system on the vehicle through Ethernet to achieve remote diagnosis and programming functions; DOIP can be used as a transport layer protocol for transmitting diagnostic data based on the UDS protocol on the network, thereby achieving remote diagnosis and programming functions, and the UDS (Unified Diagnostic Services) unified diagnostic service protocol is used for communication and exchange of diagnostic data in automobile diagnostic systems. It defines diagnostic services and protocol specifications to support vehicle diagnosis and communication. The first diagnostic message can be a message obtained by combining the UDS protocol and the DOIP protocol, which contains diagnostic information and related commands, and is transmitted and processed in the vehicle network. That is to say, the first diagnostic message can be sent from the OBD diagnostic instrument to the vehicle gateway device via Ethernet, and then converted into a message format suitable for transmission to the vehicle diagnostic unit in the vehicle gateway device.

[0062] Exemplarily, the first network protocol is the DOIP protocol. When the user needs to diagnose one or more units in the vehicle system, the user can operate the OBD diagnostic instrument to initiate a diagnostic request to the vehicle gateway device through Ethernet and send a first diagnostic message in the DOIP protocol format associated with the diagnostic request. The vehicle gateway device responds to the diagnostic request and receives the first diagnostic message in the DOIP protocol format.

[0063] Step S204: parse the first diagnostic message to obtain first diagnostic information corresponding to the first diagnostic message, and construct a second diagnostic message using the first diagnostic information.

[0064] The second diagnostic message corresponds to a second network protocol, which is different from the first network protocol; specifically, the second network protocol may be a DOCAN protocol, which is a diagnostic protocol based on the UDS (Unified Diagnostic Services) unified diagnostic service protocol and the CAN (Controller Area Network) bus, and uses the UDS protocol to perform diagnostic communication through the CAN network inside the vehicle. The DOCAN protocol is usually used for communication between diagnostic devices inside the vehicle, while the DOIP protocol is usually used for communication between the vehicle and external remote diagnostic devices. Both the DOIP protocol and the DOCAN protocol can be used in conjunction with the UDS protocol to achieve complete vehicle diagnostic functions. Therefore, when a diagnostic message in the DOIP protocol format is received, it is necessary to convert it to a diagnostic message in the DOCAN protocol format that can be communicated on the vehicle's internal network; in some cases, there may also be communication based on the DOIP protocol inside the vehicle, that is, the diagnostic message in the DOIP protocol format can sometimes be communicated on the vehicle's internal network without format conversion. Parsing processing may be an operation for extracting diagnostic information from the first diagnostic message. The first diagnostic information may refer to diagnostic data extracted from the first diagnostic message. The second diagnostic message may be a message obtained by combining the DOCAN protocol and the UDS protocol, which includes diagnostic information and related commands and may be sent to the vehicle diagnostic unit via the CAN network.

[0065] Exemplarily, the second network protocol is the DOCAN protocol, and the vehicle gateway device parses and processes the first diagnostic message in the DOIP protocol format to obtain first diagnostic information based on the UDS protocol of the first diagnostic message, and the first diagnostic information may include diagnostic data under the UDS protocol, and then constructs a second diagnostic message in the DOCAN protocol format based on the second network protocol DOCAN protocol using the diagnostic data under the UDS protocol.

[0066] Step S206: Send the second diagnostic message to the vehicle diagnostic unit via the CAN network.

[0067] The vehicle diagnostic unit may refer to an electronic control unit (ECU) on the vehicle, which is used to control and manage various systems and functions of the vehicle, and can return corresponding diagnostic data after receiving a diagnostic message, such as an engine management system, a brake system, an automatic transmission control system, an airbag control system, a body electronic system (such as windows, door locks, air conditioning, etc.) and other driver assistance systems. In this embodiment, the vehicle diagnostic unit may be an electronic control unit such as an engine control unit, a brake control unit, a battery control unit, etc. on the vehicle that uses CAN bus communication.

[0068] Afterwards, the vehicle gateway device may send the second diagnostic message in the DOCAN protocol format to the vehicle diagnostic unit via the CAN network connected to the vehicle diagnostic unit.

[0069] In the above vehicle message processing method, a vehicle gateway device responds to a diagnostic request and receives a first diagnostic message associated with the diagnostic request; the first diagnostic message corresponds to a first network protocol; the first diagnostic message is parsed and processed to obtain first diagnostic information corresponding to the first diagnostic message, and a second diagnostic message is constructed using the first diagnostic information; the second diagnostic message corresponds to a second network protocol, and the second network protocol is different from the first network protocol; the second diagnostic message is sent to the vehicle diagnostic unit via the CAN network. In the present application, the first diagnostic message received from the OBD diagnostic instrument is parsed and processed by the vehicle gateway device, and the second diagnostic message is constructed by the first diagnostic information obtained by the parsing process, and then the second diagnostic message is sent to the vehicle diagnostic unit via the CAN network. The first diagnostic message corresponding to the first network protocol can be converted to the second diagnostic message corresponding to the second network protocol, thereby achieving compatibility and interoperability between different communication protocols, and can be applied to a variety of vehicle diagnostic scenarios. Through the above message conversion process, it supports obtaining diagnostic messages from the OBD diagnostic instrument through a high-speed network such as Ethernet, which improves the efficiency of vehicle diagnosis and the flexibility of the diagnostic message use protocol.

[0070] In an exemplary embodiment, Figure 3 As shown, in the above step S204, parsing the first diagnostic message to obtain the first diagnostic information corresponding to the first diagnostic message may further include:

[0071] Step S302: parse the first diagnosis message to obtain a diagnosis service identifier and diagnosis parameters.

[0072] Step S304: perform parameter analysis on the diagnostic service identifier and the diagnostic parameters to obtain service information and sub-function information corresponding to the first diagnostic message.

[0073] Step S306: determine the diagnostic service identifier, service information, and sub-function information as first diagnostic information corresponding to the first diagnostic message.

[0074] Among them, the diagnostic service identifier may refer to a unique identifier used to identify different diagnostic services in diagnostic communications. Each diagnostic service has a specific identifier for distinguishing different diagnostic functions or requests. Through the diagnostic service identifier, the vehicle diagnostic unit can identify and perform corresponding diagnostic operations, such as reading fault codes, performing specific tests, and the like. The diagnostic parameter may refer to a specific value, information, or instruction transmitted in the first diagnostic message, which is used to describe, control, or perform a specific diagnostic operation. The diagnostic parameter may include the requested data type, value range, format, etc., which can help the diagnostic unit correctly parse and perform related diagnostic tasks. The service information may refer to the diagnostic function or operation requested in the first diagnostic message, such as services such as reading fault codes, performing specific tests, or accessing specific controllers. The sub-function information may refer to additional functions or options related to the main service function. In the diagnostic operation, the sub-function corresponding to the sub-function information may provide more customized options or guidance to ensure the accuracy and completeness of the diagnostic task. For example, in the engine control diagnosis scenario, the first diagnostic message may include a diagnostic service identifier, which may include identifiers such as reading the engine status, reading the fault code, and sending diagnostic instructions; the service information may be a service for reading the engine status and reading the fault code of the engine control system, and the sub-functions may include specifying the range of specific parameters or data to be read, executing specific diagnostic operation steps, etc. For example, for the service for reading the fault code of the engine control system, the sub-functions may include clearing the fault code, viewing the detailed fault description, executing specific diagnostic tests, and other functions.

[0075] Exemplarily, the vehicle gateway device parses the first diagnostic message, extracts the diagnostic service identifier and diagnostic parameters therein, then performs parameter analysis based on the extracted diagnostic service identifier and diagnostic parameters, determines the service information and sub-function information corresponding to the first diagnostic message based on different diagnostic service identifiers and diagnostic parameters, and determines the diagnostic service identifier, service information and sub-function information as the first diagnostic information corresponding to the first diagnostic message.

[0076] In this embodiment, the first diagnostic message is parsed to obtain a diagnostic service identifier and diagnostic parameters, and parameter analysis is performed on the diagnostic service identifier and diagnostic parameters to obtain service information and sub-function information corresponding to the first diagnostic message. Thus, the first diagnostic information corresponding to the first diagnostic message is accurately determined through the diagnostic service identifier, diagnostic parameters, service information and sub-function information, thereby improving the data reliability of the subsequent message conversion process.

[0077] In an exemplary embodiment, Figure 4 As shown, in the above step S204, constructing the second diagnostic message using the first diagnostic information includes:

[0078] Step S402: Identify the protocol type of the second network protocol, and obtain structural requirement information corresponding to the second diagnostic message and a mapping strategy corresponding to the second network protocol according to the protocol type.

[0079] Step S404: Map the first diagnostic information according to the mapping strategy to obtain second diagnostic information.

[0080] Step S406: construct at least one message frame according to the structure requirement information and the second diagnostic information.

[0081] Step S408: Fill the second diagnostic information into the message frame to obtain a second diagnostic message.

[0082] The protocol type of the second network protocol may refer to the type of the vehicle's CAN network protocol, such as CANCAN2.0B or CAN FD protocols; different CAN network protocols have different structural requirements for messages, wherein the structural requirements include information such as standard data frame formats and data length thresholds, and the mapping strategy may refer to a method for guiding how to convert the data of the first diagnostic information into the data of the second diagnostic information to meet the requirements of the second network protocol. For example, when converting from the first diagnostic information to the second diagnostic information, it may be necessary to convert information such as the data format, encoding method, or field name.

[0083] Exemplarily, the vehicle network management device first identifies the second network protocol, identifies the protocol type of the second network protocol, and then determines the structural requirement information required for the second diagnostic message corresponding to the second network protocol based on the identified protocol type, and determines the mapping strategy corresponding to the data converted from the first network protocol to the second network protocol based on the identified protocol type, and then maps the first diagnostic information according to the mapping strategy, and determines the information mapped from the first diagnostic information as the second diagnostic information. Then, a message frame is constructed according to the structural requirement information, and the second diagnostic information is compared with the structural requirement information to determine whether to construct one or more message frames, and then the second diagnostic information is filled into the constructed message frame, and the filled message frame is determined as the second diagnostic message.

[0084] In this embodiment, the mapping of diagnostic information and the construction of message frames are realized by identifying the network protocol type, and then the second diagnostic message is obtained by filling the constructed message frame with the mapped diagnostic information, which ensures that the diagnostic information can adapt to a variety of different network environments and protocol requirements, enhances the interoperability and scalability of the vehicle diagnostic system, and not only improves the efficiency and accuracy of vehicle diagnosis, but also enhances the flexibility, security and resource utilization efficiency of the system. When a new network protocol needs to be replaced or added, only the corresponding mapping strategy and structural requirement information need to be updated, without the need to modify the existing diagnostic information processing logic on a large scale, reducing the complexity and cost of system maintenance and upgrades.

[0085] In an exemplary embodiment, the structural requirement information includes a frame format and a data length threshold of a message frame; at least one message frame is constructed based on the structural requirement information and the second diagnostic information, including: when the data length of the second diagnostic information is less than or equal to the data length threshold, a message frame is constructed according to the frame format.

[0086] Filling the second diagnostic information into the message frame to obtain the second diagnostic message includes: filling the second diagnostic information and control bit information corresponding to the second diagnostic information into the message frame, and determining the filled message frame as the second diagnostic message.

[0087] Among them, the control bit information includes a complete message identifier and the data length of the second diagnostic information. The complete message identifier may mean that the second diagnostic message is a single-frame message, which may indicate a complete and independent data frame. The data length of the second diagnostic information may refer to the byte length of the diagnostic data contained in the second diagnostic message. The structural requirement information includes the frame format and data length threshold of the message frame. The frame format may refer to the organizational structure of the message frame corresponding to the protocol type of the second network protocol, that is, the layout and content requirements of the various parts that constitute the message, such as the frame structure of protocols such as CAN 2.0B or CAN FD; the data length threshold may refer to the maximum allowed length of the data field in the message frame according to the second network protocol type, for example, the data length limit of the standard CAN frame is 8 bytes, and the data length limit of the CAN FD frame can reach 64 bytes.

[0088] For example, the structure requires information including the frame format and data length threshold a of the message frame. The data length of the second diagnostic information is length A. The vehicle gateway device compares length A with length threshold a. The comparison result is that length A is less than or equal to length threshold a. Therefore, a message frame B is constructed according to the frame format, and the second diagnostic information is filled into message frame B. The complete message identifier and the data length of the second diagnostic information are filled into message frame B as control bit information, and the filled message frame B is determined as the second diagnostic message.

[0089] In this embodiment, based on the structural requirement information of the second network protocol, it is checked whether the data length of the second diagnostic information meets the data length threshold, and if it meets the requirements, a message frame is constructed according to the frame format, and the second diagnostic information and its control bit information are filled in to form a complete second diagnostic message. The above message conversion process ensures the correctness and integrity of the second diagnostic message.

[0090] In an exemplary embodiment, the structural requirement information includes a frame format and a data length threshold of a message frame; the second diagnostic message includes an initial second diagnostic message; and at least one message frame is constructed according to the structural requirement information and the second diagnostic information, including: when the data length of the second diagnostic information is greater than the data length threshold, an initial message frame is constructed according to the frame format.

[0091] Filling the second diagnostic information into the message frame to obtain the second diagnostic message includes: filling the initial part of the second diagnostic information and the first control bit information into the initial message frame to obtain the initial second diagnostic message.

[0092] Among them, the first control bit information includes the first frame identifier and the data length of the second diagnostic information. When the total data length of the second diagnostic information exceeds the data length threshold, it needs to be divided into multiple parts for subsequent transmission. The initial part of the second diagnostic information can refer to the first segment of the second diagnostic information, that is, the front part of the diagnostic information, the part of the diagnostic information whose length does not exceed the data length threshold. The initial message frame can refer to the first message frame constructed according to the frame format when the second diagnostic information needs to be divided. The initial second diagnostic message can refer to the initial message frame containing the initial part of the second diagnostic information and the first control bit information.

[0093] Exemplarily, the structural requirement information includes the frame format and data length threshold a of the message frame; the second diagnostic message C includes an initial second diagnostic message c1, the data length of the second diagnostic information is length D, and the vehicle gateway device compares the length D with the length threshold a. The comparison result is that the length D is greater than the length threshold a, so an initial message frame is constructed according to the frame format, and the initial part of the second diagnostic information and the first control bit information containing the first frame identifier and the data length of the second diagnostic information are filled into the initial message frame, and the filled initial message frame is determined as the initial second diagnostic message.

[0094] In this embodiment, according to the structural requirement information of the second network protocol, it is checked whether the data length of the second diagnostic information meets the data length threshold, and when the data length of the second diagnostic information exceeds the data length threshold, an initial message frame is constructed according to the frame format, and the initial part of the second diagnostic information and the first control bit information are filled in to form an initial second diagnostic message. The first control bit information includes a first frame identifier and the data length of the second diagnostic information. The initial second diagnostic message obtained by the above message conversion process can be characterized as a first frame message and carries the total data length information of the second diagnostic information. This message is marked as a first frame message as the first step of the segmented transmission of the second diagnostic information, which means that it is the beginning of the entire data transmission process. The vehicle diagnostic unit can accurately identify and reorganize the segmented information according to the first frame identifier and the total data length information, and finally obtain a complete second diagnostic message.

[0095] In an exemplary embodiment, the second diagnostic message also includes the remaining second diagnostic messages other than the initial second diagnostic message; after sending the initial second diagnostic message to the vehicle diagnostic unit via the CAN network, it also includes: receiving a response message returned by the vehicle diagnostic unit based on the initial second diagnostic message; the response message includes data receiving capability information of the vehicle diagnostic unit; obtaining the number of remaining message frames to be constructed according to the data length of the second diagnostic information and the data length threshold; constructing the remaining message frames matching the number of remaining message frames according to the frame format according to the number of remaining message frames to be constructed; filling the remaining part of the second diagnostic information and the second control bit information into the remaining message frame to obtain the remaining second diagnostic message; the second control bit information includes a continuous frame identifier and a serial number corresponding to the order of the remaining part in the second diagnostic information, the serial number being used to indicate the order in which the vehicle diagnostic unit identifies the remaining second diagnostic messages; sending the remaining second diagnostic messages to the vehicle diagnostic unit via the CAN network according to the data receiving capability information.

[0096] Among them, the remaining part of the second diagnostic information may refer to other parts of the second diagnostic information except for the information filled into the initial message frame. The response message contains the data receiving capability information of the vehicle diagnostic unit. The receiving capability information may be used to inform the sender of the speed and size at which data can be sent in the future. Specifically, the receiving capability information may be used to indicate how many remaining second diagnostic messages the vehicle gateway device can send at one time after sending the initial second diagnostic message. Based on the total data length and data length threshold of the second diagnostic information, the vehicle gateway device can calculate how many remaining message frames need to be constructed in addition to the initial message frame to transmit the remaining data. The continuous frame identifier is used to indicate that the remaining second diagnostic message containing the continuous frame identifier is a continuous part of the segmented transmission data. The sequence number may be determined according to the field order of the remaining part of the information in each remaining message frame in the second diagnostic information. For example, the remaining part of the second diagnostic information includes A+B+C+D information connected in sequence, which respectively fills the remaining message frames A, B, C, and D. Therefore, the sequence number of the remaining message frame A ranks first among the remaining message frames A, B, C, and D, and the sequence numbers of the remaining message frames B, C, and D are obtained by adding 1 to the sequence number of the remaining message frame A.

[0097] Exemplarily, the second diagnostic message also includes the remaining second diagnostic messages other than the initial second diagnostic message; for example, the second diagnostic message includes the initial diagnostic message and M remaining second diagnostic messages, the initial diagnostic message and the M remaining second diagnostic messages are different from each other and together constitute the second diagnostic message, after the vehicle gateway device sends the initial second diagnostic message to the vehicle diagnostic unit through the CAN network, it receives a response message returned by the vehicle diagnostic unit based on the initial second diagnostic message; the response message contains data receiving capability information of the vehicle diagnostic unit, for example, data can be sent to the vehicle diagnostic unit at a speed of 1 and a size of 2, and the vehicle diagnostic unit can promptly receive and process data sent at a speed of 1 and a size of 2; the vehicle gateway device obtains the number of remaining message frames to be constructed based on the data length of the second diagnostic information and the data length threshold, for example, the total data length of the second diagnostic information is length E, the data length threshold is e, and the vehicle gateway device calculates the data of the remaining part of the second diagnostic information to be transmitted The length is Ee, and by calculating the data length of Ee and e, it is obtained that N remaining message frames of length e are required to transmit the remaining data; the vehicle gateway device constructs the remaining message frames matching the number of remaining message frames according to the frame format according to the number N of remaining message frames to be constructed; that is, N remaining message frames; the vehicle gateway device fills the remaining part of the second diagnostic information, that is, the other part of the second diagnostic information except the initial part, and the second control bit information into the remaining message frame to obtain the remaining second diagnostic message; the second control bit information includes a continuous frame identifier and a serial number corresponding to the order of the remaining part in the second diagnostic information, and the serial number is used to indicate the order of the vehicle diagnostic unit to identify each remaining second diagnostic message; the vehicle gateway device determines the serial number of the remaining part according to the order of the remaining part in the second diagnostic information, and uses the serial number as the serial number of the remaining message frame filled with the remaining part, that is, the order of the remaining part information carried in the remaining message frame in the second diagnostic information can be determined. The vehicle gateway device determines the sending speed and size according to the data receiving capability information, that is, determines how many remaining second diagnostic messages to send at one time, and then sends the determined number of remaining second diagnostic messages to the vehicle diagnostic unit through the CAN network at one time.

[0098] In this embodiment, after sending the initial second diagnostic message, the vehicle gateway device receives a response message from the vehicle diagnostic unit to obtain the data receiving capability information of the vehicle diagnostic unit, and then divides the second diagnostic information according to the data length threshold of a single message frame to determine the required number of remaining message frames, and then constructs a matching number of remaining message frames, and finally fills the remaining part of the second diagnostic information and the sequence information of the remaining part into the remaining message frame to obtain the remaining second diagnostic message, and finally sends the remaining second diagnostic message to the vehicle diagnostic unit through the CAN network according to the data receiving capability of the vehicle diagnostic unit. In this embodiment, the large second diagnostic information is divided and constructed into multiple smaller messages, and sent according to the data receiving capability of the vehicle diagnostic unit, which can avoid CAN network congestion and vehicle diagnostic unit overload caused by sending a large amount of data at one time, thereby improving the transmission efficiency of the diagnostic message.

[0099] In addition, in this embodiment, the process of filling the remaining part of the second diagnostic information and the second control bit information into the remaining message frame can be processed by multiple processing threads of the vehicle gateway device, wherein each thread can independently process the filling process of one or more remaining message frames, thereby processing multiple remaining message frames in parallel, thereby improving the generation efficiency of the remaining second diagnostic messages.

[0100] In an exemplary embodiment, sending a second diagnostic message to a vehicle diagnostic unit via a CAN network includes: determining a sending priority of second diagnostic messages corresponding to multiple diagnostic requests according to a preset message priority; and sending the second diagnostic message to the vehicle diagnostic unit via the CAN network according to the sending priority.

[0101] Among them, the vehicle gateway device can receive multiple first diagnostic messages associated with the diagnostic request in response to the diagnostic request. For example, the diagnostic request is for the engine system, battery system and brake system of the vehicle, that is, the multiple first diagnostic messages associated with the diagnostic request are the first diagnostic message A for the engine system, the first diagnostic message B for the battery system and the first diagnostic message C for the brake system, and finally obtain the corresponding second diagnostic message A, the second diagnostic message B and the second diagnostic message C. The diagnostic priority can be preset according to the importance of the engine system, the battery system and the brake system in the vehicle diagnosis. For example, the brake system is at the first priority, the engine system is at the second priority, and the battery system is at the third priority. Therefore, the second diagnostic message A is sent at the second priority, the second diagnostic message B is sent at the third priority, and the second diagnostic message C is sent at the first priority. According to the above priorities, the messages A, B, and C are sent to the vehicle diagnostic unit through the CAN network. The priorities of the above brake system, engine system and battery system are for example only. The actual priority can be determined according to the importance of the diagnostic object and whether it belongs to the core component of the vehicle, or set according to the actual diagnostic needs.

[0102] In this embodiment, by presetting the message priority, it can be ensured that high-priority diagnostic requests can be processed more quickly, thereby improving the diagnostic response speed and diagnostic efficiency. In addition, in this embodiment, the message sending priority can be dynamically set and adjusted according to different diagnostic scenarios, making the diagnostic process more flexible and controllable, and meeting the needs of different scenarios.

[0103] In an exemplary embodiment, the vehicle gateway device includes a data cache unit, which is used to store historical diagnostic requests and historical response data of the vehicle diagnostic unit corresponding to the historical diagnostic requests. The vehicle message processing method also includes: in response to the diagnostic request, if there is a historical diagnostic request matching the diagnostic request in the data cache unit, obtaining historical response data corresponding to the matching historical diagnostic request, and determining the historical response data as the response data of the diagnostic request.

[0104] Among them, the vehicle gateway device includes a data cache unit, and the vehicle gateway device can save historical diagnostic requests and historical response data of the vehicle diagnostic unit corresponding to the historical diagnostic requests to the vehicle cache unit; the vehicle gateway device responds to the diagnostic request and can match the saved historical diagnostic request in the data cache unit, and when there is a historical diagnostic request that matches the diagnostic request, obtain the historical response data of the vehicle diagnostic unit corresponding to the historical diagnostic request, and determine the historical response data as the response data of the diagnostic request. The data cache unit is used to cache data, and the data therein is time-sensitive, so it can be guaranteed that the response data is time-sensitive and reliable. Specifically, a historical diagnostic request can be associated with multiple first diagnostic messages. After converting the multiple first diagnostic messages, the vehicle gateway device can send them to the vehicle diagnostic unit, and can obtain response data corresponding to the multiple first diagnostic messages. Therefore, the vehicle gateway device can associate each first diagnostic message with the corresponding response data and save it in the data cache unit. In response to a new diagnostic request, the multiple first diagnostic messages associated with the new diagnostic request are matched in the data cache unit, and then when some of the first diagnostic messages are successfully matched, the historical response data corresponding to some of the first diagnostic messages are obtained. The vehicle gateway device only needs to parse and convert other unmatched first diagnostic messages and send them to the vehicle diagnostic unit to obtain response data corresponding to other first diagnostic messages, and finally obtain all response data for the new diagnostic request.

[0105] In this embodiment, when the data cache unit already has historical diagnostic requests and historical response data that match the new diagnostic request, the historical response data can be directly returned without re-executing the diagnostic process, which shortens the response time and makes the diagnostic process faster and more efficient. On the other hand, the number of direct accesses to the vehicle diagnostic unit can be reduced, thereby reducing the load on the vehicle diagnostic unit, extending the life of the vehicle diagnostic unit, and improving the stability of the entire vehicle system.

[0106] In an application example, Figure 5As shown, a DOIP2DOCAN processing system based on the UDS protocol is also provided, and the message processing system can be configured in the vehicle gateway device. The first network protocol is the DOIP network protocol, the second network protocol is the DOCAN protocol, the first diagnostic message is the DOIP message, the second diagnostic message is the DOCAN message, and the vehicle diagnostic unit is the CAN ECU. Among them, the message receiving module is used to receive the diagnostic message from the DOIP network, which includes a data cache unit. The message parsing module is used to parse the received DOIP message and extract the diagnostic information in the message. Specifically, in the engine control diagnosis scenario, the DOIP message usually contains information such as engine status, fault code and diagnostic instructions. After the message receiving module receives the DOIP message, the message parsing module extracts the engine status and fault code in the message, which includes a data identification unit and a data extraction and parameter analysis unit. The message conversion module is used to convert the parsed diagnostic information into the DOCAN message format according to predefined rules, which includes a data structure conversion parallel processing unit and an error detection and correction unit. The message sending module is used to send the converted DOCAN message to the ECU through the CAN network and includes a resource management unit.

[0107] The above four modules correspond to the four stages of the DOIP to DOCAN conversion process (data reception, parsing, conversion, and sending), and each stage is executed in parallel by different threads. For example, one thread is responsible for parsing the data packet, another thread is responsible for the conversion logic, and another thread is responsible for sending the converted data to the CAN network. Such parallel processing improves the efficiency of DOIP to DOCAN conversion, reduces data processing delays, and improves the throughput and responsiveness of the message processing system.

[0108] Specifically, for the message receiving module, the OBD diagnostic instrument calls the DOIP message receiving unit to send the DOIP diagnostic message. The unit includes an Ethernet interface for communicating with the DOIP network. The DOIP message receiving unit calls the data cache unit to store the DOIP diagnostic message and the corresponding ECU response data. This design can improve the response speed on the one hand. For frequent UDS requests, data can be directly obtained from the cache instead of long-term data exchange through the network or ECU each time. This can significantly improve the response speed and efficiency of the system. On the other hand, it can reduce the load on the ECU. By caching UDS requests, the number of direct accesses to the ECU can be reduced, thereby reducing the load on the ECU, extending its life, and improving the stability of the vehicle system.

[0109] For the message parsing module, the data cache unit calls the identification data unit to perform preliminary classification of the received data packets, and checks the flag information to determine whether the data received from the cache is DOIP data. If it is a DOIP information flag, the data extraction and parameter analysis unit is called to first extract the command identifier, extract the identifier of the diagnostic service (such as SID) and related parameters from the data packet, because these are key information to determine how to process the data packet, and then perform parameter analysis to analyze the parameters in the data packet to determine the required services and sub-functions.

[0110] For the message conversion module, the data extraction and parameter analysis unit calls the data structure parallel processing unit to convert the DoIP data packet into a CAN frame, which involves data format conversion, information reorganization, and adaptation processing of the converted data. The following are the specific steps of message conversion:

[0111] (1) Step 1: Receive, analyze and resolve DOIP data packets. Allocate the received DOIP data packets to multiple processing threads. Each thread can independently process the conversion process of one or more data packets, thereby processing multiple data packets in parallel. Parallel processing optimizes the conversion efficiency from DOIP to DOCAN, which can significantly improve data processing speed and system responsiveness.

[0112] (2) Step 2: Determine the target CAN frame structure. First, identify the target CAN protocol: According to the vehicle's CAN network protocol (such as CAN 2.0B or CAN FD), determine the structure requirements of the target CAN frame, including frame format, data length limit, etc. Secondly, map the diagnostic information and determine their corresponding services and parameters on the CAN network according to the diagnostic service identifiers and parameters in the DOIP data packet.

[0113] (3) Step 3: Perform data format conversion. First, adjust the data length. According to the data length limit of the CAN protocol (for example, the standard CAN frame is a maximum of 8 bytes, and the CAN FD frame is longer), it may be necessary to split the payload of the DOIP data packet (i.e., diagnostic information) into multiple CAN frames or perform data compression. Secondly, construct the CAN frame. Use the frame structure of the CAN network to construct one or more CAN frames based on the information obtained in the previous step. This includes setting the frame ID, data field, and any necessary control information. Specifically, if a single frame is sent, that is, the requested data can be sent out at one time, the content of the CAN message data segment is filled according to CANNETWORK_PCI (control bit information) and UDS information (i.e., diagnostic information) to obtain a DOCAN message, where CANNETWORK_PCI (control bit information) represents the first byte of the data field, the high 4 bits are 0000, indicating that this is a SingleFrame frame, and the low 4 bits are SF_DL, i.e., DataLength, which describes how many bytes of diagnostic data are there.

[0114] (4) Step 4: Processing multiple frames, such as Figure 6As shown, the vehicle gateway device interacts with the vehicle diagnostic unit to achieve the sending of the first frame and consecutive frames. If the content of the DOIP data packet needs to be divided into multiple CAN frames for transmission, a mechanism is needed to handle the sending, receiving and reorganization of multi-frame data. First, the sender will send the first frame data to the receiver. The content of the first frame CAN message data segment is filled according to CANNETWORK_PCI (control bit information) and UDS information (ie diagnostic information) to obtain the DOCAN message, where CANNETWORK_PCI (control bit information) represents the first two bytes of the data field. The high 4 bits of the first byte are 0001, indicating that this is a first frame. The low 4 bits plus the second byte are used to describe the total length of the data sent. Secondly, the receiver receives the first frame data. The receiver needs to confirm the received first frame and inform the sender of its receiving capability by sending a flow control frame, and inform the sender At what speed and size can the sender send data afterwards? The response data segment content in the flow control frame is filled by the vehicle diagnostic unit (ECU) with CANNETWORK_PCI (control bit information). CANNETWORK_PCI (control bit information) represents the first three bytes of the data field: the high 4 bits of the first byte are 0011, indicating that this is a flow control frame, the low 4 bits are FS, indicating the control status of the flow, the second byte is BS (BlockSize), indicating the size of the block, and the third byte is STmin (SeperateTime), indicating how many consecutive frames the sender can send at one time. Then the sender will send a stream continuation frame according to the content of the received stream control frame, following the data frame sent by the first frame, to transmit the remaining data. The continuation frame is to carry the remaining data that the first frame cannot fully carry. The content of the data segment of the continuous frame CAN message is filled according to CANNETWORK_PCI (control bit information) and UDS information (i.e. diagnostic information). CANNETWORK_PCI (control bit information) represents the first byte of the data field. The high 4 bits are 0010, indicating that this is a continuous frame. The low 4 bits are used to identify the serial number of the continuous frame, starting from 1, and increase by 1 each time a continuous frame is sent. Finally, after all frames are correctly received, the vehicle diagnostic unit reassembles the received multi-frame data into complete information in the correct order. Among them, during the multi-frame transmission process, the data structure conversion parallel processing unit will call the error detection and correction unit to ensure that in the conversion process, when encountering problems such as frame loss, sequence error or data error, error detection and verification can be carried out in time. If an error is found during data transmission or processing, a retransmission mechanism is implemented to ensure the accuracy and integrity of the data.

[0115] For the message sending module, the resource management unit calls the data structure conversion parallel processing unit to set different priorities for data packets, give priority to key tasks or data packets, ensure that important communication requests can be responded to quickly, and dynamically adjust the number of processing threads according to the current load of the system to adapt to different workloads and avoid overload or resource waste. The DOCAN sending unit calls the resource management unit to store the performance-optimized CAN messages and send them to the CAN ECU through the CAN bus.

[0116] The above-mentioned DOIP2DOCAN processing system based on the UDS protocol realizes the seamless conversion of DOIP messages to DOCAN messages by designing an efficient message conversion mechanism, and improves the compatibility and interoperability between different communication protocols. Through the implementation of the present invention, the vehicle diagnosis process can be significantly simplified, the diagnosis efficiency can be improved, and the system upgrade cost can be reduced. It has broad application prospects in the field of modern automobile diagnosis and communication. Specifically, 1. Improve compatibility: realize the compatibility and interoperability between different communication protocols, and is suitable for a variety of vehicle diagnosis scenarios; 2. Simplify the diagnosis process: through the automated message conversion process, the vehicle diagnosis process is simplified and the diagnosis efficiency is improved; 3. Reduce costs: no large-scale transformation of the existing CAN network is required, which reduces the cost of system upgrades. 4. Parallel processing of data streams: the conversion process from DOIP to DOCAN is decomposed into multiple stages (such as data reception, parsing, conversion, and sending), and each stage is responsible for different processing units to form a processing pipeline. The data packet passes through each stage in turn, and each stage processes different data packets in parallel, thereby improving the overall processing speed. 5. Multi-threaded data processing: the data is processed in parallel during the conversion process, and the received DOIP data packets are assigned to multiple processing threads. Each thread can independently handle the conversion process of one or more data packets, thereby processing multiple data packets in parallel, improving conversion efficiency and stability.

[0117] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0118] Based on the same inventive concept, the embodiment of the present application also provides a vehicle message processing device for implementing the vehicle message processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more vehicle message processing device embodiments provided below can refer to the limitations on the vehicle message processing method above, and will not be repeated here.

[0119] In an exemplary embodiment, Figure 7 As shown, a vehicle message processing device 700 is provided, comprising: a message receiving module 701, a message parsing and constructing module 702 and a message sending module 703, wherein:

[0120] The message receiving module 701 is used to receive a first diagnostic message associated with the diagnostic request in response to the diagnostic request; the first diagnostic message corresponds to a first network protocol;

[0121] The message parsing and constructing module 702 is used to parse the first diagnostic message to obtain the first diagnostic information corresponding to the first diagnostic message, and construct a second diagnostic message using the first diagnostic information; the second diagnostic message corresponds to a second network protocol, and the second network protocol is different from the first network protocol;

[0122] The message sending module 703 is used to send the second diagnosis message to the vehicle diagnosis unit through the CAN network.

[0123] In an exemplary embodiment, the message parsing and construction module 702 is also used to parse the first diagnostic message to obtain a diagnostic service identifier and diagnostic parameters; perform parameter analysis on the diagnostic service identifier and diagnostic parameters to obtain service information and sub-function information corresponding to the first diagnostic message; and determine the diagnostic service identifier, service information and sub-function information as the first diagnostic information corresponding to the first diagnostic message.

[0124] In an exemplary embodiment, the message parsing and construction module 702 is also used to identify the protocol type of the second network protocol, and obtain the structural requirement information corresponding to the second diagnostic message and the mapping strategy corresponding to the second network protocol according to the protocol type; map the first diagnostic information according to the mapping strategy to obtain the second diagnostic information; construct at least one message frame according to the structural requirement information and the second diagnostic information; fill the second diagnostic information into the message frame to obtain the second diagnostic message.

[0125] In an exemplary embodiment, the structural requirement information includes the frame format and data length threshold of the message frame; the above-mentioned message parsing construction module 702 is also used to construct a message frame according to the frame format when the data length of the second diagnostic information is less than or equal to the data length threshold; the above-mentioned message parsing construction module 702 is further used to fill the second diagnostic information and the control bit information corresponding to the second diagnostic information into the message frame, and determine the filled message frame as the second diagnostic message; the control bit information includes a complete message identifier and the data length of the second diagnostic information.

[0126] In an exemplary embodiment, the structural requirement information includes the frame format and data length threshold of the message frame; the second diagnostic message includes an initial second diagnostic message; the above-mentioned message parsing construction module 702 is also used to construct an initial message frame according to the frame format when the data length of the second diagnostic information is greater than the data length threshold; the above-mentioned message parsing construction module 702 is further used to fill the initial part of the second diagnostic information and the first control bit information into the initial message frame to obtain an initial second diagnostic message; the first control bit information includes the first frame identifier and the data length of the second diagnostic information.

[0127] In an exemplary embodiment, the second diagnostic message also includes the remaining second diagnostic messages other than the initial second diagnostic message; the message parsing and construction module 702 is also used to receive a response message returned by the vehicle diagnostic unit based on the initial second diagnostic message; the response message contains the data receiving capability information of the vehicle diagnostic unit; according to the data length of the second diagnostic information and the data length threshold, the number of remaining message frames to be constructed is obtained; according to the number of remaining message frames to be constructed, the number of remaining message frames matching the number of remaining message frames is constructed according to the frame format; the remaining part of the second diagnostic information and the second control bit information are filled into the remaining message frame to obtain the remaining second diagnostic message; the second control bit information contains a continuous frame identifier and a sequence number corresponding to the order of the remaining part in the second diagnostic information, and the sequence number is used to indicate the order in which the vehicle diagnostic unit identifies each remaining second diagnostic message. The message sending module 703 is also used to send the remaining second diagnostic message to the vehicle diagnostic unit through the CAN network according to the data receiving capability information.

[0128] In an exemplary embodiment, the message sending module 703 is also used to determine the sending priority of the second diagnostic message corresponding to multiple diagnostic requests according to a preset message priority; and send the second diagnostic message to the vehicle diagnostic unit through the CAN network according to the sending priority.

[0129] In an exemplary embodiment, the vehicle gateway device includes a data cache unit, which is used to store historical diagnostic requests and historical response data of the vehicle diagnostic unit corresponding to the historical diagnostic requests; the above-mentioned vehicle message processing device 700 also includes a response module, which is used to respond to the diagnostic request, and when there is a historical diagnostic request matching the diagnostic request in the data cache unit, obtain the historical response data corresponding to the matching historical diagnostic request, and determine the historical response data as the response data of the diagnostic request.

[0130] Each module in the above vehicle message processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0131] In an exemplary embodiment, a vehicle-mounted device is provided. The vehicle-mounted device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The vehicle-mounted device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the vehicle-mounted device is used to provide computing and control capabilities. The memory of the vehicle-mounted device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the vehicle-mounted device is used to store relevant data in the message processing process. The input / output interface of the vehicle-mounted device is used to exchange information between the processor and an external device. The communication interface of the vehicle-mounted device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a vehicle message processing method is implemented.

[0132] Those skilled in the art will understand that Figure 8 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the vehicle-mounted equipment to which the scheme of the present application is applied. The specific vehicle-mounted equipment may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0133] In one embodiment, a vehicle-mounted device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0134] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0135] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0136] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0137] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0138] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A vehicle message processing method, It is characterized in that The method comprises: In response to a diagnostic request, receiving a first diagnostic message associated with the diagnostic request; the first diagnostic message corresponds to a first network protocol; Parsing the first diagnostic message to obtain first diagnostic information corresponding to the first diagnostic message, and constructing a second diagnostic message using the first diagnostic information; the second diagnostic message corresponds to a second network protocol, and the second network protocol is different from the first network protocol; The second diagnostic message is sent to the vehicle diagnostic unit via the CAN network.

2. The method according to claim 1, It is characterized in that The parsing and processing the first diagnostic message to obtain first diagnostic information corresponding to the first diagnostic message includes: Parsing the first diagnostic message to obtain a diagnostic service identifier and diagnostic parameters; Performing parameter analysis on the diagnostic service identifier and the diagnostic parameter to obtain service information and sub-function information corresponding to the first diagnostic message; The diagnostic service identifier, the service information, and the sub-function information are determined as first diagnostic information corresponding to the first diagnostic message.

3. The method according to claim 1, It is characterized in that The step of constructing a second diagnostic message by using the first diagnostic information includes: Identify the protocol type of the second network protocol, and obtain structural requirement information corresponding to the second diagnostic message and a mapping strategy corresponding to the second network protocol according to the protocol type; According to the mapping strategy, mapping the first diagnostic information to obtain second diagnostic information; constructing at least one message frame according to the structural requirement information and the second diagnostic information; Fill the second diagnostic information into the message frame to obtain the second diagnostic message.

4. The method according to claim 3, It is characterized in that The structural requirement information includes the frame format and data length threshold of the message frame; The constructing at least one message frame according to the structural requirement information and the second diagnostic information includes: When the data length of the second diagnostic information is less than or equal to the data length threshold, constructing a message frame according to the frame format; The step of filling the second diagnostic information into the message frame to obtain the second diagnostic message includes: The second diagnostic information and the control bit information corresponding to the second diagnostic information are filled into the message frame, and the filled message frame is determined as a second diagnostic message; the control bit information includes a complete message identifier and a data length of the second diagnostic information.

5. The method according to claim 3, It is characterized in that The structural requirement information includes a frame format and a data length threshold of the message frame; the second diagnostic message includes an initial second diagnostic message; The constructing at least one message frame according to the structural requirement information and the second diagnostic information includes: When the data length of the second diagnostic information is greater than the data length threshold, constructing an initial message frame according to the frame format; The step of filling the second diagnostic information into the message frame to obtain the second diagnostic message includes: The initial part of the second diagnostic information and the first control bit information are filled into the initial message frame to obtain the initial second diagnostic message; the first control bit information includes a first frame identifier and a data length of the second diagnostic information.

6. The method according to claim 5, It is characterized in that The second diagnostic message also includes remaining second diagnostic messages except the initial second diagnostic message; After sending the initial second diagnostic message to the vehicle diagnostic unit via the CAN network, the method further includes: receiving a response message returned by the vehicle diagnostic unit based on the initial second diagnostic message; the response message includes data receiving capability information of the vehicle diagnostic unit; Obtaining the number of remaining message frames to be constructed according to the data length of the second diagnostic information and the data length threshold; According to the number of remaining message frames to be constructed, constructing a number of remaining message frames matching the number of remaining message frames according to the frame format; Filling the remaining part of the second diagnostic information and the second control bit information into the remaining message frame to obtain the remaining second diagnostic message; the second control bit information includes a continuous frame identifier and a sequence number corresponding to the order of the remaining part in the second diagnostic information, and the sequence number is used to indicate the order in which the vehicle diagnostic unit identifies each of the remaining second diagnostic messages; According to the data receiving capability information, the remaining second diagnostic messages are sent to the vehicle diagnostic unit via the CAN network.

7. The method according to any one of claims 1 to 6, It is characterized in that The step of sending the second diagnostic message to the vehicle diagnostic unit via the CAN network includes: Determining, according to a preset message priority, a sending priority of a second diagnosis message corresponding to a plurality of diagnosis requests; According to the sending priority, the second diagnostic message is sent to the vehicle diagnostic unit through the CAN network.

8. The method according to any one of claims 1 to 6, It is characterized in that The vehicle message processing method is applied to a vehicle gateway device, the vehicle gateway device includes a data cache unit, the data cache unit is used to store historical diagnostic requests and historical response data of vehicle diagnostic units corresponding to the historical diagnostic requests; The vehicle message processing method further includes: In response to a diagnosis request, if there is a historical diagnosis request matching the diagnosis request in the data cache unit, historical response data corresponding to the matching historical diagnosis request is obtained, and the historical response data is determined as response data to the diagnosis request.

9. A vehicle message processing device, It is characterized in that The device comprises: A message receiving module, configured to receive, in response to a diagnostic request, a first diagnostic message associated with the diagnostic request; the first diagnostic message corresponds to a first network protocol; a message parsing and constructing module, used to parse the first diagnostic message to obtain first diagnostic information corresponding to the first diagnostic message, and construct a second diagnostic message using the first diagnostic information; the second diagnostic message corresponds to a second network protocol, and the second network protocol is different from the first network protocol; The message sending module is used to send the second diagnostic message to the vehicle diagnostic unit through the CAN network.

10. A vehicle-mounted device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Protocol conversion method and device

    CN109669442A

  • Vehicle diagnosis method and device

    CN110661847A

  • Vehicle diagnosis data forwarding method and device and gateway

    CN111901076A

  • Vehicle-mounted diagnostic message protocol conversion control method, device, equipment and medium

    CN115776526A

  • Diagnostic method and device and vehicle

    CN117459546A

Cited By

  • Vehicle Ethernet diagnosis method and system

    CN120652960A

  • Access entrance detection method and device, vehicle, medium and program product

    CN121462221A