Data transmission method, vehicle and storage medium
By constructing a complete protocol stack to split and encapsulate the data between the SOC and MCU, the problem of low communication efficiency is solved, and high-speed and reliable data transmission is achieved.
Patent Information
- Application Number
- CN202511917047.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-03-24
AI Technical Summary
In the existing technology, the communication efficiency between the system-on-a-chip (SOC) and the microcontroller unit (MCU) is low, especially in the SPI data packet transmission, where the lack of a structured software protocol stack leads to low communication efficiency and makes it difficult to meet the requirements of efficient and reliable data transmission.
A complete protocol stack was constructed, comprising a physical layer, a driver layer, a data link layer, a transport layer, an application layer, and a service layer. This protocol stack is used to decompose and encapsulate the data to be transmitted, enabling high-speed and reliable data interaction.
It improves data communication efficiency, solves the problem of low data communication efficiency, and meets the needs of efficient and reliable data transmission.
Smart Images

Figure CN121728175A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of embedded system communication, and more specifically, to a data transmission method, a vehicle, and a storage medium. Background Technology
[0002] Currently, in modern smart devices and automotive electronics, system-on-a-chip (SoC) and microcontroller unit (MCU) are often used in conjunction. The SoC is usually responsible for running complex operating systems and applications, while the MCU is responsible for debugging, control, power management, or processing sensor data. Efficient and reliable communication between the two is crucial for the stable operation of the system.
[0003] In related technologies, the traditional communication method between SOC and MCU is usually simple Serial Peripheral Interface (SPI) data packet transmission. This method simply builds application data directly on top of SPI, which has the technical problem of low data communication efficiency.
[0004] There is currently no good solution to the above problems. Summary of the Invention
[0005] This application provides a data transmission method, a vehicle, and a storage medium to at least solve the technical problem of low data communication efficiency.
[0006] According to one aspect of the embodiments of this application, a data transmission method is provided. The vehicle includes: at least one master device and at least one slave device. The master device and the slave device transmit data through a protocol stack, which includes an application layer, a service layer, a transport layer, a data link layer, a physical layer, and a driver layer. The method may include: in response to the master device transmitting data to be transmitted to the application layer, using the service layer to transmit the data to be transmitted from the application layer to the transport layer via the physical layer, wherein the data to be transmitted is to be transmitted to a target slave device among the at least one slave device; in the transport layer, determining the transmission mode of the data to be transmitted, and according to the transmission mode, dividing the data to be transmitted into at least one data frame according to a number of divisions, wherein the transmission mode is matched with a number of divisions; calling the data link layer to encapsulate the at least one data frame to obtain at least one link layer frame; calling the physical layer to transmit the at least one link layer frame to the target slave device through the driver layer at a preset transmission frequency.
[0007] Furthermore, the physical layer is invoked, and through the driver layer, at least one link layer frame is transmitted to the target slave device according to a preset transmission frequency. This includes: using the driver layer to convert at least one link layer frame into a serial peripheral interface (SPI) signal; and using the hardware controller in the physical layer to transmit the SPI signal to the target slave device according to the transmission frequency.
[0008] Furthermore, the method may also include: invoking the hardware controller to set the transmission frequency corresponding to the master device.
[0009] Furthermore, in the transport layer, the transmission mode of the data to be transmitted is determined, including: calling the transport layer to determine the amount of data to be transmitted, and determining the transmission mode based on the amount of data.
[0010] Furthermore, based on the data volume, the transmission mode is determined, including: in response to the data volume being greater than a data volume threshold, determining the transmission mode as a multi-frame transmission mode; and in response to the data volume being less than or equal to the data volume threshold, determining the transmission mode as a single-frame transmission mode.
[0011] Furthermore, the data link layer is invoked to encapsulate at least one data frame to obtain at least one link layer frame, including: obtaining the encapsulation data corresponding to the data frame, wherein the encapsulation data is used to verify the integrity of the data frame; and invoking the data link layer to combine the encapsulation data and the data frame to obtain the link layer frame.
[0012] Furthermore, the method may also include: in response to the target slave device acquiring at least one link layer frame, invoking the data link layer to verify at least one link layer frame in the target slave device, and obtaining a verification result, wherein the verification result is used to characterize the integrity of the link layer frame.
[0013] Furthermore, the method may also include: in response to the verification result indicating that the integrity of the link layer frame is greater than a threshold, parsing at least one link layer frame to obtain at least one data frame; and in response to the transmission mode being a multi-frame transmission mode, combining at least one data frame to obtain data to be transmitted.
[0014] According to another aspect of the embodiments of this application, a data transmission apparatus is also provided. The vehicle includes: at least one master device and at least one slave device. The master device and the slave device transmit data through a protocol stack, which includes an application layer, a service layer, a transport layer, a data link layer, a physical layer, and a driver layer. The apparatus may include: a first transmission unit, configured to, in response to the master device transmitting data to be transmitted to the application layer, use the service layer to transmit the data to be transmitted from the application layer to the transport layer via the physical layer, wherein the data to be transmitted is to be transmitted to a target slave device among the at least one slave device; a determination unit, configured to, in the transport layer, determine the transmission mode of the data to be transmitted, and, according to the transmission mode, divide the data to be transmitted into at least one data frame according to a number of divisions, wherein the transmission mode is matched with a number of divisions; an encapsulation unit, configured to, invoke the data link layer to encapsulate the at least one data frame to obtain at least one link layer frame; and a second transmission unit, configured to, invoke the physical layer, transmit the at least one link layer frame to the target slave device via the driver layer at a preset transmission frequency.
[0015] According to another aspect of the embodiments of this application, a vehicle is also provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of this application when it runs.
[0016] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of this application.
[0017] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods of various embodiments of this application.
[0018] According to another aspect of the embodiments of this application, a computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the methods in various embodiments of this application.
[0019] According to another aspect of the embodiments of this application, a computer program is also provided, which, when executed by a processor, implements the methods of the various embodiments of this application.
[0020] In this embodiment, in response to the master device transmitting data to the application layer, the service layer transmits the data from the application layer to the transport layer via the physical layer. The data is intended to be transmitted to a target slave device among at least one slave device. In the transport layer, the transmission mode of the data is determined, and according to the transmission mode, the data is divided into at least one data frame according to the number of divisions required. The transmission mode is matched with the number of divisions. The data link layer is invoked to encapsulate the at least one data frame, obtaining at least one link layer frame. The physical layer is invoked, and through the driver layer, the at least one link layer frame is transmitted to the target slave device at a preset transmission frequency. That is, in this application, a complete protocol stack including the physical layer, driver layer, data link layer, transport layer, application layer, and service layer is constructed. By utilizing this protocol stack, the data to be transmitted by the master device is divided into at least one data frame, the data frame is encapsulated, and the encapsulated data frame is transmitted to the slave device, thereby completing the data transmission and achieving the technical effect of improving data communication efficiency, thus solving the technical problem of low data communication efficiency. Attached Figure Description
[0021] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0022] Figure 1 This is a flowchart of a data transmission method according to an embodiment of this application;
[0023] Figure 2 This is a schematic diagram of a master-slave device state machine according to an embodiment of this application;
[0024] Figure 3 This is a schematic diagram illustrating a data transmission process between a master device and a slave device according to an embodiment of this application;
[0025] Figure 4 This is a schematic diagram of a dual-channel SPI full-duplex connection between a master device and a slave device according to an embodiment of this application;
[0026] Figure 5 This is a schematic diagram of a data transmission device according to an embodiment of this application. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0029] According to an embodiment of this application, a method embodiment for data transmission is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0030] Currently, in modern smart devices and automotive electronics, System-on-a-Chip (SoC) and Microcontroller Unit (MCU) are often used in conjunction. The SoC is typically responsible for running complex operating systems and applications, while the MCU is responsible for debugging, control, power management, or processing sensor data. Efficient and reliable communication between the two is crucial for the stable operation of the system.
[0031] Traditional SOC-MCU communication methods can include: General Purpose Input / Output Polling (GPIO), Universal Asynchronous Receiver / Transmitter (UART), or simple SPI data packet transmission. However, GPIO polling consumes significant Central Processing Unit (CPU) resources; UART is slow and cannot meet the demands of large data volumes or real-time requirements. Furthermore, these methods lack robust error detection and handling mechanisms, making data transmission errors difficult to detect and recover from. Their simple communication also makes it difficult to support complex application-layer data structures and the distribution of multiple message types. For scenarios requiring bidirectional high-speed, low-latency responses, such as real-time control commands and status feedback, single-channel SPI communication becomes a bottleneck. Moreover, although the SPI bus itself possesses high-speed, full-duplex characteristics, its advantages cannot be fully realized without a structured software protocol stack.
[0032] In related technologies, application data is usually built directly on top of SPI, which leads to protocol confusion, maintenance difficulties, and difficulty in ensuring communication robustness. Therefore, the above methods have the technical problem of low data communication efficiency.
[0033] To address the aforementioned issues, this embodiment proposes a high-efficiency SPI cross-core communication system based on a layered protocol. This system constructs a complete protocol stack comprising a physical layer, a driver layer, a data link layer, a transport layer, an application layer, and a service layer. Through this protocol stack, high-speed, reliable, and structured data interaction is achieved.
[0034] Optionally, this embodiment constructs a complete protocol stack including a physical layer, a driver layer, a data link layer, a transport layer, an application layer, and a service layer. By utilizing this protocol stack, the data to be transmitted by the master device is split into at least one data frame, the data frame is encapsulated, and the encapsulated data frame is transmitted to the slave device, thereby completing the data transmission. This achieves the technical effect of improving data communication efficiency and solves the technical problem of low data communication efficiency.
[0035] This embodiment provides a data transmission method, which is an efficient and reliable cross-core communication method between a system-on-a-chip (SOC) and a microcontroller (MCU) based on a Serial Peripheral Interface (SPI) bus. The vehicle includes at least one master device and at least one slave device. Data transmission between the master and slave devices is performed through a protocol stack, which includes an application layer, a service layer, a transport layer, a data link layer, a physical layer, and a driver layer.
[0036] Optionally, the physical layer can be based on an SPI hardware controller, configuring the SPI clock polarity and phase, and using a rising-edge sampling and falling-edge shifting mode for data transmission. The driver layer provides the initial SPI call function and integrates an interrupt notification mechanism to reduce polling overhead. The data link layer can be used to define fixed-length SPI frames, for example, 64 bytes, with each frame containing a synchronization code (Sync), data length (DLC), rolling count (RC), checksum, and data field. The synchronization code can be fixed-padded and used for frame synchronization. The rolling count can be used to monitor for data frame loss. The cyclic checksum can be used to verify the RC, DLC, and data field to ensure data integrity.
[0037] Optionally, the aforementioned transport layer can be used to process variable-length data blocks from the application layer. When the data length exceeds the payload of a single frame, a fragmentation transmission mechanism can be employed, using a mask byte to distinguish frame types. Frame types can include single-frame mode (SF) and multi-frame mode. In single-frame mode, data length is less than or equal to 57 bytes, and transmission is completed within one frame. In multi-frame mode, data length is greater than 57 bytes, divided into a first frame (FF) and consecutive frames (CF). The first frame carries total length information, consecutive frames contain fragment sequence numbers (Count), and the last frame is marked with a specific flag indicating its end.
[0038] Optionally, the aforementioned application layer can also be called the protocol application layer. It can be a state machine used to define the master or slave device. This state machine can include states such as idle, receive, send, and fault, and is used to specify the interaction process of message transmission. For example, the complete process of the MCU sending data to the SOC includes: the MCU sending a data frame, the SOC responding with a receive status, and the MCU confirming a status, forming a closed loop.
[0039] Optionally, the aforementioned service layer can be used to distribute data with upper-layer functional applications through process communication, seamlessly connecting the underlying communication data to specific application services.
[0040] Figure 1 This is a flowchart of a data transmission method according to an embodiment of this application. Figure 1 As shown, the method may include the following steps:
[0041] In step S102, in response to the master device transmitting the data to be transmitted to the application layer, the service layer is used to transmit the data to be transmitted from the application layer to the transport layer via the physical layer, wherein the data to be transmitted is to be transmitted to a target slave device in at least one slave device.
[0042] In the technical solution provided in step S102 of this application, the master device can be used to control the entire communication process, including initiating data exchange, determining the data transmission rate, providing clock signals (SCLK), chip select signals (CS), and other communication parameters. For example, in most SOC-MCU communication scenarios, the SOC acts as the master device because the SOC has more powerful processing capabilities and usually runs more complex software systems. The slave device is used to respond to the communication requests of the master device, exchange data according to the parameters set by the master device, and can wait for commands from the master device, then transmit or receive data through the synchronization signals of SCLK and CS. For example, the slave device can be an MCU. The device to be transmitted can be a device collected or acquired by the master device, such as data collected by a vehicle during operation.
[0043] Optionally, the application layer can be used to control the status of the master device and / or slave devices. The master device can transmit data to be transmitted to the application layer. After the master device transmits the data to be transmitted to the application layer, it can call the application layer to determine the target slave device to receive the data from at least one slave device, and use the service layer to transmit the data from the application layer to the transport layer.
[0044] Optionally, the SPI bus connection can be either a single-channel full-duplex connection or a dual-channel full-duplex connection. A single-channel full-duplex connection is suitable for general communication needs, where the MCU can act as the master and the SOC as the slave. In a dual-channel SPI connection, the MCU and SOC can mutually connect as master and slave, enabling true bidirectional high-speed concurrent communication for scenarios with extremely high bidirectional real-time requirements.
[0045] Optionally, in a dual-channel SPI design, due to the master-slave relationship, only the transport layer needs to be used for transmission; there is no need to wait for the slave device's synchronization response. In a single-channel SPI design, if an MCU is present, the MCU acts as the master device. The master device needs to set the data link layer (Sync) to 0x36 to send information, and after sending the information, it needs to set Sync to 0x06 to read the slave device's feedback. When the slave device needs to send information, it needs to add a communication request signal to the feedback information. The master device performs a transmission at least every 500 milliseconds and obtains the slave device's status. Both the master and slave devices need their own state machines.
[0046] Figure 2 This is a schematic diagram of a master-slave device state machine according to an embodiment of this application, as shown below. Figure 2As shown, the states can include: Initialization (Init) state, DeInit state, Idle (Idel) state, Receive state, Send state, and Fault state.
[0047] Optionally, both the MCU and SOC enter an initialization state when the device powers on or the system restarts. The purpose of this state is to configure SPI bus parameters, such as clock polarity, phase, data width, and transmission rate, as well as to initialize the software protocol stack, ensuring the two devices are ready to communicate. If it is necessary to disable or reconfigure SPI communication, the device can enter the deinitialization state. In this state, all resources can be released, the SPI bus can be shut down, data transmission can be stopped, and preparations can be made for the next communication.
[0048] Optionally, when the devices are not transmitting data, the master and slave devices (hereinafter referred to as master and slave devices) will be in an idle state. In this state, the devices will wait for a receive request or poll each other to determine whether data transmission needs to begin. When a device receives data, it will enter the receive state. For example, the MCU may switch from the idle state to the receive state when it detects that the SOC has sent a data request. In the receive state, the MCU will prepare the receive buffer, activate the receive interrupt, parse the received frame structure, and check for errors (such as Sync errors, RC errors, or Checksum errors). If the received data is error-free, the MCU will proceed to the next state transition; if there are errors, it may enter a fault state.
[0049] Optionally, the master / slave device can switch to transmit mode when it needs to send data. For example, the SOC may switch from idle mode to transmit mode when it needs to send control commands to the MCU. In transmit mode, the device will fragment the data according to the transport layer protocol (if necessary), fill the data link layer frame structure, activate the transmit interrupt, and send the data via the SPI bus.
[0050] Optionally, if any error is detected during communication, the device (master / slave) will enter a fault state. In a fault state, the device will stop data transmission, record the error type, and may attempt error recovery procedures, such as restarting the physical layer configuration, clearing the error state, etc., and then typically attempts to return to an idle state to restart communication.
[0051] Optionally, the state machine ensures the orderliness and reliability of data transmission. Through a closed-loop control mechanism, namely, the sender waits for the receiver's confirmation after sending data, and the receiver sends a status confirmation to the sender after receiving data, the entire communication process becomes more controllable and efficient.
[0052] In this embodiment, the application layer is used to set the state of the master device and / or slave device in order to control the transmission of data to be transmitted from the application layer to the transport layer.
[0053] Step S104: In the transport layer, determine the transmission mode of the data to be transmitted, and according to the transmission mode, divide the data to be transmitted into at least one data frame according to the number of divisions, wherein the transmission mode is matched with the number of divisions.
[0054] In the technical solution provided in step S104 of this application, the transmission mode may include a single-frame mode and a multi-frame mode, which can be determined according to the data length of the data to be transmitted. The number of data segments can be determined according to the transmission mode. For example, if the transmission mode is a single-frame mode, the number of segments can be determined to be 0, that is, no data segmentation is required. If the transmission mode is a multi-frame mode, the number of segments can be determined to be multiple. The data frame can be an SPI frame.
[0055] Optionally, the transport layer is used to process the data to be transmitted. In the transport layer, the data to be transmitted can be divided into at least one data frame according to the transmission mode and the number of segments.
[0056] In this embodiment, the layered protocol is clearly defined, with each layer's responsibilities clearly defined, facilitating development, debugging, and maintenance. The transport layer's fragmentation mechanism supports the transmission of data of arbitrary length, and the application and service layer designs facilitate integration with various upper-layer applications. High-speed SPI and layered protocol optimization enable rapid transmission of large data volumes. Dual-channel SPI addresses the unidirectional bottleneck, meeting the requirements for high-real-time bidirectional communication.
[0057] In this embodiment, the transport layer transmits variable-length data blocks between the SOC-MCU application layer. Fragmentation is performed according to the fixed-length design of the data link layer. At the sending end, the message is provided to the transport protocol, which sends it to the client via the data link protocol and notifies the application of success upon completion.
[0058] Optionally, at the receiving end, the application provides a buffer that is filled with correctly received messages by the transport protocol.
[0059] Optionally, the transport layer data structure may include: the transport layer data transmission mode is divided into single frame mode (SF) and multi-frame mode, wherein the multi-frame mode includes the first frame (FF) and consecutive frames (CF), which are distinguished by a mask (the first byte of the transport layer).
[0060] Table 1 is a description table of Mask. As shown in Table 1, the description of Mask (Byte0) is as follows:
[0061] Table 1 Description of Mask
[0062]
[0063] Step S106: Invoke the data link layer to encapsulate at least one data frame to obtain at least one link layer frame.
[0064] In the technical solution provided in step S106 of this application, the data link layer can be invoked to encapsulate at least one data frame to obtain at least one link layer frame.
[0065] Optionally, each data frame is encapsulated at the data link layer, with Sync code, RC, DLC and Checksum added to form a complete link layer frame. That is, a link layer header (which may include Sync, DLC, RC and Checksum) is added to each data frame to obtain a link layer frame, and the link layer frame is sent via SPI.
[0066] Optionally, the data link can establish a handshake mechanism to communicate, and a configurable fixed-length fragmentation mechanism can be used to split the long application data of SPI into several top-length data segments for transmission. Each frame needs to have a start symbol and an end symbol. The buffer caches application layer data.
[0067] Optionally, the transmitted data has the necessary verification mechanisms, such as CRC and Checksum.
[0068] For example, the current fixed length of the SPI data link layer is defined as 64 bytes, that is, the maximum data packet length on the SPI bus is 64 bytes. Table 2 is the structure table of the link layer frame. As shown in Table 2, the structure of the link layer frame can include: Sync, DLC, RC, and Checksum.
[0069] Table 2. Structure of Link Layer Frames
[0070]
[0071] Optionally, the data link layer provides services to the transport layer on top of the services provided by the physical layer, serving as reliable data to be transmitted. Here, Sync can be used for synchronous compilation, with a fixed padding of 0x36. RC can be a rolling counter used to monitor for frame loss. DLC can indicate the effective data length of the data field. Checksum can be a cyclic CAPTCHA for error checking. Data can be the data field.
[0072] Step S108: Invoke the physical layer and transmit at least one link layer frame to the target slave device through the driver layer at a preset transmission frequency.
[0073] In the technical solution provided in step S108 of this application, the physical layer can be invoked, and at least one link layer frame can be transmitted to the target slave device through the driver layer at a preset transmission frequency.
[0074] Optionally, the physical layer is controlled to transmit the data to be transmitted to the transport layer; in the transport layer, the transmission mode of the data to be transmitted is determined, and the data to be transmitted is divided into at least one data frame according to the transmission mode, wherein the transmission mode is used to determine the number of data frames to be transmitted; the data link layer is called to encapsulate the at least one data frame to obtain at least one link layer frame; the physical layer is called to transmit the at least one link layer frame to the target slave device through the driver layer according to a preset transmission frequency.
[0075] Optionally, after receiving the data to be transmitted, the service layer performs preliminary format checks and preparations, such as checking the integrity of the timestamp and data type fields, and then converts the data into a format that the transport layer can recognize. Since the data to be transmitted may be large (e.g., a JSON data packet may exceed 57 bytes), the transport layer determines to use a multi-frame mode for transmission. Assuming the data packet is 100 bytes in total, it needs to be split into two data frames. The data is split into two parts: the first part contains the command and data type information, and the second part may contain the timestamp or additional request information. For data frame one, the data link layer adds a Sync code (0x36), DLC (data length code, assumed to be 57), RC (roll count, assumed to be 1), and Checksum (calculated based on the previous fields) to the header of data frame one, forming a link layer frame. For data frame two, the data link layer similarly adds a Sync code, DLC (assumed to be 43), RC (roll count, assumed to be 2), and Checksum to the header of data frame two, forming a second link layer frame. The driver layer is responsible for configuring SPI hardware parameters, such as clock frequency and data width, and preparing an interrupt mechanism to notify of data transmission completion. Data is transmitted via the Master OutSlave In (MOSI) pin of the SPI bus. The MISO pin is in a high-impedance state until the slave device responds. The driver layer controls the SPI hardware to start sending the first link layer frame (i.e., the link layer encapsulation of data frame one) and waits for the slave device's response after completing the transmission.
[0076] Furthermore, the MCU (as a slave device) detects the CS signal going low and begins receiving data from the SOC. The MCU first checks the Sync code, then reads the DLC, RC, and Checksum to confirm the integrity and correctness of the data frame. After confirming the first frame is correct, the SOC continues sending the second frame (i.e., the link layer encapsulation of data frame two). The MCU receives and checks the second frame. After receiving all data, the MCU sends an acknowledgment frame to the SOC, which then receives and acknowledges the slave device's response through the physical layer, completing one communication cycle.
[0077] Through the steps described above, even if the original data size exceeds the limit of a single SPI transmission frame, efficient and reliable data transmission can be achieved through fragmentation and link-layer encapsulation mechanisms. Communication between master and slave devices is controlled by a hierarchical protocol and state machine, ensuring data integrity and communication stability.
[0078] Optionally, in a product system, the MCU is responsible for collecting data on the CAN bus and forwarding it to the SOC, while the SOC is responsible for executing vehicle control parameters and sending them to the MCU. The two are connected as master and slave via dual-channel SPI. When the MCU collects data to be transmitted (approximately 100 bytes) and needs to report it to the SOC: the MCU (as the master device) initiates communication with the SOC (as the slave device) through the physical and driver layers of one SPI channel. The data link layer completes the handshake (Sync 0x36 -> Response 0x76); the transport layer splits the 100 bytes into a first frame (FF, 57 bytes of valid data) and consecutive frames (CF, 43 bytes of valid data); each frame adds a link layer header (Sync, DLC, RC, Checksum) to encapsulate the data frame, resulting in a link layer frame, which is then sent via SPI. The SOC (i.e., the slave device) receives and verifies all frames, reassembles the data, and transmits it to the SOC's application through the service layer. Simultaneously, the SOC can send control commands to the MCU via another SPI channel (SOC as master, MCU as slave), without interference.
[0079] Through steps S102 to S108 above, in response to the master device transmitting data to be transmitted to the application layer, the service layer transmits the data to be transmitted from the application layer to the transport layer via the physical layer, wherein the data to be transmitted is to be transmitted to a target slave device among at least one slave device; in the transport layer, the transmission mode of the data to be transmitted is determined, and according to the transmission mode, the data to be transmitted is divided into at least one data frame according to the number of divisions, wherein the transmission mode is matched with the number of divisions; the data link layer is invoked to encapsulate the at least one data frame to obtain at least one link layer frame; the physical layer is invoked, and the at least one link layer frame is transmitted to the target slave device through the driver layer according to a preset transmission frequency. In other words, this application constructs a complete protocol stack that includes a physical layer, a driver layer, a data link layer, a transport layer, an application layer, and a service layer. By utilizing this protocol stack, the data to be transmitted by the master device is split into at least one data frame, the data frame is encapsulated, and the encapsulated data frame is transmitted to the slave device, thereby completing the data transmission. This achieves the technical effect of improving data communication efficiency and solves the technical problem of low data communication efficiency.
[0080] The above-mentioned method of this application will be further described below.
[0081] As an optional implementation, step S108, which calls the physical layer and transmits at least one link layer frame to the target slave device through the driver layer at a preset transmission frequency, includes: using the driver layer to convert at least one link layer frame into a serial peripheral interface (SPI) signal; and using the hardware controller in the physical layer to transmit the SPI signal to the target slave device at the transmission frequency.
[0082] In this embodiment, in the master device, after the transport layer completes the fragmentation and encapsulation of data frames, it can call the driver layer to prepare for the actual SPI signal transmission. The driver layer converts the data in the link layer frame (including Sync code, DLC, Checksum, RC, and Data fields) into a signal format that SPI can understand, while ensuring the correct configuration of the SPI clock and data signals. For example, based on the SPI clock polarity and phase, the SPI hardware controller is configured to match preset communication parameters (clock frequency, data mode, etc.). The driver layer converts the binary data in the link layer frame into SPI signals for transmission via the SPI bus. Further, using the SPI signals prepared by the driver layer, the physical layer hardware controller (such as an SPI interface controller) sends the signals to the target slave device at a preset transmission frequency.
[0083] Optionally, the physical layer initializes the SPI bus parameters based on the SPI hardware controller, setting the correct clock frequency and data mode to ensure compatibility with the SPI interface of the slave device. By activating the Chip Select (CS) signal, the physical layer specifies that the target slave device is ready to receive SPI data. The hardware controller sends the SPI signal to the slave device's MISO (Master Input Slave Output) pin via the MOSI (Master Output Slave Input) pin according to a preset transmission frequency. Simultaneously, the hardware controller provides clock pulses via the SPI SCLK (Serial Clock) signal line to synchronize data transmission and reception. After data transmission is complete, the hardware controller waits for a response from the target slave device, receiving it via the MISO pin to ensure data transmission integrity and closed-loop communication.
[0084] Optionally, through the coordinated operation of the driver layer and the physical layer, the SPI signal can accurately and efficiently complete data transmission at a preset frequency.
[0085] Optionally, the SPI driver configuration may include: SPI clock polarity configured to be low level when idle, i.e., CPOL=0; SPI clock phase configured to acquire data on the rising edge and shift data on the falling edge, i.e., CPHA=0; the recommended SPI transmission rate is 10 megabits per second (Mbps); the SPI transmission data width is in units of 8 bits per second (bits) / 16 bits / 32 bits; the SPI data transmission direction is the most significant bit (MSB); SPI transmits data in a data stream mode, i.e., SPI transmits the entire specified length of data during a single chip select enable period. It should be noted that the above values are only illustrative examples and can be selected according to the actual situation.
[0086] As an optional implementation, the method may further include: calling the hardware controller to set the transmission frequency corresponding to the master device.
[0087] In this embodiment, the transmission frequency corresponding to the master device can be set in advance using a hardware controller. When data to be transmitted needs to be transmitted, the data can be transmitted according to the set transmission frequency.
[0088] As an optional implementation, step S106 involves determining the transmission mode of the data to be transmitted in the transport layer, including: calling the transport layer to determine the amount of data to be transmitted, and determining the transmission mode based on the amount of data.
[0089] In this embodiment, the transport layer is responsible for segmenting or merging data into appropriate sizes for transmission through the data link layer. The transport layer handles variable-length data blocks. In an SPI communication system, the transport layer can select single-frame or multi-frame mode based on the size of the data to be transmitted, ensuring correct sending and receiving. The transport layer can also be used to maintain the order and integrity of transmissions.
[0090] As an optional implementation, the transmission mode is determined based on the data volume, including: determining the transmission mode as a multi-frame transmission mode in response to the data volume being greater than a data volume threshold; and determining the transmission mode as a single-frame transmission mode in response to the data volume being less than or equal to the data volume threshold.
[0091] In this embodiment, the aforementioned data volume threshold can be a preset value, a data volume set according to actual needs, or a single frame payload.
[0092] Optionally, if the data volume is greater than the data volume threshold, the transmission mode can be determined to be a multi-frame transmission mode; if the data volume is less than the data volume threshold, the transmission mode can be determined to be a single-frame transmission mode.
[0093] For example, a data size threshold can be set to 57 bytes. When the application layer data to be transmitted is less than 57 bytes, the single-frame transport layer message contains complete information. Therefore, the transmission mode can be determined as single-frame transmission mode. Table 3 shows the structure of a single-frame transport layer message. As shown in Table 3, a single-frame transport layer message can include: fragmentation mask, fragmentation sequence number, effective data length, and effective data field.
[0094] Table 3. Transport Layer Message Structure of a Single Frame
[0095]
[0096] Optionally, when the application layer data to be transmitted is greater than 57 bytes, the data cannot be sent in a single transport layer message. Therefore, the transmission mode can be determined to be a multi-frame transmission mode. The protocol needs to split the data to be transmitted into several transport layer messages, divided into first frame and continuous frame formats. Table 4 is the structure table of the first frame transport layer message. As shown in Table 4, the first frame is similar to a single frame, only the mask is different.
[0097] Table 4. First Frame Transport Layer Message Structure
[0098]
[0099] Optionally, Table 5 is a continuous frame transport layer message structure table. As shown in Table 5, a continuous frame contains a non-last frame of the continuous frame and the last frame of the continuous frame. The only difference in format is the mask code.
[0100] Table 5. Continuous Frame Transport Layer Message Structure Table
[0101]
[0102] As an optional implementation, the data link layer is invoked to encapsulate at least one data frame to obtain at least one link layer frame, including: obtaining the encapsulation data corresponding to the data frame, wherein the encapsulation data is used to verify the integrity of the data frame; and invoking the data link layer to combine the encapsulation data and the data frame to obtain the link layer frame.
[0103] In this embodiment, the encapsulated data may include, but is not limited to, a synchronization code, data length, rolling count, checksum, and data field. By introducing a synchronization code, rolling count, and checksum, problems such as frame loss and data errors can be effectively detected. The handshake mechanism and closed-loop mechanism should ensure the reliability of communication.
[0104] Optionally, to obtain the encapsulated data corresponding to the data frame, the data link layer can be called to combine the encapsulated data and the data frame to obtain the link layer frame. For example, they can be combined in a specific order to obtain the link layer frame.
[0105] Optionally, the master device sends a Sync code, which must be less than 0x40. The slave device responds with Sync+0x40; otherwise, data synchronization failure can be confirmed. Both master and slave devices need to record the RC (Record Response) and record faults. The master device needs to calculate the Checksum, and the slave device needs to perform verification based on the DLC (Data Link Context). The Checksum includes the RC, and the DLC includes both the Checksum and the RC. No retransmission operation is performed after an error occurs at the data link layer.
[0106] Optionally, Table 6 is an error type table. As shown in Table 6, errors during data transmission can include: Sync errors, RC errors, and Checksum exceptions.
[0107] Table 6 Error Type Table
[0108]
[0109] As an optional implementation, the method may further include: in response to the target slave device acquiring at least one link layer frame; invoking the data link layer to verify at least one link layer frame in the target slave device, and obtaining a verification result, wherein the verification result is used to characterize the integrity of the link layer frame.
[0110] In this embodiment, when the target obtains at least one link layer frame from the device, the data link layer can be invoked to verify at least one link layer frame in the target device, and the verification result can be obtained. Based on the verification result, the integrity of the link layer frame can be determined.
[0111] Optionally, after transmitting the data to be transmitted from the master device to the target slave device, the data link layer can be invoked to verify the encapsulated data in the link layer frame in order to determine the integrity of the data in the link layer.
[0112] As an optional implementation, the method may further include: in response to a verification result indicating that the integrity of a link layer frame is greater than a threshold, parsing at least one link layer frame to obtain at least one data frame; and in response to a transmission mode being a multi-frame transmission mode, combining at least one data frame to obtain data to be transmitted.
[0113] In this embodiment, if the verification result is greater than the degree threshold for characterizing the integrity of the link layer frame, at least one link layer frame can be parsed to obtain at least one data frame; if the transmission mode is a multi-frame transmission mode, all the obtained data frames can be combined to obtain the data to be transmitted.
[0114] Optionally, the data link layer parses the received frames, checking the Sync code, RC, DLC, and Checksum to ensure data integrity and correctness. If the data is transmitted in multi-frame mode, the transport layer reassembles the fragmented data to restore the original variable-length data blocks. The reassembled data is then passed to the application layer through the service layer for application logic processing; for example, the SOC processes CAN data and makes corresponding control responses.
[0115] Figure 3 This is a schematic diagram illustrating a data transmission process between a master device and a slave device according to an embodiment of this application, as shown below. Figure 3 As shown, in SPI communication, the Master In Slave Out (MISO) line is used for the slave device to send data to the master device. The Master Out Slave In (MOSI) line is used for the master device to send data to the slave device. The Clock (CLK) line is the clock signal line of the SPI bus, controlled by the master device, and used for synchronous data transmission. The Chip Select (CS) line is used by the master device to select the slave device to communicate with. In a multi-slave SPI system, each slave device typically has an independent CS signal line; when the CS line is pulled low, the corresponding slave device is selected for communication. These signal lines constitute the basic architecture of the SPI bus, allowing the master device and one or more slave devices to perform full-duplex synchronous data transmission.
[0116] For example, in a product system, the MCU is responsible for collecting data on the CAN bus and forwarding it to the SOC. The two are connected via a single-channel SPI master-slave connection. Now, the MCU needs to send a single frame of data. The corresponding parameters can be set according to Table 1. Table 7 is the parameter setting table for the single frame data transmission process. As shown in Table 7, the master device fills in data ① according to Table 1. Since the slave device cannot predict how much data it needs to receive in the idle state, the DLC is filled with 0x00. Other key data are similar, and details are shown in data filling ② in Table 1. Among them, ① and ② in Table 1 are the parameter settings of the master device and the slave device when sending data, respectively; ③ and ④ are the parameter settings of the master device and the slave device after the data transmission is completed, respectively. Since it is necessary to read whether the reception is completed, the master device fills in data ③. The slave device responds to the information sent in ① and feeds back the reception status to the master device, thus completing ④.
[0117] Table 7 Parameter Setting Table for Single-Frame Data Transmission
[0118]
[0119] For another example, in a product system, the MCU is responsible for collecting data from the CAN bus and forwarding it to the SOC. The two are connected via a single-channel SPI master-slave connection. Now, the SOC needs to send multiple frames of data, assuming the data length is 200 bytes. Table 8 shows the parameter settings during multi-frame data transmission. As shown in Table 8, after the last data transmission is completed, the SOC requests to send data. Alternatively, the MCU polls the SOC every 500 milliseconds (ms) to see if it needs to request data. In Table 8, ① represents the 500ms polling and response, and ② indicates that the SOC needs to send data. For sending the first frame, refer to ③ and ④ for data filling. For sending consecutive frames, refer to ⑤, ⑥, ⑦, and ⑧ for data filling. For sending the last frame, refer to ⑨ and ⑩ for data filling. For transmit / receive status, refer to A and B for data filling. It should be noted that the numbers in the above table are for illustrative purposes only and are not specific limitations.
[0120] Table 8 Parameter Settings for Multi-Frame Data Transmission
[0121]
[0122] Figure 4 This is a schematic diagram of a dual-channel SPI full-duplex connection between a master device and a slave device according to an embodiment of this application, as shown below. Figure 4 As shown, the MOSI transmit signal line is used by the master device to output data, and the slave device receives data through this line. The MISO receive signal line is used by the master device to receive data. Figure 4 The diagram shows two independent SPI buses, each consisting of four main signal lines: MISO, MOSI, SCLK, and CS. Each SPI bus can be used for both data transmission and reception, achieving true full-duplex communication. This means that the SOC and MCU can simultaneously send and receive data, significantly improving communication efficiency, especially in scenarios with high bidirectional real-time requirements. Each SPI bus has one master and one slave device, but these roles are interchangeable. For example, on one SPI bus, the SOC can be the master and the MCU the slave; while on another SPI bus, the MCU can become the master and the SOC the slave. This design flexibility supports complex data interaction needs between the SOC and MCU.
[0123] As another alternative example, in a product system, the MCU is responsible for collecting data from the CAN bus and forwarding it to the SOC, while the SOC is responsible for executing vehicle control parameters and sending them to the MCU. The two are connected as master and slave via dual-channel SPI. When the MCU collects data (approximately 100 bytes) and needs to report it to the SOC: the MCU, as the master device, initiates communication with the SOC (as the slave device) through one SPI physical layer and driver layer. The data link layer completes the handshake (Sync0x36 -> Response 0x76). The transport layer splits the 100 bytes into a first frame (FF, 57 bytes of valid data) and consecutive frames (CF, 43 bytes of valid data). Each frame is sent via SPI with a link layer header (Sync, DLC, RC, Checksum). The SOC receives and verifies all frames, reassembles the data, and passes it to the SOC's application through the service layer. Simultaneously, the SOC can send control commands to the MCU via another SPI (SOC as master, MCU as slave), without interference.
[0124] In this embodiment, a complete protocol stack including physical layer, driver layer, data link layer, transport layer, application layer and service layer is constructed. By using this protocol stack, the data to be transmitted by the master device is split into at least one data frame, the data frame is encapsulated, and the encapsulated data frame is transmitted to the slave device, thereby completing the data transmission. This achieves the technical effect of improving data communication efficiency and solves the technical problem of low data communication efficiency.
[0125] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0126] According to an embodiment of this application, a data transmission device embodiment is also provided. It should be noted that the device can be used to perform the above-described data transmission method.
[0127] Figure 5 This is a schematic diagram of a data transmission apparatus according to an embodiment of this application. Figure 5 As shown, the data transmission device may include: a first transmission unit 502, a determination unit 504, an encapsulation unit 506, and a second transmission unit 508.
[0128] The first transmission unit 502 is configured to, in response to the master device transmitting data to be transmitted to the application layer, utilize the service layer to transmit the data to be transmitted from the application layer, via the physical layer, to the transport layer, wherein the data to be transmitted is to be transmitted to a target slave device among at least one slave device.
[0129] The determining unit 504 is used to determine the transmission mode of the data to be transmitted in the transport layer, and to divide the data to be transmitted into at least one data frame according to the transmission mode and the number of divisions, wherein the transmission mode is matched with the number of divisions.
[0130] The encapsulation unit 506 is used to call the data link layer to encapsulate at least one data frame to obtain at least one link layer frame.
[0131] The second transmission unit 508 is used to invoke the physical layer and, through the driver layer, transmit at least one link layer frame to the target slave device at a preset transmission frequency.
[0132] Furthermore, the second transmission unit 508 may include: a conversion module for converting at least one link layer frame into a serial peripheral interface (SPI) signal using the driver layer; and a transmission module for transmitting the SPI signal to the target slave device according to the transmission frequency using a hardware controller in the physical layer.
[0133] Furthermore, the device can also be used to: invoke the hardware controller and set the corresponding transmission frequency of the master device.
[0134] Furthermore, the determining unit 504 may include: a determining module, used to call the transport layer, determine the amount of data to be transmitted, and determine the transmission mode based on the amount of data.
[0135] Furthermore, the determining module may include: a first determining submodule, used to determine the transmission mode as a multi-frame transmission mode in response to the data volume being greater than a data volume threshold; and a second determining submodule, used to determine the transmission mode as a single-frame transmission mode in response to the data volume being less than or equal to a data volume threshold.
[0136] Furthermore, the encapsulation unit may include: an acquisition module, used to acquire encapsulation data corresponding to the data frame, wherein the encapsulation data is used to verify the integrity of the data frame; and a combination module, used to call the data link layer to combine the encapsulation data and the data frame to obtain a link layer frame.
[0137] Furthermore, the device can also be used to respond to the target slave device acquiring at least one link layer frame, call the data link layer to verify at least one link layer frame in the target slave device, and obtain a verification result, wherein the verification result is used to characterize the integrity of the link layer frame.
[0138] Furthermore, the device can also be used to parse at least one link layer frame to obtain at least one data frame in response to a verification result indicating that the integrity of the link layer frame is greater than a threshold; and to combine at least one data frame in response to a multi-frame transmission mode to obtain data to be transmitted.
[0139] In the data transmission apparatus of this embodiment, a first transmission unit, in response to the master device transmitting data to be transmitted to the application layer, utilizes the service layer to transmit the data to be transmitted from the application layer, via the physical layer, to the transport layer, wherein the data to be transmitted is to a target slave device among at least one slave device; a determining unit, in the transport layer, determines the transmission mode of the data to be transmitted, and according to the transmission mode, divides the data to be transmitted into at least one data frame according to the number of divisions, wherein the transmission mode is matched with the number of divisions; an encapsulation unit, invokes the data link layer to encapsulate the at least one data frame to obtain at least one link layer frame; a second transmission unit, invokes the physical layer, and through the driver layer, transmits the at least one link layer frame to the target slave device according to a preset transmission frequency, thereby achieving the technical effect of improving data communication efficiency and solving the technical problem of low data communication efficiency.
[0140] Embodiments of this application also provide a vehicle, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods described in various embodiments of this application when it runs.
[0141] Embodiments of this application also provide a computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of this application.
[0142] Embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the methods of various embodiments of this application.
[0143] Embodiments of this application also provide a computer program product, including a non-volatile computer-readable storage medium for storing a computer program that, when executed by a processor, implements the methods in various embodiments of this application.
[0144] Embodiments of this application also provide a computer program that, when executed by a processor, implements the methods described in the various embodiments of this application.
[0145] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0146] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0147] 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 units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0148] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0149] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or 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 of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0150] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A data transmission method, characterized in that, The vehicles include: The method comprises at least one master device and at least one slave device, wherein the master device and the slave device transmit data through a protocol stack, the protocol stack including an application layer, a service layer, a transport layer, a data link layer, a physical layer, and a driver layer, and the method includes: In response to the master device transmitting data to be transmitted to the application layer, the service layer transmits the data to be transmitted from the application layer to the transport layer via the physical layer, wherein the data to be transmitted is to be transmitted to a target slave device among at least one of the slave devices; In the transport layer, a transmission mode for the data to be transmitted is determined, and the data to be transmitted is divided into at least one data frame according to the transmission mode and the number of divisions, wherein the transmission mode is matched with the number of divisions; The data link layer is invoked to encapsulate at least one of the data frames to obtain at least one link layer frame; The physical layer is invoked, and through the driver layer, at least one link layer frame is transmitted to the target slave device at a preset transmission frequency.
2. The method according to claim 1, characterized in that, The step of invoking the physical layer, and transmitting at least one link layer frame to the target slave device through the driver layer at a preset transmission frequency, includes: Using the driver layer, at least one of the link layer frames is converted into a Serial Peripheral Interface (SPI) signal; Using the hardware controller in the physical layer, the SPI signal is transmitted to the target slave device according to the transmission frequency.
3. The method according to claim 2, characterized in that, The method further includes: The hardware controller is invoked to set the transmission frequency corresponding to the master device.
4. The method according to claim 1, characterized in that, Determining the transmission mode of the data to be transmitted in the transport layer includes: The transport layer is invoked to determine the amount of data to be transmitted, and based on the amount of data, the transmission mode is determined.
5. The method according to claim 4, characterized in that, Determining the transmission mode based on the data volume includes: In response to the data volume exceeding a data volume threshold, the transmission mode is determined to be a multi-frame transmission mode; In response to the data volume being less than or equal to the data volume threshold, the transmission mode is determined to be a single-frame transmission mode.
6. The method according to claim 1, characterized in that, The step of invoking the data link layer to encapsulate at least one data frame to obtain at least one link layer frame includes: Obtain the encapsulation data corresponding to the data frame, wherein the encapsulation data is used to verify the integrity of the data frame; The data link layer is invoked to combine the encapsulated data and the data frame to obtain the link layer frame.
7. The method according to claim 6, characterized in that, The method further includes: In response to the target slave device acquiring at least one of the link layer frames, the data link layer is invoked to verify at least one of the link layer frames in the target slave device to obtain a verification result, wherein the verification result is used to characterize the integrity of the link layer frame.
8. The method according to claim 7, characterized in that, The method further includes: In response to the verification result indicating that the integrity of the link layer frame is greater than a threshold, at least one link layer frame is parsed to obtain at least one data frame; In response to the transmission mode being a multi-frame transmission mode, at least one of the data frames is combined to obtain the data to be transmitted.
9. A vehicle, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the storage medium is located to perform the method according to any one of claims 1 to 8.