A data transmission method and electronic device of a vehicle-mounted system, and a vehicle-mounted system

By adopting a full-duplex synchronous serial communication protocol and signal switching mechanism in the vehicle system, the problem of unstable data transmission between electronic control units was solved, the continuity and accuracy of data transmission were achieved, and the stability and reliability of the system were improved.

CN119484573BActive Publication Date: 2025-11-18CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411552437.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-11-18
Estimated Expiration
2044-11-01

AI Technical Summary

Technical Problem

In existing vehicle systems, data transmission between electronic control units is unstable and prone to interruptions, affecting system stability and reliability.

Method used

By employing a full-duplex synchronous serial communication protocol between the first and second components and utilizing a switching mechanism between designated and undesignated signals, the continuity and accuracy of data transmission are ensured. This includes ensuring that the first component maintains signal switching to receive data after detecting a designated signal from the second component, and adjusting the communication state as necessary to avoid unnecessary operations.

Benefits of technology

It improves the communication efficiency of the vehicle system, enhances the stability and reliability of the system, and ensures the continuity and accuracy of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484573B_ABST
    Figure CN119484573B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a data transmission method of a vehicle-mounted system, applied to the field of vehicle-mounted system communication, wherein in the case that a second component sets a second signal to a specified signal, a first component sets a first signal to the specified signal to receive data sent by the second component, the first signal is a signal sent by the first component, the second signal is a signal sent by the second component, and the first component switches the first signal from the specified signal to a non-specified signal after a preset time length when the first signal is set to the specified signal. In the case that the second component is detected to keep the second signal as the specified signal, the first component switches the first signal from the non-specified signal to the specified signal to continue receiving the data sent by the second component, the continuous reception of the data transmitted by the second component by the first component is realized, the efficiency of the vehicle-mounted system communication is improved, and thus the stability and reliability of the vehicle-mounted system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and in particular to data transmission methods and electronic devices for vehicle systems, and vehicle systems. Background Technology

[0002] In modern automotive systems, there are numerous electronic control units (ECUs), each typically containing a microcontroller unit (MCU) and a system-on-chip (SoC). These components require efficient, real-time data communication to ensure the coordinated operation of the entire system.

[0003] When a System-on-a-Chip (SoC) acts as the master control component to send data to a slave control device, it typically uses a high-signal signal to indicate the start of data transmission. Specifically, the master control component first pulls its signal high before sending data. Upon detecting this high signal, the slave control component then pulls its own signal high to indicate that it can receive data. In related technologies, the slave control component, upon defaulting to complete data reception, immediately considers data transmission complete and takes appropriate action to stop receiving data.

[0004] The transmission schemes of related technologies have poor stability, and data transmission interruptions frequently occur, affecting the stability and reliability of the entire system. Summary of the Invention

[0005] In view of the above problems, a data transmission method and electronic device for an in-vehicle system, and an in-vehicle system thereof, are proposed to overcome or at least partially solve the above problems, including:

[0006] In a first aspect of this application, a data transmission method for a vehicle-mounted system is provided, characterized in that the method includes:

[0007] When the second component sets the second signal to the designated signal, the first component sets the first signal to the designated signal to receive data sent by the second component, wherein the first signal is a signal sent by the first component, the second signal is a signal sent by the second component, and the second component is used to set the second signal to the designated signal when it is necessary to send data to the first component;

[0008] After setting the first signal to the designated signal for a preset duration, the first component switches the first signal from the designated signal to a non-designated signal;

[0009] When the first component detects that the second signal remains the designated signal, it switches the first signal from the non-designated signal to the designated signal to continue receiving data sent by the second component.

[0010] Optionally, the method further includes:

[0011] When the first component needs to send data to the second component, it detects the second signal of the second component;

[0012] When the first component detects that the second component has set the second signal to the designated signal, it sends data to the second component; wherein the second component is further configured to set the second signal to the designated signal when data needs to be received.

[0013] Optionally, the designated signal is a high-level signal, and the designated signal also indicates that the second component is in a data transmission state or a data reception state, and the non-designated signal is a low-level signal.

[0014] Optionally, the first component and the second component use a full-duplex synchronous serial communication protocol for data transmission, and after setting the first signal to a specified signal, the method further includes:

[0015] The first component sets the communication state of the full-duplex synchronous serial communication protocol to a non-idle state.

[0016] Optionally, after continuing to receive data sent by the second component, the method further includes:

[0017] The first component parses the data according to a preset length to obtain a first target data of the preset length and a second target data in the data other than the first target data;

[0018] The first component verifies the first target data;

[0019] If the verification passes, the first component parses the second target data.

[0020] Optionally, before the first component sets the first signal to the designated signal, it further includes:

[0021] The first component determines that it is in a non-active transmission state at the time of the interruption. The interruption time is the moment when the first component detects that the second component sets the second signal to the specified signal. The active transmission state is the state in which the first component initiates data transmission as the transmitting end.

