A DoIP streaming data parsing method, device, system and electronic equipment

CN122601779APending Publication Date: 2026-08-18WUHAN JIANGXIA CHUNENG AUTOMOBILE TECHNOLOGY R&D CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610853058.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-12
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0004]有鉴于此,有必要提供一种DoIP流式数据解析方法、装置、系统及电子设备,用以解决现有DoIP协议报文解析方法鲁棒性差、且无法适应不具备报文边界的流式数据传输环境的问题

Benefits of technology

[0015] The beneficial effects of the above implementation are as follows: The DoIP streaming data parsing method, apparatus, system, and electronic device provided by this invention do not rely on the prerequisite of complete packet arrival when parsing DoIP protocol packets. Instead, they directly parse the real-time data stream during TCP/IP real-time communication. Furthermore, during parsing, they only need to identify the frame header features of the DoIP protocol and determine the length field to completely extract the existing DoIP protocol packets. They can extract and parse while transmitting in real time, without waiting for the real-time data stream to finish transmitting, significantly improving real-time performance. In addition, the DoIP protocol packet parsing method only focuses on the characteristics of the DoIP protocol packets themselves. On the one hand, by combining length validity checks and integrity checks, it can automatically recover even in the event of packet misalignment, truncation, or noise interference, ensuring the data integrity of the DoIP protocol packets without the need for post-processing, achieving highly robust parsing. On the other hand, the parsing process does not require determining the packet boundaries of the TCP/IP data stream. This avoids data fragmentation or reassembly during TCP communication data transmission and avoids data loss or out-of-order delivery during UDP communication transmission, making it effectively applicable to streaming data transmission environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601779A_ABST
    Figure CN122601779A_ABST
Patent Text Reader

Abstract

The application provides a DoIP streaming data analysis method, device, system and electronic equipment, and relates to the technical field of vehicle-mounted communication. The method comprises the following steps: identifying the frame header characteristics of the DoIP protocol from the real-time data stream of TCP / IP communication, and determining the length field of the DoIP protocol message according to the frame header characteristics; performing length legality verification on the DoIP protocol message based on the length field, and performing integrity verification on the DoIP protocol message when the length legality verification is successful; extracting the DoIP protocol message from the real-time data stream when the integrity verification is successful, and performing field analysis processing on the DoIP protocol message to obtain the service message type corresponding to the DoIP protocol message. The application is used to solve the problems of poor robustness of the existing DoIP protocol message analysis method and the inability to adapt to the streaming data transmission environment without message boundaries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle communication technology, specifically to a DoIP streaming data parsing method, apparatus, system, and electronic device. Background Technology

[0002] With the development of automotive Ethernet technology, Diagnostics over Internet Protocol (DoIP) has gradually become an important implementation method for vehicle diagnostic communication. DoIP protocol usually runs on top of TCP / IP or UDP / IP, enabling diagnostic equipment to communicate with the vehicle's electronic control unit (ECU) via Ethernet in a high-bandwidth manner.

[0003] However, unlike traditional CAN bus, TCP / IP communication is a streaming mechanism, and its data reception process does not have natural message boundaries. Specifically, a single DoIP message may be split into multiple TCP segments, multiple DoIP messages may be merged into the same TCP data receive buffer, and DoIP messages may suffer from data misalignment, truncation, or abnormal insertion. In contrast, UDP communication may experience packet loss, out-of-order delivery, or duplicate data issues. In existing technologies, most DoIP protocol message parsing methods rely on the assumption that the message arrives intact or perform complex packet reassembly through additional buffers. However, these methods cannot handle data misalignment, truncation, or abnormal insertion, exhibiting low robustness and being unsuitable for streaming data transmission environments without message boundaries. Summary of the Invention

[0004] In view of this, it is necessary to provide a DoIP streaming data parsing method, apparatus, system and electronic device to solve the problems of poor robustness of existing DoIP protocol message parsing methods and their inability to adapt to streaming data transmission environments without message boundaries.

[0005] To address the above problems, this invention provides a DoIP streaming data parsing method, comprising: Acquire real-time data streams from TCP / IP communication; Identify the frame header features of the DoIP protocol from the real-time data stream, and determine the length field of the DoIP protocol message based on the frame header features; The length of the DoIP protocol message is validated based on the length field, and the integrity of the DoIP protocol message is validated if the length validation is successful. When the integrity verification is successful, the DoIP protocol message is extracted from the real-time data stream, and the DoIP protocol message is parsed to obtain the business message type corresponding to the DoIP protocol message.

