CAN bus gateway routing method based on autosar architecture and computer system

By modifying the ID in the CAN bus gateway routing table under the autosar architecture to avoid conflicts, the problem that packets with the same ID cannot be routed when using the autosar architecture is solved, and the function of multi-source routing is realized.

CN119583442APending Publication Date: 2025-03-07ZHENGZHOU YUTONG BUS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411656757.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

When using the autosar architecture, gateway routing cannot be implemented when packets with the same ID appear in at least two different networks.

Method used

When adding routing entries to the routing table of the CAN bus gateway, if an ID conflict is found, modify the ID of the added routing entries to be the substitute ID, generate the configuration code and then modify the original ID, and modify the name of the routing entries if necessary to ensure uniqueness.

Benefits of technology

It effectively solves the multi-source routing problem based on the autosar architecture, and realizes the need to forward at least two CAN networks to the same CAN network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583442A_ABST
    Figure CN119583442A_ABST
Patent Text Reader

Abstract

The invention relates to a CAN (Controller Area Network) bus gateway routing method based on an autosar framework and a computer system, and belongs to the field of CAN bus gateway routing. According to the method, when routing entries with ID conflicts are added, the conflicting IDs are temporarily modified, and after configuration codes are generated, the conflicting IDs are modified back. According to the invention, the problem of multi-source routing based on the autosar architecture is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a CAN bus gateway routing method and a computer system based on an AUTOSAR architecture, and belongs to the field of CAN bus gateway routing. Background Art

[0002] The Autosar (Automotive Open System Architecture) initiative group defined a software architecture for the controller, which separates the hardware and software of the device, puts the functional model software and software components together, independently and developed by different manufacturers, and then combines them into a specific project through some automatic configuration processes. The CAN bus gateway is a device that forwards specified message information in a CAN network to different CAN networks. For software development based on the Autosar software architecture, the BSW (Basic SoftWare) part usually needs to rely on the configuration tool (Configurator) for development. The software module needs to integrate the core code of the BSW tool and the configuration code generated by the configuration tool. Therefore, the communication forwarding capability of the software depends on the capability of the BSW configuration tool. The purpose of multi-source routing is to forward messages with specified IDs in at least two networks to the same network. At present, the BSW configuration tool based on the Autosar4.22 version usually cannot support multi-source routing, and the use scenario of multi-source routing is a common requirement in commercial vehicle CAN communication.

[0003] The commonly used multi-source routing solution usually adopts non-Autosar software architecture, and implements the same ID message on multiple CAN networks to be forwarded to a specified CAN network through manual code; if the Autosar architecture is to be used, multi-source routing cannot be implemented due to the limitation of configuration tools. Taking the BSW configuration tool Configurator of Autosar supplier Hengrun as an example, there are several steps to develop the CAN bus gateway function: 1. Maintain a routing table, such as Figure 1 As shown: 2. Import this table into the Configurator tool, such as Figure 2 As shown: 3. Generate routing configuration code by Configurator tool, such as Figure 3 As shown: 4. Integrate the generated configuration code into the software engineering, compile it into the gateway application, and implement the message routing function.

[0004] In the above steps, if a routing entry with ID 0x18FF0004 is added to the forwarding list from CAN3 to CAN1, and then the routing table with the added routing entry is imported into the Configurator tool, the tool will directly report an error, which will cause the subsequent configuration code to fail to generate. This is because there is already a forwarding entry with ID 0x18FF0004 in the forwarding list from CAN2 to CAN1. This will make it impossible for the CAN1 network to know which CAN network the message is sent from after receiving the message with ID 0x18FF0004. Summary of the invention

[0005] The purpose of the present invention is to provide a CAN bus gateway routing method and computer system based on the AUTOSAR architecture, so as to solve the problem that when using the AUTOSAR architecture, when messages with the same ID appear in at least two different networks, gateway routing cannot be implemented.