[0022] Optional, also includes:

[0023] If the first component determines that it is in the active transmission state at the time of the interruption, the first component keeps the first signal as a non-specified signal after the data transmission is completed.

[0024] In a second aspect of this application, an electronic device is provided, including one or more processors; and one or more memories thereon storing instructions, the instructions stored in the memories being readable, compiled and executed by the processors to implement the data transmission method of the vehicle system as described above.

[0025] In a third aspect of this application, a vehicle-mounted system is provided, the vehicle-mounted system including a first component and a second component connected to the first component;

[0026] The first component is an electronic device as described above;

[0027] The second component is configured to set a second signal as a designated signal when there is a need to send data to the first component, and to send data to the first component when it detects that the first component has set a first signal as the designated signal.

[0028] Optionally, the second component is configured to send the data in the cache to the first component if it detects that its corresponding cache is not empty.

[0029] The embodiments of this application have the following advantages:

[0030] When the second component sets the second signal to the designated signal, the first component sets the first signal to the designated signal to receive data sent by the second component. Here, the first signal is a signal sent by the first component, and the second signal is a signal sent by the second component. The second component sets the second signal to the designated signal when it needs to send data to the first component. After setting the first signal to the designated signal for a preset time, the first component switches the first signal from the designated signal to a non-designated signal. When the first component detects that the second signal remains the designated signal, it switches the first signal from the non-designated signal to the designated signal to continue receiving data sent by the second component. This enables the first component to continuously receive data transmitted by the second component, improves the efficiency of vehicle system communication, and thus enhances the stability and reliability of the system. Attached Figure Description

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

[0032] Figure 1 This is a flowchart illustrating the steps of a data transmission method for an in-vehicle system according to an embodiment of this application;

[0033] Figure 2 This is a flowchart of a scheduling implementation provided in one embodiment of this application;

[0034] Figure 3 This is a schematic diagram of the structure of an in-vehicle system provided in one embodiment of this application;

[0035] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0036] Figure 5 This is a schematic diagram of the structure of a data transmission device for a vehicle-mounted system provided in an embodiment of this application. Detailed Implementation

[0037] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0038] In in-vehicle system communication, the MCU typically connects to the vehicle's Controller Area Network (CAN). CAN is a communication protocol used within the vehicle to connect different electronic control units (ECUs), allowing them to exchange information to achieve various vehicle functions. If the communication rate is too low, data backlog can occur, eventually leading to memory overflow and program crashes. Therefore, a method with high transmission speed and low resource consumption is needed for communication. Using the 6.5Mbps baud rate SPI (Serial Peripheral Interface) communication protocol, data can be sent within a 10ms schedule. DMA (Direct Memory Access) transfers data directly without going through the CPU, making DMA the optimal choice for data transfer, satisfying both real-time requirements and high reliability. SPI, on the other hand, is a synchronous serial communication protocol that allows full-duplex communication between two devices.

[0039] As a slave control component of SPI, the MCU can receive and respond to data requests or commands from the SOC. In automotive communication, the SOC typically connects to the vehicle's Ethernet network. Ethernet is used in automobiles for high-speed, high-capacity data transmission, especially when processing multimedia content or interacting with other in-vehicle systems (such as navigation and entertainment systems). The SOC, as the master control component of SPI, is responsible for initiating communication with the MCU and controlling the flow of data. In the TBOX (Telematics Box) architecture, the MCU and SOC communicate via SPI to exchange data. SPI is a high-speed, full-duplex, synchronous communication bus that operates in a master-slave mode, meaning there is one master control component and one or more slave control components.

[0040] Reference Figure 1 This document illustrates a flowchart of a data transmission method for a vehicle-mounted system according to an embodiment of this application. The vehicle-mounted system is equipped with a first component and a second component, and the method may specifically include the following steps:

[0041] Step 101: When the second component sets the second signal to the designated signal, the first component sets the first signal to the designated signal to receive data sent by the second component, wherein the first signal is a signal sent by the first component, the second signal is a signal sent by the second component, and the second component is used to set the second signal to the designated signal when it is necessary to send data to the first component.

[0042] The main component executing the embodiments of this application can be a first component, which may be, but is not limited to, a microcontroller unit (MCU) in a vehicle. The MCU is a small computer chip integrating a processor core, memory, input / output interfaces, and timers. It receives data from sensors, processes this data, and controls actuators according to preset algorithms and programs, thereby achieving precise control of various vehicle systems. The second component may be, but is not limited to, a system-on-a-chip (SoC) integrated circuit, which integrates multiple functions such as a processor, memory, input / output interfaces, and communication modules onto a single chip. SoC chips are widely used in vehicles, especially in key areas such as advanced driver assistance systems, in-vehicle infotainment systems, and body control modules. The MCU is responsible for the underlying basic control tasks, ensuring the vehicle's basic functions and safety performance; while the SoC is responsible for the upper-level advanced functions and complex data processing, providing a more intelligent and richer user experience. The SoC chip and MCU often work together to form a hierarchical control architecture. Communication between the SoC and MCU is usually achieved through specific communication protocols and bus systems. This communication process ensures data exchange and collaborative work between different functional modules, thereby achieving overall vehicle control and management.

