Data communication method and device, electronic equipment and storage medium

By dynamically adjusting the LIN communication frame structure, the problems of low LIN communication rate and bandwidth waste in traditional LIN communication are solved, and communication efficiency is improved under the premise of low cost and hardware compatibility, so as to meet the high-frequency data transmission needs of intelligent vehicles.

CN121792012APending Publication Date: 2026-04-03WUHAN JIANGXIA CHUNENG AUTOMOBILE TECHNOLOGY R&D CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Traditional LIN communication protocols have bottlenecks in data transmission rate and bandwidth utilization efficiency. In particular, the frame header overhead is too large when transmitting small data, and the number of frames needs to be split when transmitting large data, which cannot meet the high-frequency data transmission requirements of intelligent vehicles. At the same time, replacing hardware is costly and incompatible with existing nodes.

Method used

The system uses differentiated generation of optimized frame headers and tails, dynamically divides short frames, standard frames, and long frames according to data length, compresses or makes the synchronization segment compatible, simplifies the identification segment, and matches the length of the verification segment to achieve accurate adaptation of the frame structure.

Benefits of technology

While maintaining LIN bus hardware compatibility, it significantly improves communication speed, reduces frame header overhead, increases the proportion of effective data, adapts to the real-time data transmission needs of intelligent vehicles, and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121792012A_ABST
    Figure CN121792012A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data communication, and provides a data communication method and device, electronic equipment and a storage medium, and the method comprises the steps: determining a target frame structure based on the data length of to-be-transmitted data, the target frame structure comprises a short frame, a standard frame and a long frame, the frame header length of the short frame is smaller than the frame header length of a standard LIN frame, and the frame header length of the standard LIN frame is smaller than the frame header length of the standard LIN frame; the maximum length of the data segment supported by the long frame is greater than the length of the data segment of the standard LIN frame; an optimized frame header and an optimized frame tail are generated in a differentiated mode in a mode matched with the target frame structure, the frame header comprises a synchronization segment and an identification segment, and the frame tail comprises a verification segment; and combining the frame header, the to-be-transmitted data and the frame tail to form a communication frame and transmitting the communication frame. According to the data communication method and device, the electronic equipment and the storage medium provided by the invention, accurate adaptation of different scales of data is realized. The frame types are dynamically divided according to the data length, invalid overhead caused by a fixed frame structure is avoided, and the effective data proportion is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data communication technology, and in particular to a data communication method, apparatus, electronic device, and storage medium. Background Technology

[0002] Vehicle LIN (Local Interconnect Network) bus has become the mainstream communication protocol for non-safety-critical automotive systems (such as door and window control, lighting adjustment, and seat adjustment) due to its low cost and simple structure. Traditional LIN communication follows a fixed frame structure specification. A data frame typically includes a synchronization segment, a protected identifier segment (PID), a data segment, and a check segment. The length of the data segment is strictly limited to 8 bytes, and regardless of the actual amount of data transmitted, each communication must carry a complete, fixed-length frame header (mainly including the synchronization segment and PID segment) and a frame trailer (check segment).

[0003] With the increasing sophistication of intelligent vehicle functions, especially the widespread adoption of scenarios such as ambient lighting linkage in intelligent cockpits and high-frequency data acquisition from multi-node sensors, higher demands are being placed on the real-time data transmission capabilities of the vehicle's network. Against this backdrop, the inherent design of traditional LIN communication has revealed significant bottlenecks: First, its standard communication rate limit is typically only 19.2 kbps, and its inherently low bandwidth is insufficient to meet the data throughput requirements of new applications; second, its fixed frame structure leads to substantial protocol overhead. When transmitting frequent small data (such as a single button signal) much smaller than 8 bytes, the lengthy fixed frame header results in significant bandwidth waste; while when transmitting data exceeding 8 bytes, the data must be split and transmitted in multiple LIN frames, introducing a large amount of redundant frame header / tail overhead, greatly reducing the effective communication rate.

[0004] To address the low communication speed of LIN, existing technologies have employed alternatives such as higher-speed communication buses (e.g., CAN FD or Ethernet). However, such solutions involve a significant increase in hardware costs and a fundamental change in system architecture, making them incompatible with the large number of existing LIN nodes and negating the core advantages of LIN bus—low cost and ease of deployment. Therefore, there is an urgent need in the field for a technical solution that can effectively improve the effective communication speed of LIN bus while maintaining its hardware compatibility and low-cost advantages. Summary of the Invention

[0005] This invention provides a data communication method, apparatus, electronic device, and storage medium to address the shortcomings of low LIN communication speed in the prior art, and to effectively improve the communication speed while maintaining the hardware compatibility and low cost advantages of the LIN bus.

