Routing system and method for cross-chip can data based on autosar architecture and vehicle

By introducing a PDU routing module and a conversion module into the AUTOSAR architecture, CAN frames are directly routed to the conversion module, skipping multiple layers of processing. This solves the CPU resource consumption problem caused by CAN frame signal-level routing and enables efficient cross-chip CAN frame transmission and non-standard protocol adaptation.

CN120896897BActive Publication Date: 2026-02-06NINGBO JOYNEXT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511416647.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2026-02-06
Estimated Expiration
2045-09-30

AI Technical Summary

Technical Problem

In the AUTOSAR architecture, CAN frames are routed as signals and require multiple layers of processing, resulting in severe CPU resource consumption.

Method used

By introducing a PDU routing module and a conversion module into the first chip, CAN frames are directly routed to the conversion module, skipping the multi-level processing of Com, Rte, and Swc. The conversion module performs filtering and packet assembly, and the Com module of the second chip is used for packet unpacking, thus achieving efficient transmission of CAN frames across chips.

Benefits of technology

It significantly reduces CPU resource consumption, improves cross-chip transmission efficiency, avoids redundant processing caused by signal-level disassembly, supports the adaptation and transmission of non-standard protocols, and ensures the compatibility and stability of CAN frame parsing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120896897B_ABST
    Figure CN120896897B_ABST
Patent Text Reader

Abstract

The application discloses a routing architecture, a routing method and a vehicle based on AUTOSAR architecture cross-chip CAN data, and the routing architecture comprises a first chip and a second chip. A CAN interface module of the first chip receives a CAN frame of a CAN bus and sends the CAN frame to a PDU routing module, the PDU routing module directly routes the CAN frame to a conversion module in the first chip, and a protocol driving module in the first chip sends the CAN frame processed by the conversion module to the second chip through a preset protocol. A Com module transplanted from AUTOSAR in the second chip receives a packaged CAN frame and unpacks the CAN frame to obtain a CAN signal. The application solves the problem that in the related art, a CAN frame is routed in a signal unit, needs to be processed by multiple layers of Com, Rte and SWC, a frame of data causes hundreds of times of Rte interface calling, and CPU resources are seriously consumed, and the transmission efficiency of cross-chip CAN data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data transmission, in particular to a routing system and method for CAN data across chips based on an AUTOSAR architecture and a vehicle. BACKGROUND

[0002] With the rapid development of automotive electronics technology, the number of electronic control units (ECUs) in modern vehicles is increasing, and the functions are becoming more and more complex. In order to manage these complex electronic systems, the AUTOSAR (AUTomotive Open System ARchitecture) architecture has become a de facto standard in the field of automotive embedded software development; it separates hardware and software through a layered design concept, greatly improving the reusability, maintainability and scalability of software.

[0003] In the AUTOSAR architecture, controller area network (CAN) communication as the core of the vehicle backbone network, its data transmission mechanism has been well defined. The standard routing path is: CAN bus, CAN interface module (CanIf), protocol data unit routing module (PduR), communication module (Com), runtime environment (Rte), application software component (SWC); for gateway routing between standard protocols (such as CAN to LIN), AUTOSAR also provides support, the path is: CAN, CanIf, PduR, LIN interface module (LinIf), LIN bus.

[0004] However, the related art has at least one of the following problems: the related art routes CAN frames in units of signals, which requires multi-layer processing of Com, Rte, and SWC; a CAN frame may contain hundreds of signals, which results in hundreds of Rte interface calls when processing a frame of data, seriously consuming CPU resources. SUMMARY

[0005] The technical problem solved by the present application is that the related art routes CAN frames in units of signals, which requires multi-layer processing of Com, Rte, and SWC; a CAN frame may contain hundreds of signals, which results in hundreds of Rte interface calls when processing a frame of data, seriously consuming CPU resources.

[0006] To solve the above problems, the application provides a routing system for CAN data based on an AUTOSAR architecture, which comprises a first chip and a second chip, the first chip being connected with a CAN bus, and the second chip being connected with the first chip through a preset protocol; the first chip comprises a CAN interface module, which is configured to receive a CAN frame on the CAN bus and send the CAN frame to a PDU routing module; the PDU routing module is connected with the CAN interface module and is configured to receive the CAN frame and directly route the CAN frame to a conversion module; the conversion module is connected with the PDU routing module and is configured to receive the CAN frame from the PDU routing module and filter and packet the CAN frame; a protocol driving module is connected with the conversion module and is configured to receive the CAN frame from the conversion module and send the CAN frame to the second chip through the preset protocol; and the second chip comprises a Com module, which is transplanted from the AUTOSAR architecture and is configured to receive the packeted CAN frame and unpack the CAN frame to obtain a CAN signal.