[0043] In some examples of this embodiment, the first signal can be a signal emitted from the MCU_GPIO (General-Purpose Input / Output) pin corresponding to the first component MCU, and the second signal can be a signal emitted from the NAD_GPIO (Network Attached Device General-Purpose Input / Output) pin corresponding to the second component SOC. Typically, whether the MCU sends data to the SOC or the SOC sends data to the MCU, the sending party will first set its own GPIO signal to a specified signal. Once the receiving party detects that the other party's GPIO is set to a specified signal, it assumes that the other party has data to send and needs to prepare to receive data. Therefore, when the SOC sets its NAD_GPIO signal to a specified signal, it indicates that the SOC has data to send. When the MCU detects that NAD_GPIO is set to a specified signal, it assumes that it needs to receive data from the SOC. At this time, the MCU also sets its MCU_GPIO to a specified signal and sends it back to the SOC, thereby notifying the SOC that it is ready to receive data.

[0044] In the specific implementation, OSEK OS (Open Systems and the Corresponding Interfaces for Automotive Electronics Operating System) single-core multi-task scheduling is used, scheduling RPC (Remote Procedure Call) communication once every 10ms to detect whether the MCU or SOC has data to send. If the SOC first sets NAD_GPIO to the specified signal, it means that the SOC has data to send to the MCU, and the MCU needs to receive the data. Similarly, if the MCU first sets MCU_GPIO to the specified signal, it means that the MCU needs to send data to the SOC, and the SOC needs to receive the data. OSEK is an open standard and specification for automotive electronic control units, and RPC is a communication protocol that allows programs to execute code in different address spaces, just like calling local functions, simplifying communication in distributed systems.

[0045] In some embodiments of this application, the designated signal is a high-level signal, and the designated signal also indicates that the second component is in a data transmission state or a data reception state, while the non-designated signal is a low-level signal.

[0046] In digital systems, signals are typically categorized into two states: a high-level signal, which indicates a higher voltage or current level in a digital circuit, and a low-level signal, which indicates a lower voltage or current level. These two states correspond to logic "1" and logic "0," respectively. In communication protocols, a high-level signal can represent a data bit "1" or a specific control signal.

[0047] In some examples of this embodiment, the designated signal is a high-level signal, and the non-designated signal corresponds to a low-level signal. However, those skilled in the art will understand that in other examples, the low-level signal can also be used as the designated signal, while the high-level signal is a non-designated signal.

[0048] In some examples of this embodiment, a suitable high-level signal can be determined according to the system design and communication protocol requirements. It is understood that when the high-level signal is first sent from the first component MCU, it indicates that the first component MCU is in a data transmission state; when the high-level signal is first sent from the second component SOC, it indicates that the second component SOC is in a data transmission state. Similarly, when the high-level signal is first sent from the first component MCU (MCU sending data to the SOC), the second component SOC will also switch its second signal to a high-level signal to indicate that it is ready to receive data; in this case, the designated state indicates that the second component SOC is in a data receiving state. When the high-level signal is first sent from the second component (SOC sending data to the MCU), the first component MCU will also set its first signal to a high-level signal to indicate that it is ready to receive data; in this case, the designated high-level signal indicates that the first component MCU is in a data receiving state. It should be understood that the high-level signal should be accurately identifiable by both the first and second components and should not interfere with other parts of the system. Similarly, a suitable low-level signal can be determined as an unspecified signal according to the system design and communication protocol requirements. The unspecified signal indicates that the first component or the second component is in a stopped receiving state.

[0049] Both the first and second components can apply a specified or unspecified signal to the signal line between them via their control circuits or dedicated signal generators. This specified or unspecified signal can be a constant voltage value or a voltage signal with a specific waveform or frequency, depending on the communication protocol and the recognition capabilities of the first and second components. The specified or unspecified signal is then transmitted along the signal line between the first and second components. When the first or second component receives the specified or unspecified signal, it decodes and identifies it according to its internal circuit design and communication protocol. Once it recognizes that this is a specified signal requesting entry into data reception mode, the receiving first or second component will perform corresponding preparatory work, such as initializing the data reception buffer and configuring relevant hardware interfaces.

[0050] Understandably, when the first component's MCU sends data, it pulls MCU_GPIO high. Upon detecting the rising edge of MCU_GPIO, the second component's SOC pulls NAD_GPIO high to indicate it can receive data. However, a problem arises: this action of the second component's SOC pulling NAD_GPIO high causes the first component's MCU to detect a rising edge in NAD_GPIO and mistakenly interpret it as the second component's SOC about to send data. Therefore, after the 10ms scheduling completes, the first component's MCU sends its data, pulls its own MCU_GPIO low, and immediately pulls it high again to receive data from the SOC. In reality, the second component's SOC has no need to send data at this point, resulting in unnecessary operations and reduced system stability.