[0006] In one possible implementation, identifying the frame header features of the DoIP protocol from the real-time data stream includes: A preset sliding window is invoked to scan the real-time data stream byte by byte, and the identification field of the DoIP protocol is identified during the scanning process. The identification field includes the version number of the DoIP protocol and the version number's inverse code check field. When the identification field matches the frame header identifier of the DoIP protocol, and the version number and the version number's inverse check field in the identification field satisfy the consistency relationship, it is determined that the frame header feature of the DoIP protocol has been successfully identified.

[0007] In one possible implementation, the length validity check of the DoIP protocol message based on the length field includes: The length field is converted to obtain the message length of the DoIP protocol message; If the message length is less than the maximum length of the data buffer, the length validity check is successful. The data buffer is used to cache the real-time data stream.

[0008] In one possible implementation, the integrity verification of the DoIP protocol message includes: When the DoIP protocol message meets the preset verification conditions, the integrity verification is determined to be successful: When the DoIP protocol message does not meet at least one verification condition, the integrity verification is determined to have failed. The verification conditions include: The DoIP protocol message has a valid identifier field in the frame header; The length of the DoIP protocol message is valid; The data buffer that caches the real-time data stream has a remaining data length that is not less than the length of the DoIP protocol message.

[0009] In one possible implementation, the method further includes: When the length validity check or integrity check fails, the sliding window used to scan the real-time data stream byte by byte to identify the frame header features of the DoIP protocol will be shifted one byte to the right. Re-identify the frame header features of the DoIP protocol from the bytes within the sliding window after the shift; If the frame header feature is not identified, the sliding window is moved one byte further back until the DoIP protocol frame header feature is identified within the sliding window.

[0010] In one possible implementation, the step of parsing the DoIP protocol message to obtain the service message type corresponding to the DoIP protocol message includes: Extract the target field used to indicate the message payload from the DoIP protocol message; The target field is mapped to obtain the service message type corresponding to the DoIP protocol message.

[0011] In one possible implementation, after the field parsing processing of the DoIP protocol message, the method further includes: The sliding window used when scanning the real-time data stream byte by byte to identify DoIP protocol frame header features is moved to the position of the end field of the DoIP protocol message; Starting from the position of the last field, the sliding window is invoked to identify the frame header features of the DoIP protocol in the real-time data stream, so as to parse out other DoIP protocol messages after the DoIP protocol message, until the field in the sliding window is the last field of the real-time data stream.

[0012] The present invention also provides a DoIP streaming data parsing device, comprising: The acquisition module is used to acquire real-time data streams from TCP / IP communication. The identification module is used to identify the frame header features of the DoIP protocol from the real-time data stream, and determine the length field of the DoIP protocol message based on the frame header features; The verification module is used to perform length validity verification on the DoIP protocol message based on the length field, and to perform integrity verification on the DoIP protocol message when the length validity verification is successful. The parsing module extracts the DoIP protocol message from the real-time data stream when the integrity verification is successful, and performs field parsing processing on the DoIP protocol message to obtain the business message type corresponding to the DoIP protocol message.

[0013] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a program; the processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps of the DoIP streaming data parsing method described above.

[0014] The present invention also provides a DoIP streaming data parsing system, including a communication device and the aforementioned electronic device, wherein the communication device and the electronic device communicate via a network link; the communication device is used to collect real-time data streams of TCP / IP communication and store the real-time data streams in the memory of the electronic device; the communication device is also used to output parsed DoIP protocol messages after the processor of the electronic device executes the program stored in the memory.

