Vehicle communication data dynamic routing method
Patent Information
- Application Number
- CN202610906783.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-23
- Publication Date
- 2026-10-16
AI Technical Summary
该方案虽能适配复杂转发逻辑,但存在开发周期长、成本高、软件版本管理复杂、现场响应不及时等问题,难以匹配客户快速改装需求
1.动态灵活配置,快速响应改装需求:通过将转发规则设计为TLV格式的可配置数据结构并存储于非易失性存储器中,无需修改软件代码、编译及刷写固件,仅通过诊断指令即可完成路由映射表的动态下发与更新。这从根本上克服了传统硬编码方案开发周期长、版本管理复杂的缺陷,大幅缩短了车辆个性化改装场景下的需求响应周期,降低了开发与维护成本。
Smart Images

Figure CN122933504A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle communication technology, and more specifically to a dynamic routing method for vehicle communication data. Background Technology
[0002] With the increasing demand for specialized modifications to commercial vehicles, corporate customers often need to install specialized equipment after purchasing vehicles, requiring bidirectional interaction between the vehicle's underlying CAN network and the added equipment. As the core hub of the vehicle network, the gateway controller is responsible for data routing and forwarding between the vehicle's CAN network and the custom CAN network, and is a key component to ensure stable and efficient network communication in modified scenarios.
[0003] Current technologies require a complete overhaul of the software solution to customize CAN network data forwarding. Developers must hard-code forwarding rules to meet specific customer needs, followed by compilation, testing, and flashing of new software versions to implement the functionality. While this approach can accommodate complex forwarding logic, it suffers from long development cycles, high costs, complex software version management, and delayed on-site response, making it difficult to meet customers' rapid modification requirements.
[0004] Therefore, there is an urgent need for a dynamic routing method for vehicle communication data to address the shortcomings of existing technologies. Summary of the Invention
[0005] The purpose of this invention is to provide a dynamic routing method for vehicle communication data to solve the technical problems mentioned in the background section.
[0006] To achieve the above objectives, this invention proposes a dynamic routing method for vehicle communication data, comprising: Configure a TLV format structure according to the preset forwarding rules, and write the structure into the non-volatile memory of the gateway controller to form a routing mapping table; Nodes in the source CAN network generate source messages in TLV format, which include flag bits, forwarding rule index bits, target CAN network identifier, data address, and data field. When the gateway controller receives the source packet, it traverses the routing table based on the forwarding rule index bit of the source packet to match the corresponding forwarding rule; The gateway controller determines the data to be forwarded in the source message based on the matched forwarding rules, the data address and data field of the source message, and forwards the data to be forwarded to the target CAN network.
[0007] Furthermore, the TLV format structure is configured according to the preset forwarding rules, including: Configure the first structure in TLV format according to the preset first forwarding rule; Configure the second structure in TLV format according to the preset second forwarding rule.
[0008] Furthermore, the preset first forwarding rule includes: determining the entire frame of a packet in the data field based on the first data address, and using the entire frame of a packet as data to be forwarded.
[0009] Furthermore, the first data address contains the source frame ID.
[0010] Furthermore, the preset second forwarding rule includes: determining the signal in the data field according to the second data address, encapsulating the signal into the third data address to obtain the target packet, and using the target packet as data to be forwarded.
[0011] Furthermore, the second data address includes the source frame ID, the first start bit, and the first length; The third data address includes the target frame ID, the second start bit, and the second length.
[0012] Furthermore, encapsulating the signal into a third data address to obtain the target message includes: The signal is extracted using a first encoding format, and the signal is encapsulated into a third data address using a second encoding format to obtain the target message.
[0013] Furthermore, the first structure includes a forwarding rule field, a source CAN network field, and a first data address field.
[0014] Furthermore, the second structure includes a forwarding rule field, a source CAN network field, a second data address field, a first encoding format field, a third data address field, a second encoding format field, and a target message period field.
[0015] Furthermore, it also includes: if any data address of multiple structures in the source message is the same, the gateway controller will overwrite the old structure with the same data address with the new structure that was last received in the source message.
[0016] The beneficial effects of the technical solution of this invention include: 1. Dynamic and flexible configuration for rapid response to modification needs: By designing forwarding rules as a configurable data structure in TLV format and storing them in non-volatile memory, the routing table can be dynamically distributed and updated without modifying software code, compiling, or flashing firmware, simply through diagnostic commands. This fundamentally overcomes the shortcomings of traditional hard-coded solutions, such as long development cycles and complex version management, significantly shortening the response cycle for personalized vehicle modification scenarios and reducing development and maintenance costs.
[0017] 2. Achieve precise signal-level routing and effectively reduce network load: Supports precise extraction of specific signals from source messages based on start bit, length, and encoding format, and re-encapsulation into target messages, realizing fine-grained control from whole-frame forwarding to signal-level routing. Compared to traditional whole-frame transparent transmission, only necessary valid data is forwarded, significantly reducing the transmission of redundant information in the CAN network, avoiding bandwidth waste and network congestion, and optimizing bus load rate.
[0018] 3. High scalability and conflict handling mechanism: By defining data overlay rules at the same address, the problem of redundant messages when multiple signals are concurrently encapsulated is effectively solved, preventing message flooding. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating an embodiment of the present invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] First, some of the technical terms used in this invention will be explained to help those skilled in the art understand the invention.
[0022] CAN stands for Controller Area Network, a serial bus protocol used for communication between electronic control units within a vehicle.
[0023] The gateway controller is the core hub of the vehicle network, responsible for data routing and forwarding between different CAN networks.
[0024] The vehicle CAN network refers to the onboard bus network that is standard equipment on vehicles when they leave the factory and designed according to the specifications of the car manufacturer. It is used to realize data communication and control coordination between various electronic control units in the vehicle.
[0025] Vehicle CAN networks include, but are not limited to, the following types: The Body CAN network (BCAN) is typically used to connect low-speed ECUs related to body control, such as windows and door locks; the Powertrain CAN network (PCAN) is typically used to connect high-speed ECUs related to the vehicle's powertrain, such as engine and transmission controllers; and the Chassis CAN network (CCAN) is typically used to connect ECUs related to the chassis control system, such as ABS and ESP.
[0026] A custom CAN network, reserved by the OEM, is provided for enterprise customers to connect their dedicated equipment during vehicle retrofitting. The custom CAN network is not shared with the original vehicle's CAN bus; it achieves isolation and data exchange with the original vehicle network through a gateway controller.
[0027] Custom CAN networks can include, but are not limited to, the following types: External modification controller for special off-road vehicles: used to install special control equipment such as winches, auxiliary lights, and chassis lifting; On-board data acquisition screen: used to display vehicle status and sensor data; External BMS battery system: used for battery management and status monitoring of new energy or modified vehicles; Intelligent driving assistance equipment: such as aftermarket millimeter-wave radar, camera controller, and remote driving control terminal; Fleet management terminal: T-BOX type equipment including GPS positioning, 4G / 5G communication, and remote vehicle status reporting functions; Example 1 This invention proposes a dynamic routing method for vehicle communication data, such as... Figure 1 As shown, the method includes: Configure a TLV format structure according to the preset forwarding rules, and write the structure into the non-volatile memory of the gateway controller to form a routing mapping table; In this embodiment, specifically, the TLV format is a general self-describing hexadecimal data encoding format, consisting of three fields: a tag T, a length L, and a value V. This format features a compact structure, high parsing efficiency, strong scalability, and the ability to achieve dynamic identification and segmentation without pre-fixing the data length, making it suitable for scenarios such as vehicular networks, communication protocols, and dynamic configuration. The tag T is used to identify the forwarding rule and is nested at the beginning of the value V. The length L indicates the byte length of the subsequent value V field, and the value V contains complete forwarding rule information.
[0028] By using a TLV-formatted structure to construct a routing mapping table in the gateway controller, the need for pre-selected IDs is completely eliminated. Corresponding forwarding rules are dynamically added to the structure, enabling fine-grained data forwarding without modifying the software.
[0029] Nodes in the source CAN network generate source messages in TLV format, which include flag bits, forwarding rule index bits, target CAN network identifier, data address, and data field. In this embodiment, the vehicle is pre-installed with a chassis CAN network (CCAN), which periodically sends vehicle speed and engine speed messages. During the custom modification, an external winch controller was added. This controller requires real-time access to the aforementioned two signals to function properly. The modification personnel send two diagnostic commands to the gateway controller using diagnostic tools. Each command carries two TLV-formatted first structures: Specifically, the flag bits include: when the flag bit is 00, the gateway controller performs forwarding; when the flag bit is 01, the gateway controller ignores the packet.
[0030] The forwarding rule index is used to match the forwarding rules of the source packet.
[0031] The data field stores actual physical signal data, and can define engine speed as D0 / D1; and coolant temperature as D2.
[0032] When the gateway controller receives the source packet, it traverses the routing table based on the forwarding rule index bit of the source packet to match the corresponding forwarding rule; Specifically, the gateway controller can parse the source packet immediately upon receiving it, or it can take effect upon the next power-on. The configuration TLV format structure can be stored in non-volatile memory such as EEPROM or Flash on the gateway controller, ensuring that configuration parameters are not lost after power failure. During field modifications, the forwarding policy can be updated in real time by sending source packets through the vehicle's diagnostic port, without needing to disassemble the device and rewrite the program.
[0033] In this embodiment, after receiving the source packet, the gateway controller parses the forwarding rule index bit of the TLV structure in the packet, and traverses the routing mapping table to match the corresponding forwarding rule; if the match fails, the packet is discarded and the error status can be optionally recorded.
[0034] In this embodiment, the source message generated by the source CAN network is: [T=01][L=06][V=01 00 18 D2 30 C1] [T=02][L=11][V=02 00 18 D2 30 C2 18 01 01 0C F1 33 22 16 01 01 0A] After receiving the source message, the gateway controller extracts the following information from the values in the first structure: forwarding rule 01, flag bit 00, target CAN network identifier 18, and source frame ID D2 30 C1.
[0035] Extract information from the values of the second structure: forwarding rule 02, flag bit 00, target CAN network identifier 18, source frame ID is D2 30 C2, first start bit 0x18 (24), first length 01 (1 bit), first encoding format 01 (Intel), target frame ID 0C F1 33 22, second start bit 22 (34), second length 01 (1 bit), second encoding format 01 (Intel) and target message period: 01 0A.
[0036] The gateway controller determines the data to be forwarded in the source message based on the matched forwarding rules, the data address and data field of the source message, and forwards the data to be forwarded to the target CAN network.
[0037] In this embodiment, the gateway controller traverses the routing mapping table, matches the first structure with the first forwarding rule, reads the vehicle message with frame ID 0xD230C1 from the data field of the source message, obtains its 8-byte data field, encapsulates the entire frame message into data to be forwarded, and sends it to the custom CAN network with identifier 18. The external winch controller then receives the complete vehicle speed data.
[0038] After the first structure is parsed, the gateway controller traverses the routing table, matches the second structure with the second forwarding rule, determines the signal in the data field based on the second data address, encapsulates the signal into the third data address to obtain the target message, and uses the target message as the data to be forwarded. The gateway controller then sends the encapsulated target message as the data to be forwarded to the custom CAN network corresponding to the target CAN network identifier 18. The vehicle-mounted acquisition screen then receives the encapsulated unit voltage data.
[0039] In this embodiment, the TLV format structure description feature is used to implement routing rules without programming configuration. The gateway controller stores a dual-type structure routing table without modifying the underlying firmware code. The first forwarding rule directly completes message pass-through through the source frame ID, adapting to the scenario of full-volume data interaction of the entire vehicle. The second forwarding rule relies on start and end offset bits, byte length, and endianness encoding parameters to extract valid signals from the original message, remap them to the specified bit fields of the target CAN frame, and customize the transmission period, thereby simplifying redundant CAN bus messages from the source and effectively controlling the bus load.
[0040] The TLV format configuration structure is based on preset forwarding rules. In the implementation plan, configuring the TLV format structure according to the preset forwarding rules includes: Configure the first structure in TLV format according to the preset first forwarding rule; Configure the second structure in TLV format according to the preset second forwarding rule.
[0041] In this embodiment, the preset first forwarding rule includes: determining the entire frame of a packet in the data field based on the first data address, and using the entire frame of a packet as data to be forwarded.
[0042] In this embodiment, the first data address includes the source frame ID.
[0043] In one embodiment, the first structure includes a forwarding rule field, a source CAN network field, and a first data address field.
[0044] Regarding the aforementioned forwarding rules, particularly the second forwarding rule, in this embodiment of the application, the preset second forwarding rule includes: determining the signal in the data field based on the second data address, encapsulating the signal into a third data address to obtain the target packet, and using the target packet as data to be forwarded.
[0045] The second data address includes the source frame ID, the first start bit, and the first length; The third data address includes the target frame ID, the second start bit, and the second length.
[0046] In one embodiment of this application, encapsulating the signal into a third data address to obtain the target message includes: The signal is extracted using a first encoding format, and the signal is encapsulated into a third data address using a second encoding format to obtain the target message.
[0047] In one embodiment, the second structure includes a forwarding rule field, a source CAN network field, a second data address field, a first encoding format field, a third data address field, a second encoding format field, and a target message period field.
[0048] Furthermore, it also includes: if any data address of multiple structures in the source message is the same, the gateway controller will overwrite the old structure with the same data address with the new structure that was last received in the source message.
[0049] In this embodiment, if any data address of the two structures is the same, the gateway controller will use the second structure to encapsulate the target packet when forwarding data, and the old data corresponding to the first structure will be discarded directly.
[0050] In the traditional hard-coded method, if a customer needs to forward the engine speed signal from PCAN to a custom CAN, the gateway software must be modified, compiled, and flashed. Using the method in this embodiment, only a single TLV structure needs to be issued via diagnostic commands, without requiring a power outage or gateway restart.
[0051] Without modifying the software, it not only supports forwarding entire frames of packets, but also supports fine-grained routing functions that extract, transform, and reassemble specific signals from packets to meet complex modification needs and optimize network load.
[0052] This invention provides superior conflict handling and version management capabilities in multi-signal concurrent encapsulation scenarios. In practical retrofit applications, it is often necessary to dynamically reassemble multiple signals from different source packets, with different start bits, and different encoding formats into the same target packet. This invention introduces the complete data address field and encoding format field from the TLV format structure, combined with conflict handling rules that allow later reception to overwrite earlier reception, enabling multiple signals to be encapsulated into different segments of the same target packet as needed. For example, when retrofit personnel send two TLV structures pointing to the same target frame ID but with different start bits, the gateway controller can automatically identify and retain the last configured signal mapping relationship while discarding the old mapping. This mechanism effectively solves the problem of redundant packets in multi-signal concurrent encapsulation, prevents packet overload, and supports dynamic adjustment of signal encapsulation strategies on-site without restarting the gateway or reflashing the firmware, greatly improving the flexibility and efficiency of the retrofit site.
[0053] In this embodiment, the vehicle CAN network can both transmit data from the custom CAN network back to the original vehicle bus and split the specified signals within the custom CAN network message, re-encode and encapsulate them, and then merge them into the original vehicle standard message. The bidirectional configuration follows the mechanism of new configurations overwriting old configurations at the same address. Bidirectional routing is independently managed and does not interfere with each other, exchanging only valid signals as needed, avoiding a large number of redundant messages caused by bidirectional interconnection, and meeting data exchange requirements.
[0054] The contents not described in detail in this specification are prior art known to those skilled in the art. Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied 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.
[0055] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will 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 apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides functions within one or more boxes.
[0056] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function 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 functions in one or more boxes.
[0057] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the functions in one or more boxes.
[0058] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit its scope of protection. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that after reading the present invention, they can still make various changes, modifications or equivalent substitutions to the specific implementation of the invention, but these changes, modifications or equivalent substitutions are all within the scope of protection of the pending claims of the invention.
Claims
1. A method for dynamic routing of vehicle communication data, characterized in that, include: Configure a TLV format structure according to the preset forwarding rules, and write the structure into the non-volatile memory of the gateway controller to form a routing mapping table; Nodes in the source CAN network generate source messages in TLV format, which include flag bits, forwarding rule index bits, target CAN network identifier, data address, and data field; When the gateway controller receives the source packet, it traverses the routing table based on the forwarding rule index bit of the source packet to match the corresponding forwarding rule; The gateway controller determines the data to be forwarded in the source message based on the matched forwarding rules, the data address and data field of the source message, and forwards the data to be forwarded to the target CAN network.
2. The vehicle communication data dynamic routing method according to claim 1, characterized in that, The TLV format structure configured according to the preset forwarding rules includes: Configure the first structure in TLV format according to the preset first forwarding rule; Configure the second structure in TLV format according to the preset second forwarding rule.
3. The vehicle communication data dynamic routing method according to claim 2, characterized in that, The preset first forwarding rule includes: determining the entire frame of a packet in the data field based on the first data address, and using the entire frame of a packet as data to be forwarded.
4. The vehicle communication data dynamic routing method according to claim 3, characterized in that, The first data address contains the source frame ID.
5. The vehicle communication data dynamic routing method according to claim 2, characterized in that, The first structure includes a forwarding rule field, a source CAN network field, and a first data address field.
6. The vehicle communication data dynamic routing method according to claim 2, characterized in that, The preset second forwarding rule includes: determining the signal in the data field according to the second data address, encapsulating the signal into the third data address to obtain the target packet, and using the target packet as data to be forwarded.
7. The vehicle communication data dynamic routing method according to claim 6, characterized in that, The second data address includes the source frame ID, the first start bit, and the first length; The third data address includes the target frame ID, the second start bit, and the second length.
8. The vehicle communication data dynamic routing method according to claim 6, characterized in that, Encapsulating the signal into a third data address to obtain the target message includes: The signal is extracted using a first encoding format, and the signal is encapsulated into a third data address using a second encoding format to obtain the target message.
9. The vehicle communication data dynamic routing method according to claim 2, characterized in that, The second structure includes a forwarding rule field, a source CAN network field, a second data address field, a first encoding format field, a third data address field, a second encoding format field, and a target message period field.
10. The vehicle communication data dynamic routing method according to claim 1, characterized in that, Also includes: If any data address of multiple structures in the source message is the same, the gateway controller will overwrite the old structure with the same data address with the newest structure received last in the source message.