[0006] This invention provides a data communication method, comprising: The target frame structure is determined based on the data length of the data to be transmitted. The target frame structure includes short frames, standard frames, and long frames. The header length of the short frame is shorter than the header length of the standard LIN frame, and the maximum length of the data segment supported by the long frame is greater than the data segment length of the standard LIN frame. In a manner adapted to the target frame structure, optimized frame headers and frame trailers are generated differentially. The frame header includes a synchronization segment and an identification segment, and the frame trailer includes a verification segment. The frame header, the data to be transmitted, and the frame trailer are combined to form a communication frame and then transmitted.

[0007] According to the data communication method provided by the present invention, the step of differentially generating optimized frame headers and frame trailers in a manner adapted to the target frame structure includes: If the target frame structure is a short frame, then the synchronization segment is compressed, the identification segment is simplified and spliced, and the parity check bit is removed; If the target frame structure is a standard frame, then the synchronization segment is processed for compatibility, the identification segment is determined based on the ID reuse determination algorithm, and the length of the verification segment is matched based on the priority of the data to be transmitted. If the target frame structure is a long frame, the synchronization segment is processed in a compatible manner, and an identification segment containing an extended identifier is generated. The length of the verification segment is matched based on the priority of the data to be transmitted.

[0008] According to the data communication method provided by the present invention, the simplified splicing of the identification segment includes: Extract the data source node ID of the data to be transmitted and generate a data length identifier; The node ID is shifted and then bitwise ORed with the data length identifier to obtain the identification segment.

[0009] According to the data communication method provided by the present invention, determining the identification segment based on the ID reuse determination algorithm includes: Obtain the historical transmission context, which includes the node ID of the previous frame, the transmission timestamp of the previous frame, and the current transmission timestamp; Calculate the time difference based on the previous frame transmission timestamp and the current transmission timestamp; Based on the time difference, the current node ID and the previous frame node ID, determine whether the transmission is continuous. If the transmission is continuous, the node ID of the previous frame is reused as the identification segment of the current transmission. If the transmission is discontinuous, a complete node ID including the parity bit is generated as the identification segment of the current transmission.

[0010] According to the data communication method provided by the present invention, generating an identification segment containing an extended identifier includes: Extract the node ID of the data to be transmitted as the basic part of the identification segment; An extended identifier is generated based on the highest-order long frame marker bit and the lower 7 length bits; The identification segment is obtained by sequentially concatenating the basic part and the extended identifier.

[0011] According to the data communication method provided by the present invention, the step of matching the check segment length based on the priority of the data to be transmitted includes: The length of the verification segment is positively correlated with the priority; high-priority data uses a long verification segment, while low-priority data uses a short verification segment.

[0012] According to the data communication method provided by the present invention, determining the target frame structure based on the data length of the data to be transmitted includes: If the length of the data to be transmitted is 1-2 bytes, the target frame structure is a short frame; if the length of the data to be transmitted is 3-8 bytes, the target frame structure is a standard frame; if the length of the data to be transmitted is 9-32 bytes, the target frame structure is a long frame.

[0013] The present invention also provides a data communication device, comprising: A frame structure determination unit is used to determine the target frame structure based on the data length of the data to be transmitted. The target frame structure includes short frames, standard frames, and long frames. The header length of the short frame is less than the header length of the standard LIN frame, and the maximum length of the data segment supported by the long frame is greater than the data segment length of the standard LIN frame. The frame header and frame tail optimization unit is used to generate optimized frame headers and frame tails in a differentiated manner to adapt to the target frame structure. The frame header includes a synchronization segment and an identification segment, and the frame tail includes a verification segment. A combined transmission unit is used to combine the frame header, the data to be transmitted, and the frame trailer to form a communication frame and transmit it.