[0015] The beneficial effects of the above implementation are as follows: The DoIP streaming data parsing method, apparatus, system, and electronic device provided by this invention do not rely on the prerequisite of complete packet arrival when parsing DoIP protocol packets. Instead, they directly parse the real-time data stream during TCP / IP real-time communication. Furthermore, during parsing, they only need to identify the frame header features of the DoIP protocol and determine the length field to completely extract the existing DoIP protocol packets. They can extract and parse while transmitting in real time, without waiting for the real-time data stream to finish transmitting, significantly improving real-time performance. In addition, the DoIP protocol packet parsing method only focuses on the characteristics of the DoIP protocol packets themselves. On the one hand, by combining length validity checks and integrity checks, it can automatically recover even in the event of packet misalignment, truncation, or noise interference, ensuring the data integrity of the DoIP protocol packets without the need for post-processing, achieving highly robust parsing. On the other hand, the parsing process does not require determining the packet boundaries of the TCP / IP data stream. This avoids data fragmentation or reassembly during TCP communication data transmission and avoids data loss or out-of-order delivery during UDP communication transmission, making it effectively applicable to streaming data transmission environments. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating the DoIP streaming data parsing method provided by the present invention. Figure 2 This is a schematic diagram illustrating the principle of the DoIP streaming data parsing and processing process provided by the present invention. Figure 3 This is a schematic diagram of the DoIP streaming data parsing device provided by the present invention; Figure 4 A schematic diagram of an embodiment of the electronic device provided by the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0019] In the description of the embodiments of this application, unless otherwise stated, "a plurality of" means two or more.

[0020] In this embodiment of the invention, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, apparatus, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to such process, method, product or device.

[0021] The naming or numbering of steps in the embodiments of the present invention does not mean that the steps in the method flow must be executed in the time / logical order indicated by the naming or numbering. The execution order of the named or numbered process steps can be changed according to the technical purpose to be achieved, as long as the same or similar technical effect can be achieved.

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

[0023] The DoIP streaming data parsing method provided in this invention can be applied to in-vehicle communication scenarios. The executing entity can be an in-vehicle system or a server, terminal, or remote cloud device communicating with the in-vehicle system network. When the vehicle system performs diagnostic communication via TCP / IP, the DoIP streaming data parsing method provided in this invention is invoked. First, the DoIP protocol message is determined through frame header feature recognition and length field. After length validity and integrity verification, the DoIP protocol message is extracted from the real-time data stream. Then, field parsing processing is performed to obtain the business message type corresponding to the DoIP protocol message, which is then used by the vehicle system's business layer to process the corresponding business.

[0024] The DoIP streaming data parsing method provided by this invention will be described in detail below.

[0025] Figure 1 This is a flowchart illustrating the DoIP streaming data parsing method provided by the present invention, as shown below. Figure 1 As shown, the DoIP streaming data parsing method can be implemented through the following steps 101 to 104, which are explained in detail below.

[0026] Step 101: Obtain the real-time data stream of TCP / IP communication.

[0027] like Figure 2 As shown, the first step is to receive the real-time data stream from TCP / IP communication. Since the DoIP protocol typically runs on top of TCP / IP, during vehicle communication establishment, TCP / IP data communication can be directly monitored and received to obtain the real-time data stream. Then, DoIP protocol messages are extracted one by one from the real-time data stream. TCP / IP communication is divided into two channels: the TCP channel is used for diagnostic communication data transmission, and the UDP channel is used for vehicle detection and status broadcasting. Here, during data stream monitoring, the real-time data stream is received in parallel through both channels and stored in the data buffer, i.e., the TCP receive buffer.

[0028] Step 102: Identify the frame header features of the DoIP protocol from the real-time data stream, and determine the length field of the DoIP protocol message based on the frame header features.

[0029] Here, the extraction of DoIP protocol messages can begin once the first byte of the real-time data stream is stored in the data buffer. The first step in parsing DoIP protocol messages is to identify the frame header features of the DoIP protocol in the real-time data stream to determine the DoIP protocol messages that may exist in the real-time data stream. This determination process can be specifically implemented by identifying the frame header features of the DoIP protocol.

[0030] In one possible implementation, identifying DoIP protocol frame header features from a real-time data stream can be achieved in the following ways, which are explained in detail below.

[0031] The system invokes a preset sliding window to scan the real-time data stream byte by byte and identifies the DoIP protocol identifier field during the scanning process. When the identifier field matches the frame header identifier of the DoIP protocol, and the version number and the version number's inverse check field in the identifier field satisfy the consistency relationship, it is determined that the frame header feature of the DoIP protocol has been successfully identified.

[0032] Here, the detection of frame header features is implemented using a sliding window, the size of which can be set as needed, for example, to the length of a field. During the recognition process, the sliding window scans the real-time data stream byte by byte, starting from the first byte, and identifies the DoIP protocol's identifier field during the scan. The step size of the sliding window can be one field; therefore, the sliding window scanning process is essentially a field-by-field identification of the identifier field.