[0006] To achieve the above object, the solution of the present invention includes: A CAN bus gateway routing method based on the AUTOSAR architecture of the present invention comprises the following steps: when there are at least two forwarding lists of the same target CAN network in the routing table of the CAN bus gateway, the forwarding list comprises routing entries representing the message routing relationship between the two CAN networks; if a routing entry is added, and the ID in the added routing entry is the same as the ID in the routing entry already existing in the routing table, the ID of the added routing entry is modified to a substitute ID, and the substitute ID is unique in the forwarding list of the same target CAN network; the routing table after the routing entry is added is imported into the configuration tool in the AUTOSAR architecture, and a corresponding configuration code is generated; the substitute ID in the configuration code is modified back to the original ID; the modified configuration code is compiled into an application, and the application is applied to the CAN bus gateway.

[0007] Furthermore, when the ID of the routing entry is modified, the name of the routing entry is also modified; the modified name is unique in the forwarding list of the same target CAN network.

[0008] Furthermore, the configuration tool is a BSW configuration tool Configurator.

[0009] Furthermore, the replacement IDs are modified back to the original IDs in the configuration arrays CanIf_TxPduCfg[] and CanIf_RxPduCfg[] in the configuration code.

[0010] A computer system includes a processor, and the processor executes a computer program to implement the following steps: when there are at least two forwarding lists of the same target CAN network in the routing table of a CAN bus gateway, the forwarding list includes a routing entry representing the message routing relationship between the two CAN networks; if a routing entry is added, and the ID in the added routing entry is the same as the ID in the routing entry already existing in the routing table, the ID of the added routing entry is modified to a substitute ID, and the substitute ID is unique in the routing table; the routing table after the routing entry is added is imported into a configuration tool in an AUTOSAR architecture, and a corresponding configuration code is generated; the substitute ID in the configuration code is modified back to the original ID; the modified configuration code is compiled into an application, and the application is applied to the CAN bus gateway.

[0011] Furthermore, when the ID of the routing entry is modified, the name of the routing entry is also modified; the modified name is unique in the forwarding list of the same target CAN network.

[0012] Furthermore, the configuration tool is a BSW configuration tool Configurator.

[0013] Furthermore, the replacement IDs are modified back to the original IDs in the configuration arrays CanIf_TxPduCfg[] and CanIf_RxPduCfg[] in the configuration code.

[0014] The beneficial effects of the present invention are as follows: the present invention is a pioneering invention, and when adding a routing entry with an ID conflict, the conflicting ID is temporarily modified, and after the configuration code is generated, the ID is modified back. The present invention effectively solves the multi-source routing problem based on the Autosar architecture. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a routing representation scheme in the prior art; Figure 2 This is a schematic diagram of the process of importing the routing table into the configuration tool; Figure 3 It is a schematic diagram of the configuration code generated by the prior art; Figure 4 It is a routing representation diagram of the present invention; Figure 5 This is a schematic diagram of a configuration code before ID modification of the present invention; Figure 6 It is a schematic diagram of a configuration code after ID modification of the present invention; Figure 7 It is a schematic diagram of an overall process of the present invention. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0017] The idea of ​​the present invention is that, since the ID in the routing entry to be added conflicts with the existing ID, the ID in the added routing entry is modified, and then modified back after the configuration code is generated.

[0018] Method Example: This embodiment provides a CAN bus gateway routing method based on the Autosar architecture. This embodiment takes two source addresses (CAN2, CAN3) and one target address (CAN1) as an example. Figure 1 As shown in the figure, the routing table in the CAN bus gateway has two forwarding lists with the same target network, CAN2 forwarding to CAN1 and CAN3 forwarding to CAN1. There are multiple routing entries containing message IDs in these two forwarding lists. If a routing entry with Message ID 0x18FF0004 is added to the forwarding list from CAN to CAN1, the configuration tool will report an error because there is already a routing message with the same Message ID in CAN2 forwarding to CAN1. Therefore, the MessageID needs to be modified at this time, that is, 0x18FF0004 needs to be changed to 0x1FFF0004 (alternative ID), as shown in the figure below. Figure 4 As shown. When modifying the MessageID, it is necessary to ensure that the modified ID is unique in the forwarding list of the same target CAN, that is, the modified ID is uniquely represented in the two forwarding lists of CAN2 forwarding to CAN1 and CAN3 forwarding to CAN1. This embodiment only takes the forwarding lists of the minimum two target networks as an example, and technicians in the relevant field should understand that the principle is the same when there are more than two.