[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data communication method as described above.

[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data communication method as described above.

[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the data communication method as described above.

[0017] The data communication method, apparatus, electronic device, and storage medium provided by this invention achieve precise adaptation to data of different scales by determining the target frame structure based on the data length of the data to be transmitted. Dynamically classifying frame types according to data length avoids the invalid overhead caused by fixed frame structures, significantly increases the proportion of effective data, and requires no modification to the existing LIN bus physical layer hardware. It can also still work with nodes that only support traditional standard frames, achieving a balance between performance improvement, low cost, and backward compatibility. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0019] Figure 1 This is one of the flowcharts illustrating the data communication method provided by the present invention.

[0020] Figure 2 This is a schematic diagram of the data communication device provided by the present invention.

[0021] Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0023] Communication between vehicle electronic control units widely adopts the LIN (Local Interconnect Network) bus protocol. Due to its low cost, simple wiring, and good electromagnetic compatibility, it is extensively used in non-safety-critical systems such as door control, seat adjustment, and ambient lighting. However, the standard LIN protocol uses a fixed frame structure—regardless of whether the transmitted data is only 1 byte (such as a button trigger signal) or requires 8 bytes (such as multi-sensor fusion status), it mandates a unified format including a 13-bit synchronization segment, a 6-bit identifier (ID), a 2-bit parity bit, 1–8 byte data segments, and a 1-byte check segment. This rigid design results in a very high frame header overhead for high-frequency, small data transmission (for example, with 1 byte of data, the frame header occupies 5 bytes, resulting in a payload rate of less than 17%), severely restricting communication efficiency. For data larger than 9 bytes, it must be split into multiple frames for transmission, introducing repeated synchronization segments, identification segments, and check segments, further amplifying latency and bandwidth waste. With the increasing demands for real-time performance and data throughput in scenarios such as ambient lighting linkage and high-frequency sampling of temperature, pressure, and humidity at multiple nodes in smart cockpits, traditional LIN can no longer balance compatibility and speed improvement without modifying the physical layer.

[0024] Against the above background, embodiments of the present invention provide a data communication method. In this method, firstly, a target frame structure is determined based on the data length of the data to be transmitted. The target frame structure includes short frames, standard frames, and long frames. The header length of a short frame is shorter than the header length of a standard LIN frame, and the maximum length of a data segment supported by a long frame is greater than the data segment length of a standard LIN frame. Optimized frame headers and trailers are generated differentially in a manner adapted to the target frame structure. The frame header includes a synchronization segment and an identification segment, and the frame trailer includes a check segment. The frame header, the data to be transmitted, and the frame trailer are combined to form a communication frame and transmitted.

[0025] The method provided in this invention determines the target frame structure based on the data length of the data to be transmitted, achieving precise adaptation to data of different sizes. Dynamically classifying frame types according to data length avoids the invalid overhead caused by fixed frame structures, significantly increasing the proportion of effective data. Specifically, for short data, using short frames with header lengths shorter than standard LIN frames greatly reduces protocol overhead when transmitting small data. The total number of bytes required to transmit the same number of effective data bytes is less, thus substantially improving the effective data transmission rate at the same physical layer baud rate. For long data, using long frames with a maximum data segment length greater than standard LIN frames breaks through the traditional LIN protocol's 8-byte single-frame limitation. This eliminates the need to split large data into multiple frames, fundamentally avoiding the additional overhead caused by repeatedly transmitting frame headers and trailers, significantly reducing the total number of frames required to transmit large data, thereby significantly improving the effective communication rate.

[0026] The embodiments of the present invention generate optimized frame headers and trailers through differentiation, making the ratio of protocol overhead (frame header and trailer) to payload (data) length more reasonable, reducing bandwidth waste, and enabling more full and efficient use of the bandwidth of the communication channel.

[0027] Furthermore, the core of this invention lies in the optimization of the logical layer of the communication frame structure, without requiring any modification to the physical layer hardware of the existing LIN bus. As long as the software or firmware of the communication node supports this method, the speed can be improved, while still being able to work collaboratively with nodes that only support traditional standard frames. This achieves a balance between performance improvement, low cost, and backward compatibility, greatly promoting the practical application of the technology.

[0028] The embodiments of the present invention can be applied to scenarios requiring improved LIN communication speeds. The subject executing this method can be a terminal device, computer, server, server cluster, or specially designed electronic device, or a communication device installed within that electronic device. This communication device can be implemented through software, hardware, or a combination of both.

[0029] In the description of the embodiments of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of the embodiments of the present invention, "multiple" means two or more, unless otherwise explicitly specified.

[0030] Figure 1 This is one of the flowcharts illustrating the data communication method provided by the present invention, such as... Figure 1 As shown, the method includes the following steps 110-130.

[0031] Step 110: Determine the target frame structure based on the data length of the data to be transmitted. The target frame structure includes short frames, standard frames, and long frames. The header length of a short frame is shorter than the header length of a standard LIN frame, and the maximum length of a data segment supported by a long frame is greater than the data segment length of a standard LIN frame.

[0032] Specifically, the data length of the data to be transmitted refers to the number of bytes of the valid information to be sent (such as sensor readings, control commands), excluding padding, encapsulation headers, or application layer protocol fields. The target frame structure refers to the predefined data frame format template selected for this transmission. This embodiment defines three types: short frame, standard frame, and long frame.

[0033] In practice, the applicable frame structure type can be determined based on a preset length threshold range. In some embodiments, if the length of the data to be transmitted is 1-2 bytes, the target frame structure is a short frame; if the length of the data to be transmitted is 3-8 bytes, the target frame structure is a standard frame; and if the length of the data to be transmitted is 9-32 bytes, the target frame structure is a long frame.

[0034] Among them, a short frame is a frame structure with an extremely simplified frame header, designed specifically for transmitting small data of 1-2 bytes; a standard frame is a frame structure that is compatible with or similar to the traditional LIN frame structure, used for transmitting regular data of 3-8 bytes; and a long frame is a frame structure with an extended data segment, used for transmitting large data of 9-32 bytes, breaking through the limitations of traditional LIN.

[0035] This interval division is not arbitrarily set, but rather an optimal dividing point derived by comprehensively considering the minimum frame interval of the LIN physical layer, the granularity of typical sensor data, and the maximum tolerable latency of a single frame: short frames cover the most frequent event-type small data (such as switch status, LED on / off commands), ensuring that their end-to-end latency is less than 1.2 ms; standard frames match medium-complexity control commands and status feedback (such as dual parameters of motor position and speed, dual sampling values ​​of temperature and humidity), balancing overhead and robustness; long frames break through the traditional LIN single-frame 8-byte limit, supporting the single transmission of complete image metadata, audio feature vectors, or firmware differential packet fragments, avoiding sequence disorder and retransmission overhead caused by multi-frame splicing.

[0036] This embodiment selects the most suitable target frame structure based on the data volume, achieving a tailored approach that avoids waste or inefficiency at the source, laying the foundation for subsequent protocol overhead optimization.

[0037] Step 120: Generate optimized frame headers and frame trailers in a way that adapts to the target frame structure. The frame header includes a synchronization segment and an identification segment, and the frame trailer includes a verification segment. Step 130: Combine the frame header, the data to be transmitted, and the frame trailer to form a communication frame and transmit it.

[0038] Specifically, differentiated generation refers to constructing frame headers and trailers using completely different algorithms and rules based on different target frame structures, rather than using a uniform, fixed method.

[0039] The frame header, located at the beginning of the data frame, is used for synchronization and identification. It includes a synchronization segment and an identification segment. The synchronization segment is a specific sequence of 0s and 1s used by the receiver to calibrate its clock and achieve bit synchronization. The identification segment identifies the data frame, including information such as the source node, data type, and length. The frame trailer, located at the end of the data frame, mainly refers to the checksum segment, used for error detection, such as parity checks and CRC checks.

[0040] After the frame generation engine completes the calculation of all fields, it copies the synchronization segment byte array, the identification segment byte array, the original data to be transmitted byte array, and the check segment byte array to a contiguous memory buffer in the aforementioned order to form a physically sendable complete frame byte stream; then, the LIN dedicated transceiver starts asynchronous serial transmission.

[0041] In some embodiments, step 120 specifically includes: Step 121: If the target frame structure is a short frame, then the synchronization segment is compressed, the identification segment is simplified and spliced, and the parity check bit is removed.

[0042] Specifically, short frames refer to communication scenarios where the length of the data to be transmitted is 1–2 bytes. Typical applications include high-frequency, low-overhead interactive data such as car door lock status signals, ambient light on / off commands, and button trigger events. The goal of short frame frame structure design is to maximize the compression of frame header size while ensuring basic frame synchronization and node recognizability, thereby increasing the effective payload ratio per unit time.

[0043] Synchronization segment compression refers to truncating the high 8 dominant bits (0b11111111 in binary) of the 13-bit dominant synchronization field in the traditional LIN protocol to form a 1-byte fixed-value synchronization segment. This compression method preserves the basic edge transition density and DC balance characteristics required for clock recovery at the receiving end, while avoiding the additional byte overhead introduced by the complete 13-bit synchronization field.

[0044] The specific steps for simplifying and splicing the identification segment include: extracting the data source node ID of the data to be transmitted and generating a data length identifier; shifting the node ID and performing a bitwise OR operation with the data length identifier to obtain the identification segment.

[0045] Here, the simplified concatenation of the identification segment refers to constructing a 1-byte identification field, which is composed of a 4-bit node ID and a 4-bit data length identifier through bitwise operations. The node ID is the logical address of the current sending node in the LIN network (range 0x00–0x0F, for a total of 16 nodes); the length identifier is a binary code: 1 byte of data corresponds to 0b0001 (i.e., 0x01), and 2 bytes of data correspond to 0b0010 (i.e., 0x02). The concatenation method is to left-shift the node ID by 4 bits and then perform a bitwise OR operation with the length identifier. For example, when node ID = 0x05 (0b0101) and L = 1, the identification segment = 0b01010001 = 0x51. This structure abandons the fixed format of 6-bit ID + 2-bit parity check in the traditional PID segment, and achieves self-describing frame structure capability through length information embedding, allowing the receiving end to know the number of bytes in subsequent data segments without additional parsing.

[0046] Simultaneously, the parity bit is removed, meaning that the two parity bits (P0, P1) specified in the traditional LIN protocol are completely omitted from the identification segment. This design is based on the data characteristics of short-frame application scenarios—small data volume, high update frequency, and relatively high fault tolerance—where the error detection gain of parity check is limited. Furthermore, the total length of the frame header is only 2 bytes (1 byte for the synchronization segment + 1 byte for the identification segment), resulting in a significantly lower overall bit error rate compared to long-frame scenarios.

[0047] It is understandable that if the target frame structure is a short frame, the frame length is calculated as: synchronization segment (1) + identification segment (1) + data segment (L) + check segment (1) = 3+L bytes. Since L=1~2, the total frame length is 4~6 bytes.

[0048] Step 122: If the target frame structure is a standard frame, then the synchronization segment is processed for compatibility. The identification segment is determined based on the ID reuse judgment algorithm, and the length of the verification segment is matched based on the priority of the data to be transmitted.

[0049] Specifically, a standard frame refers to a frame suitable for general communication scenarios where the length of the data to be transmitted is 3–8 bytes. Typical applications include moderately complex data such as temperature sensor readings, battery voltage monitoring values, motor speed feedback, and seat position parameters. The goal of the standard frame's frame structure design is to reduce redundancy overhead in continuous communication by using a dynamic segment generation strategy while maintaining full compatibility with the existing LIN physical layer and protocol stack.

[0050] Synchronization segment compatibility processing means fully preserving the 13-bit dominant synchronization field defined by the traditional LIN protocol (occupying approximately 2 bytes of transmission time, with a typical waveform consisting of 13 consecutive dominant bits), ensuring that all LIN transceivers conforming to the ISO 17987 standard can complete synchronization capture and clock recovery without modification.

[0051] Here, the specific steps for determining the identification segment based on the ID reuse judgment algorithm include: obtaining the historical transmission context, which includes the node ID of the previous frame, the transmission timestamp of the previous frame, and the current transmission timestamp; calculating the time difference based on the transmission timestamp of the previous frame and the current transmission timestamp; determining whether the transmission is continuous based on the time difference, the current node ID, and the node ID of the previous frame; if the transmission is continuous, reusing the node ID of the previous frame as the identification segment of the current transmission; if the transmission is discontinuous, generating a complete node ID including the parity bit as the identification segment of the current transmission.

[0052] In specific implementation, the dynamic length decision process for the identification segment includes the following steps: ① Calculate the time difference: current transmission timestamp - previous frame transmission timestamp = Δt; ② Determine the continuous transmission condition: if Δt ≤ 10ms (the industry standard time threshold for continuous LIN transmission) and the current node ID = the previous frame node ID, then it is determined to be continuous transmission; ③ Continuous transmission scenario: using the ID reuse algorithm, the previous frame node ID is directly extracted as the current identification segment (1 byte in length), without the need to repeatedly generate the complete PID segment; ④ Non-continuous transmission scenario: generate a 2-byte complete node ID (compatible with the traditional LIN PID segment format: 6-bit ID + 2-bit parity check bit) to ensure the reliability of new node or interval transmission.

[0053] The checksum length is matched based on the priority of the data to be transmitted, which means dynamically configuring the number of bytes in the frame tail checksum according to the data priority P. The checksum length is positively correlated with the priority; high-priority data uses a longer checksum, and low-priority data uses a shorter checksum. For example, high-priority data (such as motor control commands and braking signals) uses a 3-byte CRC-24 checksum, which is compatible with dual checksum and provides strong error detection capabilities; medium / low-priority data (such as ambient light intensity and lighting status) uses a 1-byte XOR checksum, which is compatible with simplified checksum and only performs byte-by-byte XOR accumulation on the frame header and data segment. This hierarchical mechanism avoids imposing excessive checksum overhead on non-critical data while ensuring the reliability of critical data transmission.

[0054] It is understandable that if the target frame structure is a standard frame, the frame length is calculated as: synchronization segment (2) + identification segment (1~2) + data segment (L) + check segment (1~3) = 4~5+L bytes. Since L=3~8, the total frame length is 7~13 bytes.

[0055] Step 123: If the target frame structure is a long frame, then the synchronization segment is processed in a compatible manner, and an identification segment containing an extended identifier is generated, and the length of the verification segment is matched based on the priority of the data to be transmitted.

[0056] Specifically, long frames refer to large-capacity communication scenarios where the length of the data to be transmitted is 9–32 bytes. Typical applications include RGBW parameter groups for multi-channel ambient lighting in smart cockpits, preprocessed feature vectors of LiDAR point clouds, and metadata blocks in OTA upgrade packets, which break through the traditional 8-byte limit of a single LIN frame. The frame structure design goal of long frames is to support large-capacity transmission in a single frame, avoiding the overhead of repeated synchronization segments, repeated identification segments, and inter-frame intervals caused by the need to split the data into multiple frames in traditional LIN.

[0057] The synchronization segment here is handled in the same way as the standard frame, using a standard 13-bit explicit synchronization field to ensure zero-modification access at the physical layer. The checksum length is matched based on the priority of the data to be transmitted, which can also be done in the same way as the standard frame; this will not be elaborated further here.

[0058] In this step, generating the identification segment containing the extended identifier specifically includes: extracting the node ID of the data to be transmitted as the basic part of the identification segment; generating the extended identifier based on the highest-order long frame marker bit and the lower 7-bit length bits; and concatenating the basic part and the extended identifier in sequence to obtain the identification segment.

[0059] In specific implementation, a 3-byte identification field is constructed, consisting of a 2-byte base node ID and a 1-byte extended identifier concatenated sequentially. The base node ID is the standard 16-bit logical address of the sending node (high-order byte first, low-order byte last). The highest bit (bit 7) of the extended identifier is always set to 1 as a long frame marker, and the lower 7 bits (bit 6–bit 0) encode the length L of the data to be transmitted (L ∈ [9, 32], 7 bits can cover 0–127, actually using 24 valid values ​​from 0x09 to 0x20). For example, if L = 15 (0x0F), then the extended identifier = 0b10001111 = 0x8F; the concatenated identification segment is [high-order byte ID][low-order byte ID][0x8F]. This structure allows the receiving end to directly determine the data segment length after parsing the identification segment, without relying on frame end checksums or additional control fields, supporting deterministic parsing.

[0060] The identification segment extension design includes the following steps: ① Basic ID retention: Extract the 2-byte basic node ID (e.g., seat node ID is 0x1234) as the basic part of the identification segment; ② Extended identifier generation: Use a combination algorithm of "1-bit mark bit + 7-bit length bits" to generate a 1-byte extended identifier: a) The highest bit is fixed to 1 (as a long frame mark bit, informing the receiver that the current structure is a long frame and needs to be processed according to the long frame parsing rules); b) The lower 7 bits store the specific value of the data length L (since L≤32, 7 bits can completely cover the value range of 9~32, e.g., L=16 corresponds to binary 0001111, i.e., 0x0F); ③ Identification segment concatenation: Concatenate the 2-byte basic ID and the 1-byte extended identifier in the order of "basic ID first, extended identifier last" to form a 3-byte identification segment (e.g., basic ID 0x1234+L=16, extended identifier is 0x8F, the concatenated identification segment is 0x12, 0x34, 0x8F).