[0033] The identification field includes the DoIP protocol version number and its inverse check field. It is a field contained in the frame header of the DoIP protocol message, thus serving as a frame header feature. Identifying this identification field determines its location as the frame header position of the DoIP protocol message, i.e., identifies the potential start position of the DoIP protocol message.

[0034] The specific identification process involves determining whether the identifier field meets two criteria. If so, the identifier field is identified as the frame header of a DoIP protocol message, and the length field is further extracted and a length validity check is performed. The criteria are: the identifier field matches the DoIP protocol frame header identifier, and the version number and its inverse checksum in the identifier field maintain consistency. If not, the field content within the current sliding window is not the frame header of a DoIP protocol message, and the sliding window is moved one byte forward until the frame header of the DoIP protocol message is identified. It is important to note that the identification process must ensure that the identifier field simultaneously meets both criteria; otherwise, the identifier field is determined not to be the frame header of a DoIP protocol message.

[0035] In this embodiment of the invention, by recognizing the features of the sliding window frame header, potential DoIP protocol messages can be effectively identified from the real-time data stream, providing a basis for further determination of message length.

[0036] Furthermore, the length field of the DoIP protocol message is determined based on the frame header features. After identifying the frame header features, the corresponding identifier field of the frame header can be parsed, and the Payload Length field can be extracted from a fixed field offset position. This field is the length field of the DoIP protocol message and can be used to determine the message length of the DoIP protocol message and verify the integrity of the DoIP protocol message content.

[0037] Step 103: Perform length validity verification on the DoIP protocol message based on the length field, and perform integrity verification on the DoIP protocol message when the length validity verification is successful.

[0038] After determining the field length of the DoIP protocol message, a length validity check is performed to determine whether the length field is valid.

[0039] In one possible implementation, the length validity of DoIP protocol messages is checked based on the length field. This can be achieved in the following way, which is explained in detail below.

[0040] The length field is converted to obtain the message length of the DoIP protocol message; If the message length is less than the maximum length of the data buffer, the length validity check is successful.

[0041] Specifically, first, the Payload Length field is converted to an integer, which represents the length of the DoIP protocol message. Then, it's determined whether the message length is within a reasonable range by checking if it exceeds the maximum length of the data buffer. If not, meaning the message length exceeds the maximum length of the data buffer (which is used to cache real-time data streams), it indicates the message length exceeds the maximum. In this case, the TCP receive buffer cannot store a complete DoIP protocol message and cannot parse it completely, confirming the message length is not within a reasonable range. For incomplete DoIP protocol messages, no field parsing is required; instead, exception handling is performed. If not, it means the message length is within a reasonable range, the TCP receive buffer can store a complete DoIP protocol message, and the length validity check is successful.

[0042] In this embodiment of the invention, given the DoIP protocol message frame header, further length validity verification is performed to facilitate the determination of the DoIP protocol message length, facilitate the judgment of the DoIP protocol message integrity, and improve the DoIP protocol message parsing accuracy.

[0043] Furthermore, upon successful length validity verification, the DoIP protocol message undergoes integrity verification to ensure the integrity of the DoIP protocol message content.

[0044] In one possible implementation, integrity verification of DoIP protocol messages can be achieved in the following ways, which are explained in detail below.

[0045] When a DoIP protocol message meets the preset verification conditions, the integrity verification is considered successful. The integrity check fails when a DoIP protocol message does not meet at least one check condition.

[0046] Specifically, there are three verification conditions for determining the integrity of a DoIP protocol message. First, the identifier field in the DoIP protocol message frame header must be valid. Validity is only determined when the frame header features are accurately identified; that is, the identifier field matches the DoIP protocol frame header identifier, and the version number and its inverse checksum in the identifier field must be consistent. Otherwise, it is invalid. Second, the length of the DoIP protocol message must be valid; that is, the length field of the DoIP protocol message must have successfully passed the length validity check. Otherwise, it is invalid. Third, the remaining data length in the data buffer that caches the real-time data stream must not be less than the length of the DoIP protocol message. This verification condition ensures that the data buffer can completely store a full-length DoIP protocol message. If this condition is not met, it means that the data buffer cannot completely store a full-length DoIP protocol message, thus affecting the integrity of the extracted DoIP protocol message.