[0051] Therefore, in some embodiments of this application, before "the first component sets the first signal to the designated signal" in step 101, the following steps may also be included:

[0052] S11: The first component determines that it is in a non-active transmission state at the time of the interruption. The interruption time is the moment when the first component detects that the second component sets the second signal to the specified signal. The active transmission state is the state in which the first component initiates data transmission as the transmitting end.

[0053] To ensure correct communication between the first and second components, in the specific implementation, the MCU transmission status flag of the first component can be set to indicate whether the first component is the active sender. For example, during initialization, the MCU transmission status flag can be set to 0 to indicate that the first component is not the active sender; when the first component determines to send data, the MCU transmission status flag is set to 1 to indicate that the first component is the active sender.

[0054] Therefore, when the first component detects that the second component sets the second signal to the specified signal, that is, when the first component MCU detects that the NAD_GPIO of the second component SOC generates rising edge information, and before the first component sets the first signal to the specified signal, the first component needs to determine whether it is in an active transmission state at that moment.

[0055] If the first component is in a non-active sending state at this moment, it means that the first component is not a data sender. This indicates that NAD_GPIO is set to the specified state because the second component wants to send data. Only then will the steps of setting the first signal to the specified signal and the subsequent steps of receiving data sent by the second component be executed.

[0056] In some embodiments of this application, the following steps may also be included:

[0057] S21: If the first component determines that it is in an active transmission state at the time of the interruption, the first component keeps the first signal as a non-specified signal after the data transmission is completed;

[0058] As can be seen from the above, the interrupt time is the moment when the first component detects that the second component sets the second signal to the specified signal. If the first component determines that it is in an active transmission state at the interrupt time, it can be determined that in the data transmission between the first component MCU and the second component SOC, the first component MCU is the sender sending data to the second component SOC. Then, after the data transmission is completed, the first component keeps the first signal as a non-specified signal. That is to say, even if the first component MCU detects the rising edge of NAD_GPIO generated by the second component SOC (this NAD_GPIO is generated by the second component in response to the data transmission request of the first component) during the process of sending data outward, it keeps the first signal at a low level and does not respond to it.

[0059] By executing S41, when the first component MCU sends data to the second component SOC, even if the first component MCU detects the rising edge signal of the second component SOC, it can consider the rising edge signal of the second component SOC as invalid by combining whether the first component is in an active transmission state, and no longer pull the MCU_GPIO high, thus avoiding unnecessary operations and further improving the stability of the system.

[0060] Based on the detection of the rising edge signal of the second component NAD_GPIO, combined with the active transmission status of the first component MCU, the initiator of data transmission can be identified when a signal switch is detected. This can further ensure the correct transmission of data and determine whether the signal switch needs to be handled promptly or ignored accurately.

[0061] In some embodiments of this application, the first component and the second component use a full-duplex synchronous serial communication protocol for data transmission. After "the first component sets the first signal to a specified signal" in step 101, the following steps are also included:

[0062] S31: The first component sets the communication state of the full-duplex synchronous serial communication bus to a non-idle state.

[0063] If the communication state between the first and second components remains idle, other tasks or interrupts may mistakenly believe that the SPI interface is available during data transmission between the first and second components, and thus attempt to send or receive data, resulting in data conflicts and transmission errors.

[0064] In some examples of this embodiment, during the process of the second component sending data to the first component MCU and communicating via the SPI interface, the first component needs to set the SPI bus communication state to a non-idle state after pulling the MCU_GPIO high. Similarly, when the first component MCU sends data to the second component SOC and communicates via the SPI interface, it also needs to set the SPI bus communication state to a non-idle state. Therefore, setting the SPI bus communication state to a non-idle state indicates that data transmission or processing is in progress. This avoids other tasks or interrupts attempting to access the same SPI resources during data transmission, thereby reducing the risk of data conflicts and transmission errors.

[0065] Step 102: After setting the first signal to a specified signal for a preset duration, the first component switches the first signal from the specified signal to a non-specified signal.

[0066] Normally, when the first component MCU receives data sent by the SOC from the SPI bus, the data buffer size for each communication is 2k. After an SPI communication is completed, an interrupt will be generated through DMA to notify that the communication has ended, and the GPIO of the first and second components will be pulled low. It can be understood that each communication requires calling the SPI communication interface once. After the sender sends data, it waits for the acknowledgment signal (ACK) for a maximum of 300ms. After receiving the acknowledgment signal, it can immediately request to send the next data packet. If the wait for the acknowledgment signal times out, the current message will be resent, and it can be retried a maximum of 2 times.