[0019] Then import the modified routing table into the corresponding configuration tool. This embodiment takes the BSW configuration tool Configurator of Hengrun as an example to generate the corresponding configuration code. In the CanIf_Lcfg.C file in the generated configuration code, find the code segment with ID 0x1FFF0004 from the configuration arrays CanIf_TxPduCfg[] and CanIf_RxPduCfg[], and modify it to the original ID, i.e. 0x18FF0004. The CanIf_RxPduCfg[] before modification is as follows: Figure 5 As shown, after modification, CanIf_RxPduCfg[] is as follows Figure 6 shown.

[0020] Integrate the modified configuration code into software engineering, compile it into a gateway application, and then apply it to the CAN bus gateway. At this time, the requirement of forwarding at least two CAN networks to the same CAN network can be met.

[0021] Furthermore, in order to facilitate maintenance by operation and maintenance personnel, when modifying the ID, the message name (Message Name) of the message to be modified is also modified, such as Figure 4 As shown. The modified Message Name is also uniquely represented in the forwarding list. For a more intuitive representation, the suffix of the modified Message Name is uniformly represented. The overall process is as follows Figure 7 The present invention uses the BSW configuration tool of Hengrun as an example to explain the process of this embodiment in detail. It should be understood by ordinary technicians in the relevant field that the configuration tools provided by other manufacturers can still be used as other embodiments of the present invention.

[0022] System Example: This embodiment provides a computer system, in which a computer program executed by a processor is designed using the method described in the method embodiment. Since the method has been described clearly enough, it will not be described again here.

[0023] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A CAN bus gateway routing method based on the AUTOSAR architecture, characterized in that: The method comprises the following steps: when there are at least two forwarding lists of the same target CAN network in the routing table of the CAN bus gateway, the forwarding list comprises routing entries representing the message routing relationship between the two CAN networks; if a routing entry is added, and the ID in the added routing entry is the same as the ID in the routing entry already existing in the routing table, the ID of the added routing entry is modified to a substitute ID, and the substitute ID is unique in the forwarding list of the same target CAN network; the routing table after the addition of the routing entry is imported into the configuration tool in the AUTOSAR architecture, and a corresponding configuration code is generated; the substitute ID in the configuration code is modified back to the original ID; the modified configuration code is compiled into an application, and the application is applied to the CAN bus gateway.

2. The CAN bus gateway routing method based on the AUTOSAR architecture according to claim 1 is characterized in that: When the ID of the routing entry is modified, the name of the routing entry is also modified; the modified name is unique in the forwarding list of the same target CAN network.

3. The CAN bus gateway routing method based on the AUTOSAR architecture according to claim 1 is characterized in that: The configuration tool is the BSW configuration tool Configurator.

4. The CAN bus gateway routing method based on the AUTOSAR architecture according to claim 1 is characterized in that: In the configuration arrays CanIf_TxPduCfg[] and CanIf_RxPduCfg[] in the configuration code, the replacement IDs are modified back to the original IDs respectively.

5. A computer system comprising a processor, characterized in that: The processor executes a computer program to implement the following steps: when there are at least two forwarding lists of the same target CAN network in the routing table of the CAN bus gateway, the forwarding list includes a routing entry representing a message routing relationship between the two CAN networks; if a routing entry is added, and the ID in the added routing entry is the same as the ID in the routing entry already existing in the routing table, the ID of the added routing entry is modified to a replacement ID, and the replacement ID is unique in the routing table; the routing table after the routing entry is added is imported into a configuration tool in the AUTOSAR architecture, and a configuration code is generated accordingly; The replacement ID in the configuration code is modified back to the original ID; the modified configuration code is compiled into an application program, and the application program is applied to the CAN bus gateway.

6. The computer system according to claim 5, characterized in that: When the ID of the routing entry is modified, the name of the routing entry is also modified; the modified name is unique in the forwarding list.

7. The computer system according to claim 5, characterized in that: The configuration tool is the BSW configuration tool Configurator.

8. The computer system according to claim 5, characterized in that: In the configuration arrays CanIf_TxPduCfg[] and CanIf_RxPduCfg[] in the configuration code, the replacement IDs are modified back to the original IDs respectively.