[0007] Compared with the prior art, the technical effects achieved by the technical scheme are as follows: compared with the routing of the CAN frame in units of signals in the related art, the CAN frame is directly routed from the PDU routing module to the conversion module through the cooperation of the PDU routing module and the conversion module, so that the Com, Rte and Swc multi-levels are skipped, a large number of Rte interface calls caused by signal-level unpacking are avoided, and CPU resource occupation can be significantly reduced; on this basis, the conversion module directly filters and packets the CAN frame, so that redundant processing of signal-level transmission is avoided, the number of data exchanges is reduced, and the cross-chip transmission efficiency is improved; and through the combination of the conversion module and the protocol driving module, the CAN frame is transmitted through the adaptation of the preset protocol, so that the transmission of the CAN frame is not limited to the standard communication protocol; and the Com module of the second chip is transplanted from the AUTOSAR, so that the CAN frame analysis compatibility and stability are ensured without the need for redeveloping analysis logic.

[0008] In an example of the application, the second chip further comprises an interface module, which is configured to receive the CAN frame signal from the protocol driving module and send the CAN frame signal to the Com module.

[0009] Compared with the prior art, the technical effects achieved by the technical scheme are as follows: the interface module is a connection module of the protocol driving module in the second chip and the first chip, the receiving path of the protocol driving module for sending data according to the preset protocol is determined, and data transmission discontinuity is avoided.

[0010] In an example of the application, the preset protocol is a non-AUTOSAR standardized communication protocol; and the non-AUTOSAR standardized communication protocol at least comprises an SPI protocol and a UART protocol.

[0011] Compared with the prior art, the technical effects achieved by the technical scheme are as follows: the preset protocol is a non-standardized communication protocol, and can be adapted to SPI, UART and other commonly used cross-chip protocols in automotive electronics.

[0012] In one example of the present application, a CAN data routing method across chips based on the AUTOSAR architecture is also provided, which can apply the routing system in any of the above examples; the routing method comprises: receiving a CAN frame on a CAN bus through a CAN interface module of a first chip; configuring a conversion module connected with a PDU routing module in the first chip; configuring a routing destination of the CAN frame in the PDU routing module as the conversion module; controlling the PDU routing module to directly route the received CAN frame to the conversion module; controlling the conversion module to filter and packetize the CAN frame, and send the processed CAN frame to a protocol driver module; controlling the protocol driver module to send the processed CAN frame to a second chip via a preset protocol; controlling an interface module in the second chip to receive the CAN frame and transmit it to a Com module; and controlling the Com module to unpack and analyze the CAN frame to obtain a CAN signal.

[0013] Compared with the prior art, the technical effects achieved by the technical scheme are as follows: the transmission process of the CAN frame is converted into a step-by-step method of receiving, configuring, routing by the PDU routing module, processing by the conversion module, transmission by the protocol driver module, and analysis by the Com module of the CAN interface module; and by configuring the conversion module as the routing destination and controlling the CAN frame to be directly routed from the PDU routing module to the conversion module, link failure and skipping of the intermediate layer caused by configuration errors can be avoided, and CPU consumption can be effectively reduced.

[0014] In one example of the present application, controlling the PDU routing module to directly route the received CAN frame to the conversion module comprises: when the PDU routing module receives the CAN frame, triggering the PDU routing module to call a callback function; wherein the callback function is pre-configured in the PDU routing module by the conversion module; and by executing the callback function, data information of the CAN frame is transmitted to the conversion module.

[0015] Compared with the prior art, the technical effects achieved by the technical scheme are as follows: by pre-configuring the callback function, triggering the callback function, and executing the logic of transmitting data, the interaction between the PDU routing module and the conversion module can be standardized, and errors caused by unclear routing mechanism can be avoided; and the callback function is a commonly used mechanism for module interaction in AUTOSAR, the implementation method is compatible with the AUTOSAR architecture, and the bottom logic of the PDU routing module does not need to be modified.