[0061] Then, the data segment is extended. 9-32 bytes of valid data to be transmitted are directly extracted as the data segment, breaking the traditional 8-byte limit of LIN data segments.

[0062] It is understandable that if the target frame structure is a long frame, the frame length is calculated as: synchronization segment (2) + identification segment (3) + data segment (L) + check segment (1~3) = 6~8+L bytes. Since L=9~32, the total frame length is 15~40 bytes.

[0063] In other embodiments, a data communication method is provided, including: Different frame structures are matched to the length characteristics of the data to be transmitted to reduce redundant frame headers; different strengths of verification mechanisms are designed according to the priority characteristics of the data to avoid wasting verification resources; at the same time, compatibility with the existing LIN standard is maintained, without modifying the physical layer structure, thus reducing implementation costs. Specifically, this includes: 1) Parameter Definitions. Data Length L: The number of bytes of valid data to be transmitted, which is the core basis for frame structure type matching; Data Priority P: Divided into three levels according to the importance of the data: high priority (such as motor control signals, brake signals), medium priority (such as temperature acquisition values, voltage monitoring data), and low priority (such as light status, button trigger signals); Historical Transmission Context: Records the transmission information of the previous frame, including the node ID of the previous frame (to distinguish the data source), transmission timestamp (to determine whether it is continuous transmission), and continuous transmission flag (to mark whether it is in the continuous transmission state of the same node).