[0047] See also Figure 2 After verifying the length validity, the DoIP protocol message is then checked for integrity to determine if it is complete. If it is, the message meets all three verification conditions, and the integrity check is successful. If not, the message fails to meet all three conditions, and exception handling is required.

[0048] In this embodiment of the invention, the integrity of the DoIP protocol message is determined by the remaining data length in the data buffer. This allows the complete parsing of the DoIP protocol message to be completed only in the data buffer, without the need to build additional multi-level caches or to split and reassemble the DoIP protocol message, thus reducing the complexity of communication data processing.

[0049] In one possible implementation, the length validity check or integrity check also includes: When the length validity check or integrity check fails, the sliding window used to scan the real-time data stream byte by byte to identify the frame header features of the DoIP protocol will be shifted one byte to the right. Re-identify the frame header features of the DoIP protocol from the bytes within the sliding window after the shift; If no frame header features are detected, the sliding window will continue to move forward by one byte until the DoIP protocol frame header features are detected within the sliding window.

[0050] Here, when the length validity check fails or the integrity check fails, it indicates that the integrity of the current DoIP protocol message may be affected by abnormal situations such as data misalignment, truncation, or noise interference. In this regard, the embodiment of the present invention sets up an abnormal handling mechanism to handle these abnormal situations.

[0051] Specifically, the sliding window is first shifted one byte to the right. This means the sliding window used to scan the real-time data stream byte-by-byte to identify the DoIP protocol header features is shifted one byte further back. The DoIP header features are then re-identified from the bytes within the shifted sliding window to parse the next DoIP protocol message. If the DoIP header features are still not identified after shifting the sliding window, the window is shifted one byte further back, and so on, until the DoIP header features are identified within the sliding window. Once identified successfully, length validity and integrity checks can be performed.

[0052] In this embodiment of the invention, when the failure of length validity check or integrity check leads to the inability to parse the complete DoIP protocol message, a sliding window synchronization mechanism is implemented. This mechanism can adjust the position of the sliding window in a timely and flexible manner when parsing is abnormal, in order to reconstruct the boundary of the DoIP protocol message. It can automatically recover the parsing of misaligned data and automatically skip the parsing of noisy data, thereby improving the robustness of DoIP protocol message parsing.

[0053] Step 104: When the integrity verification is successful, extract the DoIP protocol message from the real-time data stream, and perform field parsing processing on the DoIP protocol message to obtain the business message type corresponding to the DoIP protocol message.

[0054] When the DoIP protocol message integrity verification is successful, it means that a complete DoIP protocol message has been stored in the real-time data stream of the data buffer. Therefore, the complete DoIP protocol message can be extracted from the real-time data stream for field parsing and processing to obtain the business message type corresponding to the DoIP protocol message, which can then be used to perform the corresponding business processing.

[0055] In one possible implementation, the DoIP protocol message is parsed to obtain the corresponding business message type, including: Extract the target field from the DoIP protocol message that indicates the message payload; The target fields are mapped to obtain the business message type corresponding to the DoIP protocol message.

[0056] Here, after extracting the DoIP protocol message from the real-time data stream, the DoIP protocol message can be parsed immediately. Specifically, the target field used to indicate the message payload, namely the Payload Type field, can be extracted from the DoIP protocol message. The message type of the DoIP protocol message can be determined based on the Payload Type field. Different types of DoIP protocol messages correspond to different services.

[0057] Furthermore, mapping these Payload Type field values ​​determines the corresponding service message type for the DoIP protocol message. The mapping rules are predetermined in the DoIP protocol, and the message types include node management messages, status information retrieval messages, and diagnostic messages. Message types with Payload Type field values ​​in the range of 0x0000~0x0008 belong to node management messages, and their mapped service message types include, for example, general DoIP header negative acknowledgment, general vehicle identification request, route activation request, and route activation response. Message types with Payload Type field values ​​in the range of 0x4001~0x4004 belong to status information retrieval messages, and their mapped service message types include, for example, diagnostic power model request and diagnostic power model response. Message types with Payload Type field values ​​in the range of 0x8001~0x8003 belong to diagnostic messages, and their mapped service message types include, for example, diagnostic message and diagnostic message positive acknowledgment.