[0016] In one example of the present application, the control conversion module filters and packetizes the CAN frame, including: setting a data reference value for each CAN frame; when any CAN frame is received, searching for the corresponding data reference value according to the identifier of the CAN frame; if there is no corresponding data reference value, determining that the CAN frame is first received, and storing the CAN frame as a new data reference value, and determining that the CAN frame is valid data; if there is a corresponding data reference value, comparing the data of the CAN frame with the data reference value.

[0017] Compared with the prior art, the technical effects achieved by adopting the technical solution are: by setting a data reference value for the CAN frame, and comparing the received CAN frame with the reference value, whether the current CAN frame is first received or multiple times is determined, and the CAN frame is divided.

[0018] In one example of the present application, the data of the CAN frame is compared with the stored data reference value, including: if the data is consistent with the data reference value, the current CAN frame is discarded; if the data is inconsistent with the data reference value, the current CAN frame is determined to be valid data for packet sending, and the data of the current CAN frame is updated as the data reference value.

[0019] Compared with the prior art, the technical effects achieved by adopting the technical solution are: by the data reference value change detection logic, only the changed data is transmitted, which can effectively reduce invalid data transmission and processing, and directly reduces the communication consumption of the chip.

[0020] In one example of the present application, the current CAN frame is determined to be valid data for packet sending, including: storing the CAN frame of the valid data into a sending queue; extracting at least one CAN frame from the sending queue according to a preset packet format to packetize, to generate a to-be-sent data packet; and sending the to-be-sent data packet to a protocol driving module, and sending the to-be-sent data packet to a second chip by the protocol driving module.

[0021] Compared with the prior art, the technical effects achieved by adopting the technical solution are: by the packetizing manner, the data of the CAN frame is packaged and sent at a time, which significantly reduces the communication times; and the packet sending can effectively reduce the interruption times of the second chip due to frequent data reception, which is beneficial to reduce the CPU load.

[0022] In one example of the present application, a vehicle is also provided, which can apply the routing system in any of the above examples, and can implement the routing method in any of the above examples.

[0023] Compared with the prior art, the technical effects achieved by adopting the technical solution are: the technical effects in any of the above examples can be achieved, which will not be repeated here.

[0024] By adopting the technical solution of the present application, the following technical effects can be achieved:

[0025] (1) The present application, by cooperation of the PDU routing module and the conversion module, routes the CAN frame directly from the PDU routing module to the conversion module, passing through the Com, Rte and Swc multi-levels, avoids a large number of Rte interface calls caused by signal level disassembly, can significantly reduce CPU resource occupation; on this basis, the conversion module directly filters and packages the CAN frame, avoids redundant processing of signal level transmission, reduces the number of data exchanges, and improves cross-chip transmission efficiency; and through the combination of the conversion module and the protocol driving module, the CAN frame is adapted for transmission by the preset protocol, so that the transmission of the CAN frame is not limited to the standard communication protocol; and the Com module of the second chip transplants AUTOSAR, without the need to redevelop the analysis logic, ensuring the compatibility and stability of CAN frame analysis;

[0026] (2) The present application converts the transmission process of the CAN frame into a step-by-step method of receiving, configuring, routing the CAN frame by the PDU routing module, processing by the conversion module, transmission by the protocol driving module, and analysis by the Com module; and by configuring the conversion module as the routing destination and controlling the CAN frame to be routed directly from the PDU routing module to the conversion module, link failure caused by configuration errors and passing through the intermediate layer can be avoided, and CPU consumption can be effectively reduced;

[0027] (3) The present application, by the way of packaging, packages the data of the CAN frame and sends it at one time, significantly reducing the number of communications; and the packaged transmission can effectively reduce the number of interrupts generated by the second chip due to frequent data reception, which is conducive to reducing CPU load. BRIEF DESCRIPTION OF DRAWINGS