[0067] In the specific implementation, the baud rate of the SPI bus is selectable, such as 500kbps, 6.5Mbps or 13Mbps. Assuming that 6.5Mbps is used, the amount of data transmitted in 1ms is 6500 / 8 bytes. If a 10ms scheduling is used, the amount of data that can be transmitted in 10ms is 6500 / 8*10=8125 (bytes). 8125 bytes > 2k bytes, so usually, the data transmission is considered to be completed when the 10ms scheduling ends, and both the first and second components will pull their GPIO signals low.

[0068] Step 103: When the first component detects that the second signal remains the designated signal, it switches the first signal from the non-designated signal to the designated signal in order to continue receiving data sent by the second component.

[0069] As described above, under normal circumstances, data transmission is considered complete after the 10ms scheduling ends, and both the first and second components will pull their GPIO signals low. However, in some examples, the second component SOC may need to transmit more data to the MCU. In this case, the second component SOC can continue to fill data into the buffer during the transmission process, and the second component SOC will not pull NAD_GPIO low.

[0070] Based on the operation of the second component continuing to fill data into the buffer without pulling NAD_GPIO low, the first component MCU, after receiving 10ms of data, will pull NAD_GPIO low while continuing to monitor the signal status of NAD_GPIO. If it detects that NAD_GPIO remains at the specified signal, it indicates that the second component still needs to transmit data. At this time, the first component MCU will switch the first signal MCU_GPIO from the non-specified signal to the specified signal again, thereby notifying the first component that the second component can continue to receive the data sent by the second component and continue to prepare for the second reception.

[0071] In some embodiments of this application, the following steps may also be included:

[0072] S41: When the first component needs to send data to the second component, the second signal of the second component is detected;

[0073] S42: When the first component detects that the second component has set the second signal to a specified signal, the first component sends data to the second component; wherein the second component is also used to set the second signal to a specified signal when data needs to be received.

[0074] As can be seen from the above, the MCU and SOC have different communication requirements. Therefore, there may be situations where the SOC sends data to the MCU, or the MCU sends data to the SOC. So the execution steps of S41-S42 can be before step 101 or after step 103.

[0075] If the first component MCU sends data to the second component SOC, the first component MCU will first set its own first signal to a specified state to indicate that it has data to send. When the second component SOC receives the MCU_GPIO set to the specified state, it will also set NAD_GPIO to the specified state. Therefore, the first component MCU needs to detect the second signal of the second component SOC. When it detects that the second component has set the second signal to the specified state, it can determine that the SOC is ready to receive data, and at this time it sends data to the second component SOC.

[0076] Normally, when the first component MCU sends data to the second component SOC, the default maximum data size is 2k. Therefore, during the 10ms scheduling process, the first component MCU will definitely send all 2k of data, and the second component SOC will simultaneously receive it.

[0077] In the specific implementation, the SPI driver layer of the second component SOC adds four bytes: 0x5A xx higt_len low_len. This addition filters out invalid transmissions and receptions. Correspondingly, the first component MCU will only parse the received data packet if it detects the presence of these four bytes. Therefore, the first component MCU needs to remove these four bytes when unpacking the received data and add them when reassembling the packet, ensuring accurate and efficient communication between the first and second components. When the sender transmits payload data, the receiver only needs to reply with an acknowledgment signal (ack).

[0078] In specific implementations, when data is transmitted between the first and second components, the transmitted data can be in the form of data packets. A data packet is the basic unit used for data transmission in data communication. The packet format defines the structure of the data packet, including the order and meaning of each field. For example, a data packet may include synchronization data (1), synchronization data (2), Packet Length (1), Packet Length (2), sequence number / packet number, source module, destination module, Playload1Length (1), Playload 1Length (2), Payload1 data (no Payload field is needed for ACK and NACK type packets), ProcID (2 bytes) (part of payload1), UserData (part of payload1), Playload2Length (1), Playload 2Length (2), Payload2 data (no Payload is needed for ACK and NACK type packets), ProcID (2 bytes) (part of payload2), UserData (part of payload2), and Checksum. Among them, Packet Length(1) represents the length of the data packet 1, Packet Length(2) represents the length of the data packet 2, Payload1 data represents the payload data 1, Playload 1 Length(1) represents the length of the payload data 1 1, Playload 1 Length(2) represents the length of the payload data 1 2, the ProcID of the Playload 1 part represents the service identifier corresponding to the payload data 1, UserData represents the actual data transmitted by the payload data 1, Payload2 data represents the payload data 2, Playload2 Length(1) represents the length of the payload data 2 1, Playload 2 Length(2) represents the length of the payload data 2 2, the ProcID (2 bytes) corresponding to the Payload2 data and the UserData corresponding to the Payload2 data respectively represent the service identifier and the actual data transmitted by the payload data 2, and Checksum represents the verification field. It should be noted that Playload2 Length(1), Playload 2 Length(2), the Payload2 data field, the ProcID (2 bytes) corresponding to the Payload2 data and the UserData corresponding to the Payload2 data are optional fields.