[0058] After the field parsing process, the parsed data is further distributed via callback. The business message type corresponding to the DoIP protocol message will be used as the complete parsed message data and called back to the business application layer through a unified interface to realize the corresponding business processing.

[0059] In this embodiment of the invention, when the real-time data stream of TCP / IP communication stops transmitting, the parsed DoIP protocol messages are processed simultaneously through a message type mapping mechanism to determine the business message type corresponding to the DoIP protocol messages. This decouples the DoIP protocol layer from the business layer and improves the scalability of the business layer system.

[0060] In one possible implementation, after parsing the fields of the DoIP protocol message, the following is also included: The sliding window used when scanning the real-time data stream byte by byte to identify DoIP protocol frame header features is moved to the position of the last field of the DoIP protocol message; Starting from the end field position, a sliding window is invoked to identify the frame header features of the DoIP protocol in the real-time data stream in order to parse out other DoIP protocol messages following the DoIP protocol message, until the field in the sliding window is the end field of the real-time data stream.

[0061] Because the data buffer continuously stores real-time TCP / IP communication data streams, after extracting and parsing a DoIP protocol message through integrity verification, subsequent real-time data streams may still contain other DoIP protocol messages. To address this, this embodiment of the invention, after parsing a DoIP protocol message, moves the sliding window used for byte-by-byte scanning of the real-time data stream to identify the DoIP protocol's frame header features to the end field position of that DoIP protocol message. In other words, starting from the end field position of the identified DoIP protocol message, byte-by-byte scanning continues using the sliding window, thereby allowing more DoIP protocol messages to be parsed in subsequent real-time data streams.

[0062] See also Figure 2 After parsing the DoIP protocol message and completing the callback distribution, the system checks if there is still real-time data in the data buffer. If not, it means that the real-time data stream for this TCP / IP communication has been received, and the parsing ends. If so, the sliding window moves to the end of the currently parsed DoIP protocol message and continues to scan field by field to identify the frame header features of the DoIP protocol.

[0063] After each DoIP protocol message is parsed, its fields are parsed to determine the corresponding business message type. Then, a sliding window is moved to the end of the currently parsed DoIP protocol message's field position until the field in the sliding window corresponds to the end of the real-time data stream. If the field in the sliding window corresponds to the end of the real-time data stream, it indicates that the real-time data stream received in this TCP / IP communication has ended, and all DoIP protocol messages in the real-time data stream have been parsed.

[0064] In this embodiment of the invention, after parsing the DoIP protocol message, the byte-by-byte scanning is continued by moving the sliding window. This allows multiple DoIP protocol messages to be continuously parsed from a single received real-time data stream, thus supporting continuous parsing and improving the throughput of diagnostic communication.

[0065] In summary, this invention, when parsing DoIP protocol packets, does not rely on the prerequisite of complete packet arrival. Instead, it directly parses the real-time data stream during TCP / IP real-time communication. Furthermore, during parsing, it only needs to identify the frame header characteristics of the DoIP protocol and determine the length field to completely parse each DoIP protocol packet, enabling parsing while transmitting in real time and significantly improving real-time performance. In addition, the DoIP protocol packet parsing method only focuses on the inherent characteristics of the DoIP protocol packets. On the one hand, by combining length validity checks and integrity checks, it can automatically recover even in cases of packet misalignment, truncation, or noise interference, ensuring the data integrity of the DoIP protocol packets without the need for post-processing, achieving highly robust parsing. On the other hand, the parsing process does not require determining the packet boundaries of the TCP / IP data stream, avoiding data fragmentation or reassembly in TCP communication data transmission and avoiding data loss or out-of-order delivery in UDP communication transmission, making it effectively applicable to streaming data transmission environments.

[0066] The DoIP streaming data parsing device provided by this invention will be described in detail below.

[0067] Figure 3 This is a schematic diagram of the DoIP streaming data parsing device provided by the present invention. Figure 3 As shown, the DoIP streaming data parsing device includes: an acquisition module 301, an identification module 302, a verification module 303, and a parsing module 304.