[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings to be used in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor;

[0029] Figure 1 A module diagram of a cross-chip CAN data routing system based on the AUTOSAR architecture is provided for the embodiments of the present application;

[0030] Figure 2 An effect diagram of configuring PduR under the Vector tool is provided for the embodiments of the present application;

[0031] Figure 3This is a screenshot showing the effect of successful configuration using the Vector tool, provided in an embodiment of the present invention.

[0032] Figure 4 This invention provides a method for routing cross-chip CAN data based on the AUTOSAR architecture. Detailed Implementation

[0033] To facilitate understanding of this solution, the existing technologies are further elaborated below. Common standard communication protocols under the AUTOSAR architecture include CAN, LIN, FlexRay, and Ethernet. Taking CAN communication as an example, the standard solution provided by AUTOSAR generally includes: CAN communication routing path: CAN bus, CANif, PduR, Com, Rte, SWC; however, for hybrid communication architectures, AUTOSAR does not provide a routing scheme from CAN to non-standard communication protocols. If you want to implement CAN to non-standard communication protocols under the AUTOSAR architecture based on the above standard CAN communication routing path scheme, the following scheme can be used: CAN bus, CANif, PduR, Com, Rte, SWC, Rte, CDD, chip B; In this scheme, data is transmitted on the chip in units of CAN signals; the CAN frame is parsed into CAN signals by the Com module and then sent to the RTE module. The RTE module then sends the CAN signal to the application layer, where it has been broken down into smaller CAN signals. Each CAN signal has a set of interfaces at the RTE layer, shared by the SWC module. The disadvantages of this approach are: in projects with a large number of CAN signals, the process involves receiving signals via Com, RTE, and SWC, then routing them to chip B via SWC, RTE, and CDD, which involves several interface calls. This significantly increases the processing load of the RTE layer and consumes excessive system resources. Furthermore, a signal that originally occupies only 1 bit in a CAN frame will occupy 1 byte after being parsed by Com. This consumes the RAM resources of chip A and increases the communication load, wastes resources, increases transmission time, and reduces communication efficiency during cross-chip data transmission.

[0034] Based on the above, in order to make the above-mentioned objectives, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0035] See Figure 1 , Figure 1A module diagram of a cross-chip CAN data routing system based on an AUTOSAR architecture is provided for an embodiment of the present application. Specifically, the cross-chip CAN data routing system based on the AUTOSAR architecture comprises a first chip and a second chip, the first chip is connected with a CAN bus, and the second chip is connected with the first chip through a preset protocol. The first chip comprises a CAN interface module, a PDU routing module, a conversion module, and a protocol driving module. The CAN interface module is configured to receive a CAN frame on the CAN bus and send the CAN frame to the PDU routing module. The PDU routing module is connected with the CAN interface module and is configured to receive the CAN frame and directly route the CAN frame to the conversion module. The conversion module is connected with the PDU routing module and is configured to receive the CAN frame from the PDU routing module and filter and packet the CAN frame. The protocol driving module is connected with the conversion module and is configured to receive the CAN frame from the conversion module and send the CAN frame to the second chip through the preset protocol. The second chip comprises a Com module, which is transplanted from the AUTOSAR architecture and is configured to receive the packeted CAN frame and unpack the CAN frame to obtain a CAN signal.

[0036] Further, the second chip further comprises an interface module, which is configured to receive the CAN frame signal from the protocol driving module and send the CAN frame signal to the Com module.

[0037] Further, the preset protocol is a non-AUTOSAR standardized communication protocol, and the non-AUTOSAR standardized communication protocol at least comprises an SPI protocol and a UART protocol.

[0038] Further, please refer to Figure 1 wherein the chip A is the first chip, and the chip B is the second chip; the CAN interface module is a CanIf layer in the first chip; the module is an AUTOSAR standard module; the module receives original frame data from a CAN controller through a bottom CAN driving and performs preliminary processing, and then transmits a CAN frame meeting the requirements to the PDU routing module upwards;

[0039] Please refer to Figure 2 and Figure 3; wherein the PDU routing module is the PduR layer in the first chip; the module is an AUTOSAR standard module, and is a key of the application; an AUTOSAR configuration tool, such as Vector DaVinci Developer, is used to add a routing rule to the routing table in the module; the rule configures the "destination" of a specific CAN identifier, i.e., CAN ID, or a specific range of CAN frames, as a user-defined module, i.e., the conversion module described below; after the configuration is completed, the code generated by the tool will cause the PduR to no longer send the target CAN frame to the Com module when the target CAN frame is received, but to call the callback function registered by the conversion module.

[0040] wherein the conversion module is the CDD-CAN module in the first chip; the module is a custom module developed according to a non-standard, and has filtering and packetizing functions, and sends the valid CAN frames in the sending queue to the protocol driver module.