[0064] 2) Frame structure matching. Frame structures are divided into three categories: short frames, standard frames, and long frames, and the matching is based on the data length L. (1) Short frame structure (adapted to small data of 1~2 bytes) For some high-frequency, low-frequency data on the vehicle side (such as light and button signals), the core design is "extremely simplified frame header," and the corresponding structural optimization algorithm is as follows: Input: Length of data to be transmitted L (1~2 bytes), ID of data source node (4-bit valid range), data priority P (medium / low); Output: Synchronization segment byte stream, identification segment byte stream, data segment byte stream, check segment length (fixed 1 byte), total frame length (4~6 bytes).

[0065] (2) Standard frame structure (adapted to 3~8 bytes of conventional data) Input: Length of data to be transmitted L (3~8 bytes), historical transmission context (including the node ID of the previous frame, the transmission timestamp of the previous frame, and the current transmission timestamp), and data priority P; Output: Synchronization segment byte stream, identification segment byte stream (1~2 bytes), data segment byte stream, check segment length (1 or 3 bytes), total frame length (7~13 bytes).

[0066] (3) Long frame structure (adapted to big data of 9~32 bytes) Input: Length of data to be transmitted L (9~32 bytes), ID of the data source node (2 bytes), data priority P; Output: Synchronization segment byte stream, identification segment byte stream (3 bytes), data segment byte stream (9~32 bytes), check segment length (1 or 3 bytes), total frame length (15~39 bytes).