[0068] Specifically, the acquisition module 301 is used to acquire the real-time data stream of TCP / IP communication; the identification module 302 is used to identify the frame header features of the DoIP protocol from the real-time data stream, and determine the length field of the DoIP protocol message based on the frame header features; the verification module 303 is used to perform length validity verification on the DoIP protocol message based on the length field, and perform integrity verification on the DoIP protocol message when the length validity verification is successful; the parsing module 304 extracts the DoIP protocol message from the real-time data stream when the integrity verification is successful, and performs field parsing processing on the DoIP protocol message to obtain the service message type corresponding to the DoIP protocol message.

[0069] In one possible implementation, the identification module 302 is further configured to, when the length validity check fails or the integrity check fails, shift the sliding window used to scan the real-time data stream byte by byte to identify the frame header features of the DoIP protocol by one byte; re-identify the frame header features of the DoIP protocol from the bytes in the shifted sliding window; if the frame header features are not identified, continue to shift the sliding window by one byte until the frame header features of the DoIP protocol are identified in the sliding window.

[0070] In one possible implementation, the identification module 302 is further configured to, before performing field parsing processing on the DoIP protocol message, move the sliding window used for scanning the real-time data stream byte by byte to identify the frame header features of the DoIP protocol to the position of the end field of the DoIP protocol message; starting from the end field position, invoke the sliding window to identify the frame header features of the DoIP protocol in the real-time data stream to parse out other DoIP protocol messages after the DoIP protocol message, until the field in the sliding window is the end field of the real-time data stream.

[0071] The DoIP streaming data parsing device provided in the above embodiments can implement the technical solutions described in the above DoIP streaming data parsing method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above DoIP streaming data parsing method embodiments, and their technical effects can also be referred to each other. They will not be repeated here.

[0072] like Figure 4 As shown, the present invention also provides an electronic device 400. The electronic device 400 includes a processor 401, a memory 402, and a display 403. Figure 4 Only some components of the electronic device 400 are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.

[0073] In some embodiments, memory 402 may be an internal storage unit of electronic device 400, such as a hard disk or memory of electronic device 400. In other embodiments, memory 402 may also be an external storage device of electronic device 400, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 400.

[0074] Furthermore, the memory 402 may include both internal storage units of the electronic device 400 and external storage devices. The memory 402 is used to store application software and various types of data installed on the electronic device 400.

[0075] In some embodiments, processor 401 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 402 or process data, such as the DoIP streaming data parsing method of the present invention.

[0076] In some embodiments, display 403 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 403 is used to display information from electronic device 400 and to display a visual user interface. Components 401-403 of electronic device 400 communicate with each other via a system bus.

[0077] In some embodiments of the present invention, when the processor 401 executes the computer program in the memory 402, the following steps can be implemented: acquiring a real-time data stream of TCP / IP communication; identifying the frame header features of the DoIP protocol from the real-time data stream, and determining the length field of the DoIP protocol message based on the frame header features; performing a length validity check on the DoIP protocol message based on the length field, and performing an integrity check on the DoIP protocol message when the length validity check is successful; when the integrity check is successful, extracting the DoIP protocol message from the real-time data stream, and performing field parsing processing on the DoIP protocol message to obtain the service message type corresponding to the DoIP protocol message.

[0078] It should be understood that when the processor 401 executes the computer program in the memory 402, in addition to the functions described above, it can also perform other functions, as can be found in the description of the corresponding method embodiments above.

[0079] Furthermore, the embodiments of the present invention do not specifically limit the type of electronic device 400 mentioned. Electronic device 400 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic device. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, electronic device 400 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0080] In another aspect, the present invention also provides a DoIP streaming data parsing system, including a communication device and the electronic device 400 described in the above embodiments. The communication device and the electronic device 400 communicate via a network link. The communication device is used to collect real-time data streams of TCP / IP communication and store the real-time data streams in the memory 402 of the electronic device 400. The communication device is also used to output parsed DoIP protocol messages after the processor 401 of the electronic device 400 executes the program stored in the memory 402.

[0081] In some embodiments, communication equipment may be network communication equipment deployed with network links such as the Internet or Ethernet, such as switches, routers, firewalls, gateways, bridges, repeaters, wireless access points (APs), modems, optical transceivers, fiber optic transceivers, etc.