[0079] Among them, synchronization data (1) can be specifically 0xCD, synchronization data (2) can be specifically 0x55, PacketLength is the total length of a single RPC protocol message, that is, the length of Byte0-ByteM, using little-endian byte order, total length = Length(1) + Length(2) * 256, Length(1): value range is 0~255; Length(2): integer multiple of 256 bytes, representing how many 256 bytes there are. Sequence number / packet number represents the packet number sent, 1~255 are used in a cycle, sequence number / packet number can be used to determine whether the data frame is lost. Source module / destination module: indicates the module ID (MCU&NAD globally unique ID) of sending / receiving this message, the specific definition is shown in Table 1, 0x00 represents the first component MCU sending, 0x01 represents the second component SOC sending, 0x02 represents the AP (Application Processor) sending.

[0080] Table 1

[0081] type Value MCU 0x00 NAD 0x01 AP 0x02

[0082] Playload len: A data frame (2k) can contain one or more payloads. Playload len = Playload len1 + Playload len2 * 256, excluding the lengths of Playload len1 and Playload len2 (2 bytes), i.e., only procID len + userData len. Checksum: Sets the value obtained by XORing the data from Byte 2 to ByteM-1. The checksum is used for data consistency verification. This application embodiment, through the reasonable definition and use of these fields, can achieve efficient and reliable data transmission between the first component MCU and the second component SOC.

[0083] In some embodiments of this application, step 103 may be followed by the following steps:

[0084] The first component parses the data according to a preset length to obtain a first target data of a preset length and a second target data other than the first target data in the data.

[0085] The first component verifies the first target data;

[0086] If the verification passes, the first component parses the second target data.