[0067] The method provided in this invention breaks through the limitations of the traditional LIN fixed frame structure and proposes for the first time three customized structures—short frames, standard frames, and long frames—adapted to the length of the data to be transmitted (1~2 bytes / 3~8 bytes / 9~32 bytes): short frames simplify the frame header through "synchronization segment truncation + identification segment splicing"; standard frames reduce ID redundancy in continuous transmission through "time difference determination + ID reuse"; and long frames overcome the data segment length limitation through extended identifiers, reducing invalid frame header overhead at the source. The long frame single-frame extended design (breaking through the traditional LIN data segment limitation) uses an identification segment structure of "2-byte basic ID + 1-byte extended identifier," where the highest bit of the extended identifier is the long frame marker and the lower 7 bits record the data length, enabling single-frame transmission of large data of 9~32 bytes. This completely solves the problem of traditional LIN requiring the splitting of multiple frames and splicing of large data, significantly reducing the overhead of duplicate frame headers.

[0068] The embodiments of the present invention have the following beneficial effects: Significantly Improved Speed: Through frame structure optimization, scheduling upgrades, and data compression, the effective communication speed is greatly improved compared to traditional LIN, meeting the real-time requirements of intelligent cockpits and vehicle body control. Controllable Cost: No modifications are required to existing hardware, significantly reducing implementation costs. Strong Scalability: Dynamic frame structure and priority scheduling support the addition of new ECU types without protocol reconstruction, adapting to new scenarios such as low-voltage accessories and intelligent sensors in new energy vehicles.