[0082] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0083] The DoIP streaming data parsing method, apparatus, system, and electronic device provided by this invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A DoIP stream data parsing method, characterized in that, include: Acquire real-time data streams from TCP / IP communication; Identify the frame header features of the DoIP protocol from the real-time data stream, and determine the length field of the DoIP protocol message based on the frame header features; The length of the DoIP protocol message is validated based on the length field, and the integrity of the DoIP protocol message is validated if the length validation is successful. When the integrity verification is successful, the DoIP protocol message is extracted from the real-time data stream, and the DoIP protocol message is parsed to obtain the business message type corresponding to the DoIP protocol message.

2. The DoIP streaming data parsing method according to claim 1, characterized in that, The step of identifying DoIP protocol frame header features from the real-time data stream includes: A preset sliding window is invoked to scan the real-time data stream byte by byte, and the identification field of the DoIP protocol is identified during the scanning process. The identification field includes the version number of the DoIP protocol and the version number's inverse code check field. When the identification field matches the frame header identifier of the DoIP protocol, and the version number and the version number's inverse check field in the identification field satisfy the consistency relationship, it is determined that the frame header feature of the DoIP protocol has been successfully identified.

3. The DoIP streaming data parsing method according to claim 1, characterized in that, The length validity check of the DoIP protocol message based on the length field includes: The length field is converted to obtain the message length of the DoIP protocol message; If the message length is less than the maximum length of the data buffer, the length validity check is successful. The data buffer is used to cache the real-time data stream.

4. The DoIP streaming data parsing method according to claim 1, characterized in that, The integrity verification of the DoIP protocol message includes: When the DoIP protocol message meets the preset verification conditions, the integrity verification is determined to be successful: When the DoIP protocol message does not meet at least one verification condition, the integrity verification is determined to have failed. The verification conditions include: The DoIP protocol message has a valid identifier field in the frame header; The length of the DoIP protocol message is valid; The data buffer that caches the real-time data stream has a remaining data length that is not less than the length of the DoIP protocol message.

5. The DoIP streaming data parsing method according to claim 1, characterized in that, The method further includes: When the length validity check or integrity check fails, the sliding window used to scan the real-time data stream byte by byte to identify the frame header features of the DoIP protocol will be shifted one byte to the right. Re-identify the frame header features of the DoIP protocol from the bytes within the sliding window after the shift; If the frame header feature is not identified, the sliding window is moved one byte further back until the DoIP protocol frame header feature is identified within the sliding window.

6. The DoIP streaming data parsing method according to claim 1, characterized in that, The step of parsing the DoIP protocol message to obtain the service message type corresponding to the DoIP protocol message includes: Extract the target field used to indicate the message payload from the DoIP protocol message; The target field is mapped to obtain the service message type corresponding to the DoIP protocol message.

7. The DoIP streaming data parsing method according to claim 1, characterized in that, After performing field parsing processing on the DoIP protocol message, the method further includes: The sliding window used when scanning the real-time data stream byte by byte to identify DoIP protocol frame header features is moved to the position of the end field of the DoIP protocol message; Starting from the position of the last field, the sliding window is invoked to identify the frame header features of the DoIP protocol in the real-time data stream, so as to parse out other DoIP protocol messages after the DoIP protocol message, until the field in the sliding window is the last field of the real-time data stream.

8. A DoIP streaming data parsing device, characterized in that, include: The acquisition module is used to acquire real-time data streams from TCP / IP communication. The identification module is used to identify the frame header features of the DoIP protocol from the real-time data stream, and determine the length field of the DoIP protocol message based on the frame header features; The verification module is used to perform length validity verification on the DoIP protocol message based on the length field, and to perform integrity verification on the DoIP protocol message when the length validity verification is successful. The parsing module extracts the DoIP protocol message from the real-time data stream when the integrity verification is successful, and performs field parsing processing on the DoIP protocol message to obtain the business message type corresponding to the DoIP protocol message.

9. An electronic device, characterized in that, Including memory and processor, among which, The memory is used to store programs; The processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps of the DoIP streaming data parsing method as described in any one of claims 1 to 7.

10. A DoIP streaming data parsing system, characterized in that, Includes a communication device and an electronic device as described in claim 9, wherein the communication device and the electronic device communicate via a network link; The communication device is used to collect real-time data streams of TCP / IP communication and store the real-time data streams in the memory of the electronic device; The communication device is further configured to output parsed DoIP protocol messages after the processor of the electronic device executes the program stored in the memory.