[0087] In the specific implementation, the preset length can be, but is not limited to, 4 bytes. The preset length can be pre-agreed upon based on the communication requirements of the first and second components. After the first component receives the data, it first truncates the data to obtain the first 4 bytes of target data and the second target data excluding the truncated first target data. Specifically, the first 4 bytes of target data need to be verified. If the verification passes, it indicates that the second target data is valid data between the first component MCU and the second component SOC. In the specific implementation, the second target data can be further verified. For example, the packlen, checksum, and payload len in the second target data can be calculated. If the calculated checksum matches the checksum in the data, it indicates that the received frame data is valid. Then, the procID and data are parsed from the received data frame. Based on the procID, it is determined what kind of service the application layer is, and then it is executed. For example, if the procID in the data sent from the second component SOC to the first component MCU is 0x0606 (assuming the procID range corresponding to the SOC upgrading the MCU is 0x0600~0x06FF), it indicates that the second component SOC is notifying the first component MCU to prepare for an upgrade. The first component MCU receives the request, knows the amount of data to be upgraded from the data, and responds with 0x8603 to notify the second component SOC that the upgrade is possible (assuming the procID range corresponding to the first component MCU's feedback to the second component SOC that the upgrade is possible is 0x8600~0x86FF), causing the second component to start sending the upgrade package data. For example, the service procID can be shown in Table 2, where xCALL is an extended call. xCALL extended calls refer to a mechanism used to call specific functions or services in an in-vehicle system. Such calls are typically used for cross-module or cross-process communication to enable collaboration between different functional modules.

[0088] Table 2

[0089]

[0090] like Figure 2The diagram shows a scheduling implementation flowchart provided in some embodiments of this application. First, the vehicle system is initialized. Specifically, the initial scheduling state of the vehicle system can be set to idle 1, and the MCU active transmission state can be set to 0 to indicate a non-MCU active transmission state. After initialization, system scheduling is performed every 10ms. First, it is determined whether the bus state is idle. If it is idle, it is checked whether the second component SOC has pulled its own NAD_GPIO signal high. If it has, it means that the SOC needs to send data to the MCU, so the bus state is changed to non-idle, and the next 10ms scheduling continues. If the second component SOC is not detected to have pulled its own NAD_GPIO high, it is determined whether the MCU has data to send. If the MCU has data to send, the MCU_GPIO signal is pulled high first, the bus state is changed to non-idle, and finally the state information corresponding to the first component MCU is changed to active transmission state 1, and the next 10ms scheduling begins.

[0091] During the 10ms system scheduling process, if the bus state is determined to be non-idle, it indicates that data needs to be transmitted. The system waits for DMA to initiate data transmission communication. When 10ms has elapsed, the MCU_GPIO of the first component is pulled low. At this point, it needs to determine if the data transmission was initiated by the MCU of the first component. If not, it indicates that the data was sent by the SOC. In this case, it needs to determine if the NAD_GPIO of the SOC remains high. If it remains high, it indicates that the SOC still has data to transmit, and the MCU needs to pull MCU_GPIO high to continue scheduling and receive the continuously transmitted data from the SOC. Conversely, if the data transmission was initiated by the MCU of the first component, it means that the SOC has no data to transmit. After transmitting the data, the MCU of the first component ignores the first signal pulled high by the SOC of the second component when it determined that data transmission was possible; that is, it considers the high signal of the second component's SOC as invalid. Whether the first component transmits data to the second component or vice versa, after the data transmission is complete, the scheduling state is changed to idle 1, and the data packet is decoded. The corresponding business logic is then executed based on the service identifier in the data packet.

[0092] The embodiments of this application have the following advantages:

[0093] When the second component sets the second signal to the designated signal, the first component sets the first signal to the designated signal to receive data sent by the second component. Here, the first signal is a signal sent by the first component, and the second signal is a signal sent by the second component. The second component sets the second signal to the designated signal when it needs to send data to the first component. After setting the first signal to the designated signal for a preset time, the first component switches the first signal from the designated signal to a non-designated signal. When the first component detects that the second signal remains the designated signal, it switches the first signal from the non-designated signal to the designated signal to continue receiving data sent by the second component. This enables the first component to continuously receive data transmitted by the second component, improves the efficiency of vehicle system communication, and thus enhances the stability and reliability of the vehicle system.

[0094] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.

[0095] Reference Figure 3 The illustration shows an electronic device provided in an embodiment of the present application. The electronic device includes one or more processors 301 and one or more memories 302 storing instructions thereon, wherein the instructions stored in the memories 302 can be read, compiled and executed by the processors 301 to realize the data transmission method of the vehicle system as described above.

[0096] Reference Figure 4 The diagram shows a structural schematic of an in-vehicle system provided in an embodiment of this application. The in-vehicle system includes a first component 401 and a second component 402 connected to the first component.

[0097] The first component 401 is the electronic device described above;

[0098] The second component 402 is configured to set the emitted second signal as a designated signal when there is a need to send data to the first component, and to send data to the first component when it detects that the first component has set the first signal as the designated signal.

[0099] In some embodiments of this application, the second component 402 is configured to send the data in the cache to the first component 401 when it detects that its corresponding cache is not empty.

[0100] In some examples of this application, as long as there is data in the buffer corresponding to the second component SOC in the vehicle system, the second component can keep NAD_GPIO as a specified signal to continuously send data to the first component MCU, thereby meeting the requirement of the second component SOC to send a large amount of data to the first component MCU. As mentioned above, the first component MCU first pulls the corresponding first signal MCU_GPIO high to receive the data sent by the SOC. After a preset time, the first component MCU first pulls its own MCU_GPIO low, but at this time the first component will further detect the second component's NAD_GPIO. If it detects that it is continuously high, the first component will continue to pull its own MCU_GPIO high to continuously receive the data sent by the second component.

[0101] When the second component SOC needs to send data to the first component MCU, it also adds a target character of a preset length to the data. The preset length can be, but is not limited to, 4 bytes. The target character is a pre-agreed fixed character that can be adjusted according to actual communication requirements. The first component only further parses the data after receiving it from the second component SOC and parsing it to obtain the pre-agreed fixed character, i.e., after the initial verification passes. Otherwise, the received data is considered invalid and discarded. Therefore, the preset length target character added by the second component to the data enables accurate communication between the second component SOC and the first component MCU.

[0102] As can be seen from the above, the vehicle system in this embodiment realizes continuous and accurate reception of data transmitted by the first component to the second component, which improves the communication efficiency of the vehicle system and thus enhances the stability and reliability of the system.

[0103] Reference Figure 5 This illustration shows a structural schematic diagram of a data transmission device for a vehicle-mounted system according to an embodiment of this application. The vehicle-mounted system includes a first component and a second component connected to the first component, and may specifically include the following modules:

[0104] The first receiving module 501 is configured to set the first signal to the designated signal when the second component sets the second signal to the designated signal, so as to receive data sent by the second component, wherein the first signal is a signal sent by the first component, the second signal is a signal sent by the second component, and the second component is used to set the second signal to the designated signal when it is necessary to send data to the first component;

[0105] The first switching module 502 is configured to switch the first signal from the designated signal to a non-designated signal after the first component sets the first signal to the designated signal for a preset duration;

[0106] The first continuous receiving module 503 is configured to switch the first signal from the non-designated signal to the designated signal when the first component detects that the second signal remains the designated signal, so as to continue receiving data sent by the second component.

[0107] In an optional embodiment of this application, the apparatus further includes:

[0108] The second detection module is configured to detect the second signal of the second component when the first component has a need to send data to the second component.

[0109] The second transmitting module is configured to transmit data to the second component when the first component detects that the second component has set the second signal to the designated signal; wherein the second component is further configured to set the second signal to the designated signal when data needs to be received.

[0110] In an optional embodiment of this application, the designated signal is a high-level signal, and the designated signal also indicates that the second component is in a data transmission state or a data reception state, and the non-designated signal is a low-level signal.

[0111] In an optional embodiment of this application, the first component and the second component use a full-duplex synchronous serial communication protocol for data transmission, and the device further includes:

[0112] The first component sets the communication state of the full-duplex synchronous serial communication bus to a non-idle state.

[0113] In an optional embodiment of this application, the apparatus further includes:

[0114] The first parsing module is configured to parse the data according to a preset length by the first component to obtain the first target data of the preset length and the second target data in the data other than the first target data;

[0115] The first verification module is configured to verify the first target data by the first component;

[0116] The second parsing module is configured such that if the verification passes, the first component parses the second target data.

[0117] In an optional embodiment of this application, the first receiving module 501 further includes:

[0118] The first execution submodule is configured such that when the first component determines the interrupt time, it is in a non-active transmission state, where the interrupt time is the moment when the first component detects that the second component sets the second signal to the specified signal, and the active transmission state is the state in which the first component initiates data transmission as the sending end.

[0119] In an optional embodiment of this application, the first receiving module 501 further includes:

[0120] The second holding submodule is configured such that if the first component determines that it is in the active transmission state at the time of the interruption, the first component holds the first signal as a non-specified signal after the data transmission is completed.

[0121] The embodiments of this application have the following advantages:

[0122] When the first component detects that the second component has set the second signal to the designated signal, the first component sets the first signal to the designated signal to receive data sent by the second component. Here, the first signal is a signal sent by the first component, and the second signal is a signal sent by the second component. The second component sets the second signal to the designated signal when data needs to be sent. After setting the first signal to the designated signal for a preset time, the first component switches the first signal from the designated signal to a non-designated signal. When the first component detects that the second signal remains the designated signal, it switches the first signal from the non-designated signal to the designated signal to continue receiving data sent by the second component. This enables the first component to continuously receive data transmitted by the second component, improves the communication efficiency of the vehicle system, and thus enhances the stability and reliability of the vehicle system.

[0123] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0124] 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 portals are provided for users to choose to authorize or refuse.