[0041] wherein the protocol driver module is the CDD-SPI module; the protocol driver module only receives the packetized data output by the conversion module, does not modify the data, and directly sends the data to the SPI slave device interface of the second chip through the SPI master device interface, i.e., to the interface module of the second chip.

[0042] wherein the interface module is the slave device interface, i.e., the SPI interface module, of the second chip that is adapted to the protocol driver module; the module is used to process the CAN frames, and transmit the data that passes the check to the Com module;

[0043] wherein the Com module is transplanted from the AUTOSAR architecture, and is set to reverse unpack the packetized data according to the packetizing format of the first chip; first, the check value is verified, and then each CAN frame unit is extracted according to the "total frame number", and is restored to an independent CAN frame; then, the parsing operation is performed to disassemble the frame data into individual CAN signals, and the CAN signals are provided to the application layer software component on the second chip through the interface thereof, and are provided to the application layer of the second chip through the internal interface.

[0044] For the convenience of understanding the present scheme, the above SPI protocol is taken as an example for illustration; in particular, the present application provides a data routing scheme which is not in units of CAN signals but in units of CAN frames; based on the AUTOSAR framework, in the first chip, a CDD-CAN module is added; the CAN interface module of the first chip listens to the CAN bus in real time, when a CAN frame is received, the complete CAN frame is encapsulated as a PDU and sent to the PDU routing module; through AUTOSAR configuration, the CAN frame at the PDU routing module is directly routed to the CDD-CAN module, and no longer passes through the Com module and Rte module in the first chip for processing; after receiving the CAN frame, the CDD-CAN module sends the CAN frame to the second chip through the protocol driver module, i.e. the CDD-SPI module; the second chip is provided with a corresponding SPI interface module corresponding to the SPI protocol; when the SPI interface module receives the CAN frame, it is also sent to the Com module transplanted from the AUTOSAR framework in the form of a frame, the Com module unpacks the CAN frame to form a CAN signal and sends it to the application layer of the second chip; by optimizing the CAN signal routing into CAN frame routing, the data transmission path is shortened, it is not necessary to pass through the Rte layer, hundreds of Rte interfaces are reduced, the system resource occupation is reduced, and the processing efficiency is improved; and after the CAN signal routing is optimized into the CAN frame routing, the redundant communication load occupation is reduced, and the data transmission efficiency between chips is improved.

[0045] Further, the above scheme can also be reused in the routing scheme between other standard communication protocols and non-standard communication protocols, such as LinIf, PduR, CDD-Lin, CDD-Uart; FlexRayIf, PduR, CDD-FlexRay, CDD-Uart, etc., which will not be described one by one here.

[0046] Further, please refer to Figure 4 The present application also provides a routing method for CAN data across chips based on the AUTOSAR framework, which can be applied to the above routing system; the routing method comprises:

[0047] S1: receiving a CAN frame on the CAN bus through the CAN interface module of the first chip;

[0048] S2: configuring a conversion module connected with the PDU routing module in the first chip;

[0049] S3: configuring the routing destination of the CAN frame in the PDU routing module as the conversion module;

[0050] S4: controlling the PDU routing module to directly route the received CAN frame to the conversion module;

[0051] S5: control the conversion module to filter and package the CAN frame, and send the processed CAN frame to the protocol driver module;

[0052] S6: control the protocol driver module to send the processed CAN frame to the second chip via a preset protocol;

[0053] S7: control the interface module in the second chip to receive the CAN frame and transmit it to the Com module;

[0054] S8: control the Com module to unpack and analyze the CAN frame to obtain the CAN signal.

[0055] Specifically, the CAN interface of the first chip accepts the CAN frame on the CAN bus; using the AUTOSAR configuration tool, a PDU routing module is added with a routing path of a specific CAN ID that needs to be transmitted across chips, and the target module is selected as the created conversion module, i.e., the CDD-CAN module; on this basis, the CAN interface module of the first chip accepts the CAN frame from the CAN bus and transmits it to the RDU routing module, the PDU routing module calls the CDD-CAN module and the registered callback function according to the preconfigured rules, thereby directly transmitting the CAN frame data to the CDD-CAN module; the CDD-CAN module filters and packages the CAN frame within a task cycle; and the processed CAN frame calls the sending API of the CDD-SPI module to submit the data packet in the sending buffer; the CDD-SPI module starts transmission and sends the data to the second chip through the SPI bus; the SPI interface module of the second chip receives the data packet and puts it into the buffer; finally, the Com module transplanted in the second chip reads the CAN frame from the buffer, unpacks it according to the preset format, restores the CAN frame, and then analyzes it into a CAN signal for use by the application layer in the second chip.

