Socketcan implementation method based on in-vehicle infotainment system
Through the use of the CAN transceiver and MCU main controller in the vehicle system, the CAN signal is used, and the Socketcan communication is implemented through the SPI bus, which solves the problem of non -controlling and high cost of CAN communication rate in existing technology. The effect of cost savings.
Patent Information
- Application Number
- CN202411427301.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-01-28
AI Technical Summary
In existing automotive and computer systems, the CAN communication rate is uncontrollable, the applicable scenarios are limited, and it occupies the SOC master pin, or the conversion equipment is added when realizing the dynamic CAN communication rate, which increases the cost of use.
By using the CAN transceiver to receive the CAN signal in the vehicle system, and transform it into the MCU main controller's recognizable CAN signal, the MCU parsing and re -assembling message data that meets the SPI protocol to implement Socketcan communication. This method uses the SPI bus to communicate between the host and from the machine, and use the interrupt signal line to coordinate data transmission.
The dynamic CAN communication rate is achieved, saving the occupation of SOC main control pins, reducing product costs, and improving the ability of the vehicle system to connect to more application equipment, enhancing the competitiveness of enterprise products.
Smart Images

Figure CN119383214A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of vehicle-computer communication, and in particular to a Socketcan implementation method based on a vehicle-computer system. Background Art
[0002] With the rapid development of domestic electric vehicles, people's demand for electric vehicle functions is increasing, which poses new challenges to the CAN (Controller Area Network) communication of the vehicle computer. The vehicle computer of the electric vehicle is mainly divided into two main control parts: SOC (Serial Peripheral Interface) and MCU (Microcontroller Unit). The CAN communication interface can be distributed on these two main controllers. There are two main mainstream CAN communication methods at present. The solutions are as follows: Figure 2 As shown in the figure, the CAN transceiver is directly connected to the CAN signal pin on the main controller, representing the protocols CAN 2.0A and CAN 2.0B; Solution 2 is as follows Figure 3 As shown, it is mainly used in scenarios where the CAN communication rate changes dynamically. The CAN transceiver is connected to the conversion chip to convert the CAN signal into an SPI signal, thereby realizing the adjustable rate function of CAN, which is the vision of the CAN FD (Flexible Data Rate) protocol.
[0003] for Figure 2 In the CAN communication mode, if the SOC master wants to obtain CAN message data from the CAN bus, it needs to be converted through the CAN transceiver and then connected to the corresponding GPIO pin of the SOC master. Although this method can realize the interaction of CAN data, it has the problems of uncontrollable CAN communication rate, limited applicable scenarios, and occupying the SOC master pins.
[0004] for Figure 3 The CAN signal acquisition method is that the CAN transceiver receives the CAN signal from the bus and then sends it to the conversion device. The conversion device converts the CAN signal into an SPI signal and finally sends it to the SOC main control, thereby completing the reception and transmission of the CAN signal. Compared with the first reception and transmission method, this method can obtain a dynamic CAN communication rate and can cope with complex and changeable application environments, but at the same time it increases the conversion device and increases the cost of use. Summary of the invention
[0005] The purpose of the present invention is to provide a Socketcan implementation method based on a vehicle computer system to solve the problems raised by the above background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A Socketcan implementation method based on a vehicle computer system comprises the following steps:
[0008] 1) When the vehicle system is communicating with SocketCAN, the signal of the CAN bus is received by the CAN transceiver, which processes the signal and converts it into a CAN signal that can be recognized by the MCU main controller. After the MCU main controller recognizes the CAN signal, it parses the content and reassembles the CAN message into message data that meets the SPI protocol;
[0009] 2) When the vehicle system performs SPI communication, the SOC main controller is used as the host and the MCU main controller is used as the slave. When the host SOC needs to send an SPI message to the slave MCU, it can be sent directly through the SPI bus;
[0010] 3) When the slave MCU needs to send the SPI message generated after CAN signal processing to the host SOC, it first operates the interrupt signal line. When the host SOC detects the change of the interrupt signal line, it will reply with an approval message to the slave MCU. At this time, the slave MCU can send the SPI message to the SOC controller through the SPI bus, thereby realizing the transmission and reception of Socketcan.
[0011] On the basis of the above technical solution, the present invention also provides the following optional technical solution:
[0012] In an optional solution: the vehicle system includes a CAN bus, an SPI bus, a CAN transceiver, an MCU main controller, a SOC main controller and an interrupt control line.
[0013] In an optional solution: the CAN transceiver is connected to the CAN bus and the MCU main controller, the MCU main controller is connected to the SOC main controller via the SPI bus, and the interrupt control line is connected between the MCU main controller and the SOC main controller.
[0014] In an optional solution: the CAN signal processing process is composed of a CAN bus, a CAN signal line, a CAN transceiver, and an MCU.
[0015] In an optional solution: the Socketcan implementation process consists of an MCU, a SOC, a SPI bus and an interrupt control line.
[0016] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0017] When using the Socketcan implementation method based on the vehicle system, compared with Solution 1, a dynamic CAN communication rate can be obtained by changing the CAN communication rate of the MCU, which saves the pin occupancy of the SOC, allows the vehicle system to connect to more application devices, and improves the competitiveness of corporate products; compared with Solution 2, by saving the conversion chip between the CAN protocol and the SPI protocol, product costs can be saved while ensuring the same effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 The figure is a flow chart of the Socketcan implementation method based on the vehicle computer system.
[0019] Figure 2 This is the flow chart of solution one (the CAN transceiver is directly connected to the CAN signal pin on the main controller).
[0020] Figure 3 This is the flow chart of solution 2 (the CAN transceiver is connected to the conversion chip to convert the CAN signal into SPI signal). DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0022] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments.
[0023] like Figure 3 As shown, a Socketcan implementation method based on a vehicle system is provided as an embodiment of the present invention, including a CAN bus, an SPI bus, a CAN transceiver, an MCU main controller, a SOC main controller and an interrupt control line. The CAN transceiver connects the CAN bus and the MCU main controller, and the MCU main controller and the SOC main controller are connected via the SPI bus for Socketcan communication.
[0024] Figure 3 The specific flow chart of the implementation method is as follows. The implementation method is mainly composed of CAN bus, CAN signal line, CAN transceiver, MCU, SPI bus, SOC, etc. The CAN signal processing process is composed of CAN bus, CAN signal line, CAN transceiver, and MCU. The signal of the CAN bus is received by the CAN transceiver, and the CAN transceiver processes the signal and converts it into a CAN signal that can be recognized by the MCU. After the MCU recognizes the CAN signal, it parses the content and reassembles the CAN message into message data that meets the SPI protocol.
[0025] The Socketcan implementation process consists of MCU, SOC, SPI bus and interrupt control line. For SPI communication, it is necessary to divide the host and slave. In the process of Socketcan communication, SOC is regarded as the host and MCU is regarded as the slave. When the host SOC wants to send SPI message to the slave MCU, it can be sent directly through the SPI bus. If the slave MCU wants to send the SPI message generated after CAN signal processing to the host SOC, it needs to operate the interrupt signal line first. When the host SOC detects the change of the interrupt signal line, it will reply the consent message to the slave MCU. At this time, the MCU can send the SPI message to the SOC controller through the SPI bus, thereby realizing the sending and receiving of Socketcan.
[0026] The above-mentioned embodiment of the present invention provides a Socketcan implementation method based on a vehicle-mounted system, which uses the MCU controller existing in the vehicle-mounted system itself to replace the traditional conversion chip, thereby achieving the same effect as the traditional Socketcan communication, saving the use cost of the vehicle-mounted system, and obtaining a dynamic CAN communication rate by changing the CAN communication rate of the MCU, saving the pin occupancy of the SOC, allowing the vehicle-mounted system to connect to more application devices, and improving the competitiveness of corporate products.
[0027] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A Socketcan implementation method based on a vehicle computer system, characterized in that: The steps include: 1) When the vehicle system is communicating with SocketCAN, the signal of the CAN bus is received by the CAN transceiver, which processes the signal and converts it into a CAN signal that can be recognized by the MCU main controller. After the MCU main controller recognizes the CAN signal, it parses the content and reassembles the CAN message into message data that meets the SPI protocol; 2) When the vehicle system performs SPI communication, the SOC main controller is used as the host and the MCU main controller is used as the slave. When the host SOC needs to send an SPI message to the slave MCU, it can be sent directly through the SPI bus; 3) When the slave MCU needs to send the SPI message generated after CAN signal processing to the host SOC, it first operates the interrupt signal line. When the host SOC detects the change of the interrupt signal line, it will reply with an approval message to the slave MCU. At this time, the slave MCU can send the SPI message to the SOC controller through the SPI bus, thereby realizing the transmission and reception of Socketcan.
2. The Socketcan implementation method based on the vehicle system according to claim 1 is characterized in that: The vehicle system includes a CAN bus, an SPI bus, a CAN transceiver, an MCU main controller, a SOC main controller and an interrupt control line.
3. The Socketcan implementation method based on the vehicle system according to claim 2 is characterized in that: The CAN transceiver is connected to the CAN bus and the MCU main controller, the MCU main controller is connected to the SOC main controller via the SPI bus, and the interrupt control line is connected between the MCU main controller and the SOC main controller.
4. The Socketcan implementation method based on the vehicle system according to claim 1 is characterized in that: The CAN signal processing process consists of CAN bus, CAN signal line, CAN transceiver and MCU.
5. The Socketcan implementation method based on the vehicle system according to claim 1 is characterized in that: The Socketcan implementation process consists of MCU, SOC, SPI bus and interrupt control line.