[0125] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0126] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0127] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0128] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0129] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0130] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0131] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes the aforementioned element.

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

Claims

1. A data transmission method for a vehicle-mounted system, characterized in that, The vehicle-mounted system includes a first component and a second component connected to the first component; the method includes: When the second component sets the second signal to the designated signal, the first component sets the first signal to the designated signal to receive data sent by the second component, wherein the first signal is a signal sent by the first component, the second signal is a signal sent by the second component, and the second component is used to set the second signal to the designated signal when it is necessary to send data to the first component; After setting the first signal to the designated signal for a preset duration, the first component switches the first signal from the designated signal to a non-designated signal; When the first component detects that the second signal remains the designated signal, it switches the first signal from the non-designated signal to the designated signal to continue receiving data sent by the second component; The designated signal is a high-level signal, and the designated signal also indicates that the second component is in a data transmission state or a data reception state; the non-designated signal is a low-level signal. Before the first component sets the first signal to the designated signal, it further includes: The first component determines that it is in a non-active transmission state at the time of the interruption. The interruption time is the moment when the first component detects that the second component sets the second signal to the specified signal. The active transmission state is the state in which the first component initiates data transmission as the transmitting end. If the first component determines that it is in the active transmission state at the time of the interruption, the first component keeps the first signal as a non-specified signal after the data transmission is completed.

2. The method according to claim 1, characterized in that, The method further includes: When the first component needs to send data to the second component, the second signal of the second component is detected; When the first component detects that the second component has set the second signal to the designated signal, it sends data to the second component; wherein the second component is further configured to set the second signal to the designated signal when data needs to be received.

3. The method according to claim 1, characterized in that, The first component and the second component use a full-duplex synchronous serial communication protocol for data transmission. After the first component sets the first signal to the designated signal, it further includes: The first component sets the communication state of the full-duplex synchronous serial communication bus to a non-idle state.

4. The method according to claim 1, characterized in that, After continuing to receive data sent by the second component, the method further includes: The first component parses the data according to a preset length to obtain a first target data of the preset length and a second target data in the data other than the first target data; The first component verifies the first target data; If the verification passes, the first component parses the second target data.

5. An electronic device, characterized in that, include One or more processors; and The system has one or more memories storing instructions, the instructions stored in the memories being available for the processor to read, compile and execute, in order to implement the data transmission method of the vehicle system as described in any one of claims 1-4.

6. A vehicle-mounted system, characterized in that, The vehicle system includes a first component and a second component connected to the first component; The first component is the electronic device as described in claim 5; The second component is configured to set a second signal as a designated signal when there is a need to send data to the first component, and to send data to the first component when it detects that the first component has set a first signal as the designated signal.

7. The vehicle-mounted system according to claim 6, characterized in that, The second component is configured to send the data in the cache to the first component if it detects that its corresponding cache is not empty.

Citation Information

Patent Citations

  • SPI (Serial Peripheral Interface) interaction method and device for Slave end to actively output data and electronic equipment

    CN116450561A

  • Data transmission method and device

    CN118337552A