[0056] Further, the PDU routing module is controlled to directly route the received CAN frame to the conversion module, including:

[0057] When the PDU routing module receives the CAN frame, the PDU routing module is triggered to call the callback function; wherein the callback function is preconfigured in the PDU routing module by the conversion module;

[0058] By executing the callback function, the data information of the CAN frame is transmitted to the conversion module.

[0059] Optionally, the callback function is xx_RxIndication().

[0060] Specifically, in the conversion module initialization phase, a CAN frame callback function is registered to the PDU routing module, which functions to accept the CAN frame PDU transmitted by the PDU routing module and convert it into the temporary buffer of the conversion module; when the PDU routing module receives the CAN frame PDU from the CAN interface module, it will notify the CDD-CAN module through xx_RxIndication(), and in the CDD-CAN module, the function xx_RxIndication() is implemented; through this function, the complete data (such as frame ID, data length, data field) of the CAN frame PDU is passed to the conversion module, realizing the direct routing of "skipping the Com layer and the Rte layer".

[0061] It should be noted that this callback xxx_RxIndication() is called through an interrupt, and complex processing cannot be performed in the interrupt, otherwise it will cause system problems; therefore, by setting a periodic function, first analyze the DBC, group the CAN frames by period, and define different periodic functions for different periodic CAN frames; for the period interval with a large number of CAN frames, define 2 periodic functions, for example, 10ms periodic functions have 10ms_1 and 10ms_2, which disperses the processing load of a single time.

[0062] Further, set an offset for each periodic function to stagger their execution times to avoid the phenomenon of long execution time when a timeout occurs for a certain large period.

[0063] Further, the conversion module is controlled to filter and packetize the CAN frames, including:

[0064] Set a data reference value for each CAN frame;

[0065] When any CAN frame is received, find the corresponding data reference value according to the identifier of the CAN frame;

[0066] If there is no corresponding data reference value, determine that the CAN frame is received for the first time, store the CAN frame as a new data reference value, and determine that the CAN frame is valid data;

[0067] If there is a corresponding data reference value, compare the data of the CAN frame with the data reference value.

[0068] Specifically, after the conversion module is powered on, a "CAN frame reference value storage area" is initialized, a storage unit is allocated for each supported CAN frame ID, and the initial value is set to "invalid"; when the conversion module receives a CAN frame, the reference value storage area is queried according to the frame ID: if the reference value corresponding to the ID is "invalid", it is determined that it is the first reception, the data of the current CAN frame is stored in the reference value storage area, and the current CAN frame is marked as "valid data" and added to the sending queue; if the reference value corresponding to the ID is "valid", the data field of the current CAN frame is extracted and compared with the data field in the reference value byte by byte.

[0069] Further, the data of the CAN frame is compared with the stored data reference value, including:

[0070] If the data is consistent with the data reference value, the current CAN frame is discarded;

[0071] If the data is inconsistent with the data reference value, the current CAN frame is determined to be valid data for packet assembly and sending, and the data of the current CAN frame is updated as the data reference value.

[0072] Specifically, if the comparison is consistent: the current CAN frame is determined to be "repeated data" and is directly discarded without being added to the sending queue; if the comparison is inconsistent: the current CAN frame is determined to be "valid data", the reference value of the ID in the reference value storage area is updated as the data of the current CAN frame, and the current CAN frame is added to the sending queue.

[0073] Further, the current CAN frame is determined to be valid data for packet assembly and sending, including:

[0074] The CAN frame of the valid data is stored in the sending queue;

[0075] According to a preset packet assembly format, at least one CAN frame is extracted from the sending queue for packet assembly to generate a to-be-sent data packet;

[0076] The to-be-sent data packet is sent to the protocol driving module, and the protocol driving module sends the to-be-sent data packet to the second chip.