[0069] The data communication device provided by the present invention is described below. The data communication device described below and the data communication method described above can be referred to in correspondence.

[0070] Figure 2 This is a schematic diagram of the data communication device provided by the present invention, as shown below. Figure 2 As shown, the device includes: The frame structure determination unit 210 is used to determine the target frame structure based on the data length of the data to be transmitted. The target frame structure includes short frames, standard frames, and long frames. The header length of the short frame is less than the header length of the standard LIN frame, and the maximum length of the data segment supported by the long frame is greater than the data segment length of the standard LIN frame. The frame header and frame tail optimization unit 220 is used to generate optimized frame headers and frame tails in a differentiated manner to adapt to the target frame structure. The frame header includes a synchronization segment and an identification segment, and the frame tail includes a verification segment. The combined transmission unit 230 is used to combine the frame header, the data to be transmitted, and the frame tail to form a communication frame and transmit it.

[0071] Based on the above embodiments, the frame header and frame tail optimization unit is specifically used for: If the target frame structure is a short frame, then the synchronization segment is compressed, the identification segment is simplified and spliced, and the parity check bit is removed; If the target frame structure is a standard frame, then the synchronization segment is processed for compatibility, the identification segment is determined based on the ID reuse determination algorithm, and the length of the verification segment is matched based on the priority of the data to be transmitted. If the target frame structure is a long frame, the synchronization segment is processed in a compatible manner, and an identification segment containing an extended identifier is generated. The length of the verification segment is matched based on the priority of the data to be transmitted.

[0072] Based on the above embodiments, the frame header and frame tail optimization unit is specifically used for: Extract the data source node ID of the data to be transmitted and generate a data length identifier; The node ID is shifted and then bitwise ORed with the data length identifier to obtain the identification segment.

[0073] Based on the above embodiments, the frame header and frame tail optimization unit is specifically used for: Obtain the historical transmission context, which includes the node ID of the previous frame, the transmission timestamp of the previous frame, and the current transmission timestamp; Calculate the time difference based on the previous frame transmission timestamp and the current transmission timestamp; Based on the time difference, the current node ID and the previous frame node ID, determine whether the transmission is continuous. If the transmission is continuous, the node ID of the previous frame is reused as the identification segment of the current transmission. If the transmission is discontinuous, a complete node ID including the parity bit is generated as the identification segment of the current transmission.

[0074] Based on the above embodiments, the frame header and frame tail optimization unit is specifically used for: Extract the node ID of the data to be transmitted as the basic part of the identification segment; An extended identifier is generated based on the highest-order long frame marker bit and the lower 7 length bits; The identification segment is obtained by sequentially concatenating the basic part and the extended identifier.

[0075] Based on the above embodiments, the frame header and frame tail optimization unit is specifically used for: The length of the verification segment is positively correlated with the priority; high-priority data uses a long verification segment, while low-priority data uses a short verification segment.

[0076] Based on the above embodiments, the frame structure determination unit is specifically used for: If the length of the data to be transmitted is 1-2 bytes, the target frame structure is a short frame; if the length of the data to be transmitted is 3-8 bytes, the target frame structure is a standard frame; if the length of the data to be transmitted is 9-32 bytes, the target frame structure is a long frame.

[0077] Figure 3 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 3 As shown, the electronic device may include a processor 310, a communications interface 320, a memory 330, and a communication bus 340. The processor 310, communications interface 320, and memory 330 communicate with each other via the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute a data communication method. This method includes: determining a target frame structure based on the data length of the data to be transmitted. The target frame structure includes short frames, standard frames, and long frames. The header length of the short frame is shorter than the header length of the standard LIN frame, and the maximum data segment length supported by the long frame is greater than the data segment length of the standard LIN frame. An optimized frame header and frame trailer are generated differentially in a manner adapted to the target frame structure. The frame header includes a synchronization segment and an identification segment, and the frame trailer includes a check segment. The frame header, the data to be transmitted, and the frame trailer are combined to form a communication frame and transmitted.

[0078] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0079] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the data communication method provided by the above methods. The method includes: determining a target frame structure based on the data length of the data to be transmitted, wherein the target frame structure includes a short frame, a standard frame, and a long frame, wherein the header length of the short frame is less than the header length of the standard LIN frame, and the maximum length of the data segment supported by the long frame is greater than the data segment length of the standard LIN frame; generating an optimized frame header and frame tail in a differentiated manner adapted to the target frame structure, wherein the frame header includes a synchronization segment and an identification segment, and the frame tail includes a check segment; and combining the frame header, the data to be transmitted, and the frame tail to form a communication frame and transmitting it.

[0080] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the data communication method provided by the above methods. The method includes: determining a target frame structure based on the data length of the data to be transmitted, the target frame structure including short frames, standard frames, and long frames, wherein the header length of the short frame is less than the header length of the standard LIN frame, and the maximum length of the data segment supported by the long frame is greater than the data segment length of the standard LIN frame; differentially generating an optimized frame header and frame tail in a manner adapted to the target frame structure, the frame header including a synchronization segment and an identification segment, and the frame tail including a check segment; combining the frame header, the data to be transmitted, and the frame tail to form a communication frame and transmitting it.

[0081] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0082] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data communication method, characterized in that, include: The target frame structure is determined based on the data length of the data to be transmitted. The target frame structure includes short frames, standard frames, and long frames. The header length of the short frame is shorter than the header length of the standard LIN frame, and the maximum length of the data segment supported by the long frame is greater than the data segment length of the standard LIN frame. In a manner adapted to the target frame structure, optimized frame headers and frame trailers are generated differentially. The frame header includes a synchronization segment and an identification segment, and the frame trailer includes a verification segment. The frame header, the data to be transmitted, and the frame trailer are combined to form a communication frame and then transmitted.

2. The data communication method according to claim 1, characterized in that, The step of differentially generating optimized frame headers and trailers in a manner adapted to the target frame structure includes: If the target frame structure is a short frame, then the synchronization segment is compressed, the identification segment is simplified and spliced, and the parity check bit is removed; If the target frame structure is a standard frame, then the synchronization segment is processed for compatibility, the identification segment is determined based on the ID reuse determination algorithm, and the length of the verification segment is matched based on the priority of the data to be transmitted. If the target frame structure is a long frame, the synchronization segment is processed in a compatible manner, and an identification segment containing an extended identifier is generated. The length of the verification segment is matched based on the priority of the data to be transmitted.

3. The data communication method according to claim 2, characterized in that, The simplified splicing of the identified segments includes: Extract the data source node ID of the data to be transmitted and generate a data length identifier; The node ID is shifted and then bitwise ORed with the data length identifier to obtain the identification segment.

4. The data communication method according to claim 2, characterized in that, The ID reuse determination algorithm for determining the identification segment includes: Obtain the historical transmission context, which includes the node ID of the previous frame, the transmission timestamp of the previous frame, and the current transmission timestamp; Calculate the time difference based on the previous frame transmission timestamp and the current transmission timestamp; Based on the time difference, the current node ID and the previous frame node ID, determine whether the transmission is continuous. If the transmission is continuous, the node ID of the previous frame is reused as the identification segment of the current transmission. If the transmission is discontinuous, a complete node ID including the parity bit is generated as the identification segment of the current transmission.

5. The data communication method according to claim 2, characterized in that, The generation of the identification segment containing the extended identifier includes: Extract the node ID of the data to be transmitted as the basic part of the identification segment; An extended identifier is generated based on the highest-order long frame marker bit and the lower 7 length bits; The identification segment is obtained by sequentially concatenating the basic part and the extended identifier.

6. The data communication method according to claim 2, characterized in that, The priority matching check segment length based on the data to be transmitted includes: The length of the verification segment is positively correlated with the priority; high-priority data uses a long verification segment, while low-priority data uses a short verification segment.

7. The data communication method according to any one of claims 1 to 6, characterized in that, The determination of the target frame structure based on the data length of the data to be transmitted includes: If the length of the data to be transmitted is 1-2 bytes, the target frame structure is a short frame; if the length of the data to be transmitted is 3-8 bytes, the target frame structure is a standard frame; if the length of the data to be transmitted is 9-32 bytes, the target frame structure is a long frame.

8. A data communication device, characterized in that, include: A frame structure determination unit is used to determine the target frame structure based on the data length of the data to be transmitted. The target frame structure includes short frames, standard frames, and long frames. The header length of the short frame is less than the header length of the standard LIN frame, and the maximum length of the data segment supported by the long frame is greater than the data segment length of the standard LIN frame. The frame header and frame tail optimization unit is used to generate optimized frame headers and frame tails in a differentiated manner to adapt to the target frame structure. The frame header includes a synchronization segment and an identification segment, and the frame tail includes a verification segment. A combined transmission unit is used to combine the frame header, the data to be transmitted, and the frame trailer to form a communication frame and transmit it.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the data communication method as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the data communication method as described in any one of claims 1 to 7.