[0077] Specifically, the conversion module monitors the number of frames in the sending queue in real time; and according to a preset packet assembly format, the valid data frames in the sending queue are encapsulated as "packet assembly data", and the sending queue is emptied after encapsulation; the conversion module sends the packet assembly data to the protocol driving module (CDD-SPI), the CDD-SPI sends the packet assembly data to the interface module of the second chip through the SPI master device interface according to the SPI protocol parameters; the interface module of the second chip receives the packet assembly data, and transmits the packet assembly data to the Com module after completing synchronization detection and length verification; the Co module unpacks, verifies, and analyzes the CAN signal according to a preset logic to provide the CAN signal to an application layer, and completes the entire cross-chip CAN data routing process.

[0078] Further, the present application also provides a vehicle, which can apply the routing system in any of the above and can implement the routing method in any of the above.

Claims

1. A method for routing CAN data across chips based on AUTOSAR architecture, characterized in that, The routing method comprises: receiving a CAN frame on a CAN bus through a CAN interface module of a first chip; configuring a conversion module connected with a PDU routing module in the first chip; configuring a routing destination of the CAN frame in the PDU routing module as the conversion module; controlling the PDU routing module to directly route the received CAN frame to the conversion module; controlling the conversion module to filter and packetize the CAN frame and send the processed CAN frame to a protocol driver module; controlling the protocol driver module to send the processed CAN frame to a second chip via a preset protocol; controlling an interface module in the second chip to receive the CAN frame and transmit it to a Com module; controlling the Com module to unpack and parse the CAN frame to obtain a CAN signal; controlling the conversion module to filter and packetize the CAN frame, comprising: setting a data reference value for each CAN frame; when any CAN frame is received, searching for the corresponding data reference value according to the identifier of the CAN frame; if there is no corresponding data reference value, determining that the CAN frame is received for the first time and storing the CAN frame as a new data reference value, and determining that the CAN frame is valid data; if there is a corresponding data reference value, comparing the data of the CAN frame with the data reference value; the comparison of the data of the CAN frame with the data reference value comprises: if the data is consistent with the data reference value, discarding the current CAN frame; if the data is inconsistent with the data reference value, determining that the current CAN frame is valid data for packetized sending, and updating the data of the current CAN frame as the data reference value.

2. The routing method of claim 1, wherein, the control of the PDU routing module to directly route the received CAN frame to the conversion module comprises: when the PDU routing module receives the CAN frame, triggering the PDU routing module to call a callback function; wherein the callback function is pre-configured in the PDU routing module by the conversion module; by executing the callback function, the data information of the CAN frame is transmitted to the conversion module.

3. The routing method of claim 1, wherein, the determination that the current CAN frame is valid data for packetized sending comprises: storing the CAN frame of the valid data into a sending queue; extracting at least one CAN frame from the sending queue according to a preset packetized format to packetize, to generate a to-be-sent data packet; sending the to-be-sent data packet to the protocol driver module, and sending the to-be-sent data packet to the second chip by the protocol driver module.

4. A system for routing of CAN data across chips based on AUTOSAR architecture, characterized in that, The routing system can implement the routing method of any one of claims 1 to 3; the routing system comprises: the first chip and the second chip, the first chip is connected with a CAN bus; the second chip is connected with the first chip through a preset protocol; the first chip comprises: a CAN interface module, configured to receive a CAN frame on the CAN bus and send the CAN frame to a PDU routing module; the PDU routing module, connected with the CAN interface module, configured to receive the CAN frame and directly route the CAN frame to a conversion module; the conversion module, connected with the PDU routing module, configured to receive the CAN frame from the PDU routing module and filter and package the CAN frame; a protocol driver module, connected with the conversion module, configured to receive the CAN frame from the conversion module and send the CAN frame to the second chip through a preset protocol; the second chip comprises: a Com module, transplanted from the AUTOSAR architecture, configured to receive the packaged CAN frame and unpack the CAN frame to obtain a CAN signal.

5. The routing system according to claim 4, wherein the second chip further comprises: an interface module, configured to receive the CAN frame signal from the protocol driver module and send the CAN frame signal to the Com module.

6. The routing system according to claim 4, wherein the preset protocol is a non-AUTOSAR standardized communication protocol; the non-AUTOSAR standardized communication protocol at least comprises an SPI protocol and a UART protocol.

7. A vehicle characterized by comprising: The routing system according to any one of claims 4 to 6 can be applied, and the routing method according to any one of claims 1 to 3 can be implemented.

Citation Information

Patent Citations

  • Method for forwarding data in a communication system of a vehicle

    US20250106286A1