Message information routing method and device, electronic equipment and storage medium

By determining the transit mailbox in the CAN driver module for routing control, the problems of message information routing complexity and resource consumption are solved, and a fast and efficient routing process is achieved.

CN120658668APending Publication Date: 2025-09-16CHINA AUTOMOTIVE INNOVATION CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510853285.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In the prior art, the routing process of message information between controller area network channels is complicated, resulting in that messages with a short forwarding time limit cannot meet the requirements and consumes a large amount of central processing unit resources.

Method used

By obtaining the target message information and its path information, the target transfer mailbox is determined, and routing control is performed based on the transfer mailbox, which simplifies the routing process to be completed within the CAN driver module, avoiding the processing of multiple modules in the communication protocol stack.

Benefits of technology

It improves the message routing speed, reduces processor resource consumption, simplifies the routing process, and improves routing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120658668A_ABST
    Figure CN120658668A_ABST
Patent Text Reader

Abstract

The invention relates to a message information routing method and apparatus, an electronic device and a storage medium. The method comprises the steps of obtaining to-be-routed target message information and target path information corresponding to the target message information; according to the target path information, a target transfer mailbox is determined, and the target transfer mailbox is used for achieving routing of the target message information between controller local area network channels indicated by the target path information; and performing routing control operation on the target message information based on the target transfer mailbox. According to the invention, the message routing efficiency can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle-mounted network information routing, and in particular to a message information routing method, device, electronic equipment and storage medium. Background Art

[0002] To meet system architecture requirements, improve system performance, and facilitate system expansion and maintenance, message information needs to be transmitted between different Controller Area Network (CAN) channels. In related technologies, routing message information between CAN channels typically requires processing by multiple modules within the communication protocol stack, including the Protocol Data Unit (PDU) router module and the CAN interface module. This complex routing process can result in some messages with short forwarding deadlines failing to meet the required time limits and consumes significant Central Processing Unit (CPU) resources. Summary of the Invention

[0003] In order to solve at least one of the above-mentioned technical problems, the present disclosure proposes a message information routing method, device, electronic device and storage medium.

[0004] In one aspect, the present invention provides a message information routing method, comprising: Obtain target message information to be routed and target path information corresponding to the target message information; Determine a target transfer mailbox according to the target path information, where the target transfer mailbox is used to implement routing of the target message information between the controller area network channels indicated by the target path information; Based on the target transit mailbox, perform routing control operations on the target message information.

[0005] In an optional embodiment, the target transfer mailbox includes a first target mailbox and a second target mailbox, and determining the target transfer mailbox according to the target path information includes: Determine the source-side controller LAN channel and the target-side controller LAN channel corresponding to the target message information according to the target path information; Determine the receiving mailbox corresponding to the local area network channel of the source controller as the first target mailbox; The sending mailbox corresponding to the local area network channel of the target end controller is determined as the second target mailbox.

[0006] In an optional embodiment, performing a routing control operation on the target message information based on the target transit mailbox includes: Send the target message information in the local area network channel of the source controller to the first target mailbox; Routing target message information in the first target mailbox to the second target mailbox; The target message information in the second target mailbox is sent to the target end controller local area network channel.

[0007] In an optional embodiment, the receiving mailbox corresponding to the source-side controller LAN channel and the sending mailbox corresponding to the target-side controller LAN channel are obtained by the following steps: Determine first message identification information and second message identification information, the first message identification information indicating a message identification range corresponding to messages configured to be transmitted through a source-side controller local area network channel, and the second message identification information indicating a message identification range corresponding to messages configured to be transmitted through a target-side controller local area network channel; Based on the first message identification information, adjust the message acceptance range corresponding to the first initial mailbox to obtain a receiving mailbox corresponding to the source-end controller local area network channel, where the first initial mailbox represents a mailbox for receiving messages sent from the controller local area network bus, and the message acceptance range of the receiving mailbox corresponding to the source-end controller local area network channel includes the message range corresponding to the first message identification information; Based on the second message identification information, the message sending range corresponding to the second initial mailbox is adjusted to obtain the sending mailbox corresponding to the target end controller LAN channel. The second initial mailbox represents the mailbox that sends the message to the controller LAN bus. The message sending range of the sending mailbox corresponding to the target end controller LAN channel includes the message range corresponding to the second message identification information.

[0008] In an optional embodiment, the target path information is obtained by the following steps: Obtaining routing indication information and target message identification information, where the routing indication information is used to describe the correspondence between message identification information corresponding to different message information and routing path information corresponding to different message information, and the target message identification information is the message identification information corresponding to the target message information; The routing indication information is traversed according to the target message identification information, and the routing path information corresponding to the target message identification information is determined as the target path information.

[0009] In an optional embodiment, the method further includes: When the second target mailbox receives the target message information, the target message information in the first target mailbox is deleted; When the target end controller LAN channel receives the target message information, the target message information in the second target mailbox is deleted.

[0010] In a second aspect, the present invention further provides a message information routing device, comprising: A first acquisition module is used to obtain target message information to be routed and target path information corresponding to the target message information; A mailbox determination module is used to determine a target transit mailbox based on the target path information, and the target transit mailbox is used to implement routing of target message information between the controller local area network channels indicated by the target path information; The routing control module is used to perform routing control operations on target message information based on the target transit mailbox.

[0011] In a third aspect, the present invention further provides an electronic device, comprising: processor; a memory for storing processor-executable instructions; The processor is used to execute instructions to implement the above-mentioned message information routing method.

[0012] In a fourth aspect, the present invention further provides a storage medium, which, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the above-mentioned message information routing method.

[0013] In a fifth aspect, the present invention also provides a computer program product, which includes a computer program, the computer program is stored in a readable storage medium, and at least one processor of a computer device reads and executes the computer program from the readable storage medium, so that the device executes the above-mentioned message information routing method.

[0014] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.

[0015] The implementation of this disclosure has the following beneficial effects: Obtain the target message information to be routed and the target path information corresponding to the target message information; determine the target transit mailbox based on the target path information, and the target transit mailbox is used to realize the routing of the target message information between the controller LAN channels indicated by the target path information; based on the target transit mailbox, perform routing control operations on the target message information.

[0016] The present disclosure determines, based on target path information of target message information to be routed, a target transit mailbox for implementing routing of target message information between controller LAN channels indicated by the target path information, and performs routing control operations on the target message information based on the target transit mailbox. This enables routing of messages between controller LAN channels through forwarding of the target transit mailbox, thereby eliminating the need for processing of multiple modules in a communication protocol stack, simplifying the routing process of message information, improving message routing speed, reducing processor resources consumed by message routing, and effectively improving message routing efficiency.

[0017] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the following is a brief introduction to the drawings required for the embodiments or prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. The drawings herein are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present disclosure and, together with the specification, used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.

[0019] Figure 1 This is a schematic diagram illustrating a method for implementing message information routing using a communication protocol stack according to an exemplary embodiment; Figure 2 is a flow chart showing a message information routing method according to an exemplary embodiment; Figure 3 is a flow chart showing a method of obtaining target path information according to an exemplary embodiment; Figure 4 is a flowchart showing a mailbox configuration according to an exemplary embodiment; Figure 5 This is a flowchart showing a method of deleting target message information according to an exemplary embodiment; Figure 6 is a schematic diagram illustrating a message information routing method applied to a CAN driver module according to an exemplary embodiment; Figure 7 is a schematic diagram of a message information routing device according to an exemplary embodiment; Figure 8 The present invention is a block diagram of an electronic device for message information routing according to an exemplary embodiment. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the embodiments described are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this invention.

[0021] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0022] Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. Like reference numerals in the drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise indicated. The word "exemplary" is used herein to mean "serving as an example, example, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as superior or preferred over other embodiments.

[0023] The term "and / or" herein simply describes an association relationship between associated objects, indicating that three relationships can exist. For example, "A and / or B" can represent the existence of three situations: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" herein refers to any combination of at least two of any one or more of a plurality of items. For example, "at least one of A, B, and C" can represent any one or more elements selected from the set consisting of A, B, and C.

[0024] In addition, numerous specific details are provided in the following detailed description to better illustrate the present disclosure. Those skilled in the art will appreciate that the present disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main points of the present disclosure.

[0025] Figure 1 This is a schematic diagram showing a method of implementing message information routing using a communication protocol stack according to an exemplary embodiment. A message information routing method in related art is as follows: Figure 1As shown, in related art, message routing between Controller Area Network (CAN) channels is typically accomplished through collaboration between the various architectural layers of the Automotive Open System Architecture Classic Platform (AUTOSAR CP) Controller Area Network (CAN) communication protocol stack (hereinafter referred to as the AUTOSAR CP CAN communication protocol stack). The architectural layers related to message communication in the AUTOSAR CP CAN communication protocol stack include at least a communication service layer, a communication hardware abstraction layer, and a communication driver layer. Specifically, related art utilizes at least the Protocol Data Unit (PDU) Router module in the communication service layer, the CAN Interface module in the communication hardware abstraction layer, and the CAN driver module in the communication driver layer. Specifically, after receiving a message from the source, the message must be processed sequentially through the CAN driver module, CAN Interface module, PDU Router module, CAN Interface module, and finally CAN driver module before routing is completed. This process requires the operation and coordination of the communication service layer, communication hardware abstraction layer, and communication driver layer, which consumes a lot of operating resources. The PDU router module and CAN interface module also consume a lot of CPU resources. When routing messages within a very short time limit, such as within 2ms, the complex routing methods used in related technologies are difficult to meet.

[0026] Figure 2 FIG. 1 is a flow chart of a message information routing method according to an exemplary embodiment. Figure 2 The message information routing method shown is applied to the CAN driver module, and the message information routing method includes the following: Step S201: Acquire target message information to be routed and target path information corresponding to the target message information.

[0027] In the disclosed embodiments, the target message information to be routed can be any CAN message that needs to be transmitted between different Controller Area Network (CAN) channels during vehicle simulation testing or on a real vehicle. For example, in vehicle simulation testing, the target message information to be routed can be the message information used during the vehicle dynamics modeling phase to simulate the CAN message transceiver functionality of the vehicle's CAN communication network. In real vehicle applications, the target message information to be routed can be data or instructions involved in various electronic units or systems connected to the CAN bus.

[0028] In an exemplary embodiment, the target message information to be routed in a real vehicle application can be message data such as vehicle speed and engine temperature measured by sensor nodes in the CAN network of the real vehicle, or sensor data or control instructions for monitoring and controlling the engine operating status by the engine control unit (ECU), sensors and actuators connected to the CAN bus, or electronic control instructions for function settings such as window control, electric door locks, air conditioning control, and lighting management in the vehicle body electronic system, or safety operation instructions for safety functions in the braking system such as the anti-lock braking system (ABS), electronic stability program (ESP), and traction control system (TCS) of modern cars, or message data when the in-vehicle infotainment system or navigation system exchanges data with other systems.

[0029] In an embodiment of the present disclosure, the target path information corresponding to the target message information is used to indicate the routing direction of the target message information between different controller area network channels, namely, the source-end controller area network channel (referred to as the source-end CAN channel) and the target-end controller area network channel (referred to as the target-end CAN channel) corresponding to the target message information. The target message information is routed from the source-end controller area network channel to the target-end controller area network channel. The source-end controller area network channel and the target-end controller area network channel are two different controller area network channels among multiple controller area network channels connected to the same controller area network bus (referred to as CAN bus).

[0030] Figure 3 FIG. 1 is a flow chart showing a method of obtaining target path information according to an exemplary embodiment. In an optional embodiment, as shown in FIG. Figure 3 As shown, the target path information is obtained through the following steps: Step S301: Obtain routing indication information and target message identification information. The routing indication information is used to describe the correspondence between message identification information corresponding to different message information and routing path information corresponding to different message information. The target message identification information is the message identification information corresponding to the target message information.

[0031] In the disclosed embodiments, the routing instruction information may be a routing table that summarizes the correspondence between message identification information corresponding to different message information and routing path information corresponding to each message information. This routing table is stored in the CAN driver module so that the CAN driver module can independently complete the routing of the message information. The message identification information is the message ID identifier (CANID) corresponding to the message information. Different message information corresponds to a different CANID, so the CANID is unique.

[0032] In an exemplary embodiment, the routing indication information may be a routing table obtained by arranging the message identification information corresponding to different message information and the routing path information corresponding to different message information one by one. The routing table information obtained by such arrangement is more detailed and specific.

[0033] In another exemplary embodiment, since the message identification information corresponding to the message information generated by the same electronic unit is associated or similar, for example, the message identification information serial numbers corresponding to the multiple message information continuously generated by the engine temperature sensor within a certain period of time are continuous, and the message information generated by the same electronic unit has the same transmission path under a specific function, that is, the transmission paths of the multiple consecutive message information with the same source are consistent. Therefore, the method of summarizing the message identification information corresponding to different message information and the routing path information corresponding to different message information in the routing indication information can be to correspond the multiple consecutive message information to the same routing path information, that is, to determine the message identification information corresponding to the multiple consecutive message information as a message identification range, correspond the message identification range to the same routing path information, and arrange the different message identification ranges and the routing path information corresponding to the different message identification ranges to obtain a routing table. The routing table information obtained by this arrangement occupies less storage space.

[0034] Step S302: traverse the routing indication information according to the target message identification information, and determine the routing path information corresponding to the target message identification information as the target path information.

[0035] In an embodiment of the present disclosure, for a case where the routing indication information is a routing table obtained by arranging the message identification information corresponding to different message information and the routing path information corresponding to different message information one by one, traversing the routing indication information according to the target message identification information and determining the routing path information corresponding to the target message identification information as the target path information can be performed by matching the target message identification information with each message identification information in the routing table, and determining the routing path information corresponding to the message identification information that matches the target message identification information as the target path information.

[0036] In an embodiment of the present disclosure, in a case where routing indication information is a routing table obtained by arranging different message identification ranges and the routing path information corresponding to each of the different message identification ranges, traversing the routing indication information according to the target message identification information and determining the routing path information corresponding to the target message identification information as the target path information may be performed by matching the target message identification information with each message identification range in the routing table, and determining the routing path information corresponding to the message identification range that matches the target message identification information as the target path information. The message identification range that matches the target message identification information means that the target message identification information falls within the message identification range.

[0037] Based on the above, it can be seen that in the embodiment of the present disclosure, by obtaining routing indication information and target message identification information, and traversing the routing indication information according to the target message identification information, the routing path information corresponding to the target message identification information is determined as the target path information, so as to quickly determine the target path information corresponding to the target message information.

[0038] Step S202: determining a target transfer mailbox according to the target path information, where the target transfer mailbox is used to implement routing of target message information between the controller area network channels indicated by the target path information.

[0039] In an optional embodiment, the target transfer mailbox includes a first target mailbox and a second target mailbox, and determining the target transfer mailbox according to the target path information includes: Step S2021: Determine the source-side controller LAN channel and the target-side controller LAN channel corresponding to the target message information according to the target path information.

[0040] In the disclosed embodiments, the target path information corresponding to the target message information is used to indicate the routing direction of the target message information between different Controller Area Network (CAN) channels. The target message information is routed from the source CAN channel to the target CAN channel. The source CAN channel and the target CAN channel are two different CAN channels among multiple CAN channels connected to the same CAN bus (hereinafter referred to as the CAN bus). It should be noted that the source CAN channel and the target CAN channel refer to the interfaces of the gateway device, and the target path information is used to manage the routing path of the target message information within the gateway. They are not the original sender and final receiver of the message, but rather the entry and exit channels of the message within the gateway. When the target path information indicates that the routing direction of the target message information between different CAN channels is CAN1 channel -> CAN3 channel, the source CAN channel corresponding to the target message information is CAN1 channel, and the target CAN channel corresponding to the target message information is CAN3 channel. When the target path information indicates that the routing direction of the target message information between different controller area network channels is CAN2 channel -> CAN5 channel, the source controller area network channel corresponding to the target message information is CAN2 channel, and the target controller area network channel corresponding to the target message information is CAN5 channel.

[0041] Step S2022: Determine the receiving mailbox corresponding to the local area network channel of the source controller as the first target mailbox.

[0042] In an embodiment of the present disclosure, a controller area network bus is connected to multiple controller area network channels. For example, the controller area network channels connected to the controller area network bus include CAN1 channel, CAN2 channel, ..., CANn channel. The present disclosure configures each controller area network channel with its own dedicated receiving mailbox. The receiving mailbox of each controller area network channel is responsible for receiving message information sent by the corresponding controller area network channel. When the source end controller area network channel is CAN1 channel, the receiving mailbox corresponding to CAN1 channel is determined as the first target mailbox. When the source end controller area network channel is CAN2 channel, the receiving mailbox corresponding to CAN2 channel is determined as the first target mailbox.

[0043] Step S2023: Determine the sending mailbox corresponding to the LAN channel of the target-side controller as the second target mailbox.

[0044] In the disclosed embodiment, each CAN channel is configured with its own dedicated send mailbox. Each CAN channel's send mailbox is responsible for storing message information to be transmitted by the corresponding CAN channel. If the target CAN channel is CAN3, the send mailbox corresponding to CAN3 is determined as the second target mailbox. If the target CAN channel is CAN5, the send mailbox corresponding to CAN5 is determined as the second target mailbox.

[0045] Based on the above, it can be known that in the embodiment of the present disclosure, by determining the source-end controller LAN channel and the target-end controller LAN channel corresponding to the target message information, and determining the receiving mailbox corresponding to the source-end controller LAN channel as the first target mailbox, and determining the sending mailbox corresponding to the target-end controller LAN channel as the second target mailbox, it is possible to facilitate the use of the receiving mailbox corresponding to the source-end controller LAN channel and the sending mailbox corresponding to the target-end controller LAN channel to complete the routing of the message information from the source-end controller LAN channel to the target-end controller LAN channel.

[0046] Step S203: Based on the target transfer mailbox, perform routing control operations on the target message information.

[0047] In the embodiment of the present disclosure, performing a routing control operation on the target message information based on the target transit mailbox means routing the target message information from the source end controller LAN channel to the target end controller LAN channel based on the target transit mailbox.

[0048] Based on the above, it can be seen that in the embodiment of the present disclosure, by determining the target transit mailbox for routing the target message information between the controller LAN channels indicated by the target path information based on the target message information to be routed, and performing routing control operations on the target message information based on the target transit mailbox, it is possible to complete the routing of message information between the controller LAN channels without the need for processing of multiple modules in the communication protocol stack in the related technology, thereby simplifying the routing process of the message information, improving the message routing speed, reducing the processor resources consumed by the message routing, and effectively improving the routing performance.

[0049] In an optional embodiment, performing a routing control operation on the target message information based on the target transit mailbox includes: Step S2031: Send the target message information in the local area network channel of the source controller to the first target mailbox.

[0050] In the embodiment of the present disclosure, the target message information in the source-end controller LAN channel may be the target message information transmitted from the upstream node of the source-end controller LAN channel to the source-end controller LAN channel.

[0051] In an exemplary embodiment, taking the transmission of engine temperature sensor data to the instrument panel for display as an example, the engine temperature data collected by the engine temperature sensor is configured to be sent via the CAN1 channel, and the instrument panel is configured to receive messages via the CAN3 channel. The source controller LAN channel corresponding to the engine temperature data is the CAN1 channel, the target controller LAN channel is the CAN3 channel, and the upstream node of the source controller LAN channel is the engine temperature sensor. After the engine temperature data is transmitted from the engine temperature sensor to the source controller LAN channel CAN1 channel, the engine temperature data is sent from the source controller LAN channel CAN1 channel to the first target mailbox, that is, the receiving mailbox of the CAN1 channel.

[0052] In another exemplary embodiment, taking the transmission of the door status message generated by the body control unit to the central locking system for door control operation as an example, the door status message generated by the body control unit is configured to be sent via the CAN2 channel, then the source controller LAN channel corresponding to the door status message is the CAN2 channel, and the upstream node of the source controller LAN channel is the body control unit. After the door status message is transmitted by the body control unit to the source controller LAN channel CAN2 channel, the door status message is sent by the source controller LAN channel CAN2 channel to the first target mailbox, that is, the receiving mailbox of the CAN2 channel.

[0053] Step S2032: Routing the target message information in the first target mailbox to the second target mailbox.

[0054] In an exemplary embodiment, taking the transmission of engine temperature sensor data to the instrument panel for display as an example, the instrument panel is configured to receive messages via the CAN3 channel. The target controller LAN channel corresponding to the engine temperature data is the CAN3 channel, and the second target mailbox is the sending mailbox of the CAN3 channel. Therefore, the engine temperature data in the receiving mailbox of the CAN1 channel is routed to the sending mailbox of the CAN3 channel.

[0055] In another exemplary embodiment, taking the transmission of the door status message generated by the body control unit to the central locking system for door control operation as an example, the central locking system is configured to receive messages via the CAN5 channel, then the target end controller LAN channel corresponding to the door status message is the CAN5 channel, and the second target mailbox is the sending mailbox of the CAN5 channel. Therefore, the door status message in the receiving mailbox of the CAN2 channel is routed to the sending mailbox of the CAN5 channel.

[0056] Step S2033: Send the target message information in the second target mailbox to the target end controller LAN channel.

[0057] In the embodiment of the present disclosure, after the target-side controller LAN channel obtains the target message information in the second target mailbox, the target message information is transmitted to a downstream node of the target-side controller LAN channel.

[0058] In an exemplary embodiment, taking the transmission of engine temperature sensor data to the instrument panel for display as an example, the downstream node of the target end controller local area network channel CAN3 is the instrument panel. After the CAN3 channel obtains the engine temperature data in its sending mailbox, the engine temperature data is transmitted to the instrument panel, and the instrument panel parses and displays the temperature value.

[0059] In another exemplary embodiment, taking the transmission of the door status message generated by the body control unit to the central locking system for door control operation as an example, the downstream node of the target end controller local area network channel CAN5 channel is the central locking system. After the CAN5 channel obtains the door status message in its sending mailbox, it transmits the door status message to the central locking system, and the central locking system performs door control according to the door status indicated by the door status message, such as locking or unlocking the car.

[0060] Based on the above, it can be seen that in the embodiment of the present disclosure, by sending the target message information in the LAN channel of the source-end controller to the first target mailbox, routing the target message information in the first target mailbox to the second target mailbox, and sending the target message information in the second target mailbox to the LAN channel of the target-end controller, the receiving mailbox corresponding to the LAN channel of the source-end controller and the sending mailbox corresponding to the LAN channel of the target-end controller can be used to complete the routing of the message information from the LAN channel of the source-end controller to the LAN channel of the target-end controller, avoiding the consumption of a large amount of processor resources caused by the processing of multiple modules in the communication protocol stack, making the routing of message information between the controller LAN channels faster and simpler, and improving routing efficiency.

[0061] Figure 4 FIG. 1 is a flowchart showing a mailbox configuration according to an exemplary embodiment. In an optional embodiment, as Figure 4 As shown, the receiving mailbox corresponding to the LAN channel of the source controller and the sending mailbox corresponding to the LAN channel of the target controller are obtained by the following steps: Step S401: Determine first message identification information and second message identification information, the first message identification information indicates a message identification range corresponding to a message configured to be transmitted through a source-side controller LAN channel, and the second message identification information indicates a message identification range corresponding to a message configured to be transmitted through a target-side controller LAN channel.

[0062] In the disclosed embodiment, in the vehicle network, appropriate Controller Area Network (CAN) channels are pre-configured based on the source or type of different messages generated during operation to prevent confusion in message transmission. The configuration method can be determined based on the electronic units connected to each CAN channel. For example, if the CAN channel connected to the engine temperature sensor has CAN1 and CAN2, then for the engine temperature data output by the engine temperature sensor, CAN1 and CAN2 are configured to transmit messages from the upstream node engine temperature sensor; if the CAN channel connected to the instrument panel has CAN3 and CAN4, then for the messages that the instrument panel may need to obtain, CAN3 and CAN4 are configured to transmit messages that the downstream node instrument panel needs to obtain.

[0063] In the embodiment of the present disclosure, the message identification range corresponding to the message transmitted by the source-end controller LAN channel can be the message identification range corresponding to the message output by the upstream electronic unit connected to the source-end controller LAN channel. The message identification range corresponding to the message output by the upstream electronic unit is the message identification range reserved for the message output by the upstream electronic unit. When the upstream electronic unit is running, the message identification information corresponding to the output message is determined from this range in sequence. When the source-end controller LAN channel is connected to only one upstream electronic unit, the first message identification information is the message identification range corresponding to the message output by the upstream electronic unit. When the source-end controller LAN channel is connected to multiple upstream electronic units, the first message identification information is the set of message identification ranges corresponding to the messages output by the multiple upstream electronic units.

[0064] In the disclosed embodiment, the message identification range corresponding to messages transmitted through the target-side controller area network channel may be the message identification range corresponding to messages required to be obtained by a downstream electronic unit connected to the target-side controller area network channel. The message identification range corresponding to messages required to be obtained by the downstream electronic unit is the message identification range reserved for messages output by a target upstream electronic unit, where the target upstream electronic unit is the upstream electronic unit that provides messages to the downstream electronic unit. The second message identification information is the message identification range corresponding to messages output by the upstream electronic unit that provides messages to the downstream electronic unit.

[0065] Step S402: Based on the first message identification information, adjust the message acceptance range corresponding to the first initial mailbox to obtain the receiving mailbox corresponding to the LAN channel of the source controller. The first initial mailbox represents the mailbox that receives the message sent by the LAN bus of the controller. The message acceptance range of the receiving mailbox corresponding to the LAN channel of the source controller includes the message range corresponding to the first message identification information.

[0066] In an embodiment of the present disclosure, in a default state or initial state, the first initial receiving mailbox may be a mailbox for receiving messages sent from a controller local area network bus. Adjusting the message acceptance range corresponding to the first initial receiving mailbox may be achieved by configuring mask information of the first initial receiving mailbox, where the mask information is used to indicate the message range transmitted by the mailbox. Based on the first message identification information, the message acceptance range corresponding to the first initial receiving mailbox is adjusted. Specifically, the mask information of the first initial receiving mailbox may be adjusted to the message representation range indicated by the first message identification information, thereby obtaining the receiving mailbox corresponding to the source controller local area network channel.

[0067] Step S403: Based on the second message identification information, adjust the message sending range corresponding to the second initial mailbox to obtain the sending mailbox corresponding to the target end controller LAN channel, the second initial mailbox represents the mailbox that sends the message to the controller LAN bus, and the message sending range of the sending mailbox corresponding to the target end controller LAN channel includes the message range corresponding to the second message identification information.

[0068] In the embodiment of the present disclosure, in the default state or initial state, the second initial receiving mailbox can be a mailbox that sends messages to the controller LAN bus. Adjusting the message acceptance range corresponding to the second initial mailbox can be achieved by configuring the mask information of the second initial receiving mailbox. The mask information is used to indicate the message range transmitted by the mailbox. Based on the second message identification information, the message acceptance range corresponding to the second initial mailbox is adjusted. Specifically, the mask information of the second initial receiving mailbox can be adjusted to the message representation range indicated by the second message identification information, and then the sending mailbox corresponding to the target end controller LAN channel is obtained. The message identification information corresponding to the target message information belongs to the first message identification information and also belongs to the second message identification information.

[0069] Based on the above, it can be seen that in the embodiment of the present disclosure, the message acceptance range corresponding to the first initial mailbox is adjusted based on the first message identification information, and the receiving mailbox corresponding to the LAN channel of the source-end controller is obtained, so that a receiving mailbox dedicated to the channel can be provided for the LAN channel of the source-end controller; the message sending range corresponding to the second initial mailbox is adjusted based on the second message identification information, and the sending mailbox corresponding to the LAN channel of the target-end controller is obtained, so that a sending mailbox dedicated to the channel can be provided for the LAN channel of the source-end controller, thereby reducing the possibility of routing congestion in the routing process of message information and improving the routing efficiency of message information associated with the LAN channel of the source-end controller.

[0070] Figure 5 FIG. 1 is a flow chart showing a method of deleting target message information according to an exemplary embodiment. In an optional embodiment, as shown in FIG. Figure 5 As shown, the method further includes: Step S501: when the second target mailbox receives the target message information, the target message information in the first target mailbox is deleted.

[0071] In the embodiment of the present disclosure, taking the engine temperature data collected by the engine temperature sensor as an example, which is configured to be sent through the source end CAN1 channel, and after routing, the target end CAN3 channel transmits the message to the instrument panel, the first target mailbox is the receiving mailbox of the source end CAN1 channel, and the second target mailbox is the sending mailbox of the target end CAN3 channel. When the sending mailbox of the target end CAN3 channel receives the engine temperature data, the target message information in the receiving mailbox of the source end CAN1 channel is deleted.

[0072] Step S502: when the target end controller LAN channel receives the target message information, the target message information in the second target mailbox is deleted.

[0073] In the embodiment of the present disclosure, the engine temperature data collected by the engine temperature sensor is configured to be sent through the source end CAN1 channel, and after routing, the target end CAN3 channel transmits the message to the instrument panel. When the target end CAN3 channel receives the engine temperature data, the engine temperature data in the sending mailbox of the target end CAN3 channel is deleted.

[0074] Based on the above, it can be seen that in the embodiment of the present disclosure, by deleting the target message information in the first target mailbox when the second target mailbox receives the target message information, the storage space occupied by the storage function of the first target mailbox can be reduced; by deleting the target message information in the second target mailbox when the target end controller LAN channel receives the target message information, the storage space occupied by the storage function of the second target mailbox can be reduced, and the message routing performance can be optimized.

[0075] Figure 6 FIG. 1 is a schematic diagram showing a message information routing method applied to a CAN driver module according to an exemplary embodiment. In a specific embodiment, Figure 6As shown, embodiments of the present disclosure are applied to a CAN driver module. The embodiments include configuring dedicated receive and transmit mailboxes for each CAN channel. The CAN channels connected to the CAN bus include CAN1, CAN2, CAN3, CAN4, and CAN5. The receive mailboxes (Rx mailboxes) configured for CAN1-CAN5 are designated as Rx mailbox CAN1, Rx mailbox CAN2, Rx mailbox CAN3, Rx mailbox CAN4, and Rx mailbox CAN5, respectively. The transmit mailboxes (Tx mailboxes) configured for CAN1-CAN5 are designated as Tx mailbox CAN1, Tx mailbox CAN2, Tx mailbox CAN3, Tx mailbox CAN4, and Tx mailbox CAN5, respectively. Each Rx mailbox is used to store incoming CAN messages from each channel (CAN1-CAN5), while each Tx mailbox is used to store upcoming CAN messages from each channel (CAN1-CAN5) pending transmission. Embodiments of the present disclosure compile a routing table containing the message identification information (CANID) and routing path information corresponding to each CAN message into a routing table, which is stored in the CAN driver. Taking three CAN messages with CANIDs of 0x743, 0x589, and 0x232 as examples, the source CAN channel corresponding to the CAN message with CANID of 0x743 is CAN1, and the target CAN channel is CAN3. The routing direction of this message between CAN channels is CAN1->CAN3; the source CAN channel corresponding to the CAN message with CANID of 0x589 is CAN2, and the target CAN channel is CAN4. The routing direction of this message between CAN channels is CAN2->CAN4; the source CAN channel corresponding to the CAN message with CANID of 0x232 is CAN3, and the target CAN channel is CAN5. The routing direction of this message between CAN channels is CAN3->CAN5. Taking the routing of a CAN message with a CAN ID of 0x743 as an example, the CAN1 channel receives the message, and the CAN driver saves it in CAN1's ​​receive mailbox (Rx mailbox CAN1). The CAN driver then searches the routing table to find that the source CAN channel of the message is CAN1 and the target CAN channel is CAN3. After the query is completed, the message is immediately routed from CAN1's ​​receive mailbox (Rx mailbox CAN1) to CAN3's transmit mailbox (Tx mailbox CAN3). Finally, the CAN driver controls the CAN3 channel to send the message in its Tx mailbox. The message is routed from CAN1 to CAN3. Through the above implementation, the present disclosure only needs to add a routing table to the CAN driver, allowing routing to be completed in the CAN driver module, saving the additional overhead of other modules and improving routing efficiency.

[0076] Figure 7FIG. 1 is a block diagram of a message information routing device according to an exemplary embodiment. Figure 7 The device includes a first acquisition module 701, a mailbox determination module 702 and a routing control module 703, wherein: The first acquisition module 701 is used to obtain target message information to be routed and target path information corresponding to the target message information; A mailbox determination module 702 is configured to determine a target transit mailbox based on the target path information, wherein the target transit mailbox is configured to implement routing of the target message information between the controller area network channels indicated by the target path information; The routing control module 703 is used to perform routing control operations on target message information based on the target transit mailbox.

[0077] In an optional embodiment, the target transfer mailbox includes a first target mailbox and a second target mailbox, and the mailbox determination module 702 includes: A channel determination unit, configured to determine a source-side controller LAN channel and a target-side controller LAN channel corresponding to the target message information according to the target path information; The first mailbox unit is used to determine the receiving mailbox corresponding to the local area network channel of the source controller as the first target mailbox; The second mailbox unit is used to determine the sending mailbox corresponding to the local area network channel of the target end controller as the second target mailbox.

[0078] In an optional embodiment, the routing control module 703 includes: A first transmission unit is used to send target message information in the local area network channel of the source controller to a first target mailbox; A second transmission unit is used to route the target message information in the first target mailbox to the second target mailbox; The third transmission unit is used to send the target message information in the second target mailbox to the local area network channel of the target end controller.

[0079] In an optional embodiment, the apparatus further comprises: a message identification determination module, configured to determine first message identification information and second message identification information, the first message identification information indicating a message identification range corresponding to messages configured to be transmitted through a source-side controller LAN channel, and the second message identification information indicating a message identification range corresponding to messages configured to be transmitted through a target-side controller LAN channel; a first configuration module, configured to adjust a message acceptance range corresponding to a first initial mailbox based on the first message identification information to obtain a receiving mailbox corresponding to the source-end controller local area network channel, wherein the first initial mailbox represents a mailbox for receiving messages sent from the controller local area network bus, and the message acceptance range of the receiving mailbox corresponding to the source-end controller local area network channel includes a message range corresponding to the first message identification information; The second configuration module is used to adjust the message sending range corresponding to the second initial mailbox based on the second message identification information, and obtain the sending mailbox corresponding to the target end controller LAN channel. The second initial mailbox represents the mailbox that sends the message to the controller LAN bus, and the message sending range of the sending mailbox corresponding to the target end controller LAN channel includes the message range corresponding to the second message identification information.

[0080] In an optional embodiment, the apparatus further comprises: A second acquisition module is configured to acquire routing indication information and target message identification information, wherein the routing indication information is used to describe the correspondence between message identification information corresponding to different message information and routing path information corresponding to different message information, and the target message identification information is the message identification information corresponding to the target message information; The target path determination module is used to traverse the routing indication information according to the target message identification information, and determine the routing path information corresponding to the target message identification information as the target path information.

[0081] In an optional embodiment, the apparatus further comprises: A first deleting module is configured to delete the target message information in the first target mailbox when the second target mailbox receives the target message information; The second deleting module is used to delete the target message information in the second target mailbox when the target end controller local area network channel receives the target message information.

[0082] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware such as processing circuits or memory, or a combination thereof. Similarly, one processor or multiple processors or memories can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the functions of the module or unit.

[0083] In an exemplary embodiment, an electronic device is further provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is used to execute the instructions to implement the message information routing method in the embodiment of the present disclosure.

[0084] Figure 8 This is a block diagram of an electronic device for message information routing according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a message information routing method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc. Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0085] In an exemplary embodiment, a storage medium is further provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the message information routing method in the embodiment of the present disclosure. In an exemplary embodiment, a computer program product is also provided, which includes a computer program stored in a readable storage medium. At least one processor of a computer device reads and executes the computer program from the readable storage medium, so that the device executes the message information routing method in the embodiment of the present disclosure.

[0086] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, which can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present disclosure can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0087] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.

[0088] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A message information routing method, characterized in that: The method comprises: Obtaining target message information to be routed and target path information corresponding to the target message information; Determining a target transfer mailbox according to the target path information, wherein the target transfer mailbox is used to implement routing of the target message information between the controller area network channels indicated by the target path information; Based on the target transit mailbox, a routing control operation is performed on the target message information.

2. The message information routing method according to claim 1, characterized in that: The target transfer mailbox includes a first target mailbox and a second target mailbox. Determining the target transfer mailbox according to the target path information includes: Determining, according to the target path information, a source-side controller LAN channel and a target-side controller LAN channel corresponding to the target message information; Determine the receiving mailbox corresponding to the local area network channel of the source controller as the first target mailbox; The sending mailbox corresponding to the local area network channel of the target end controller is determined as the second target mailbox.

3. The message information routing method according to claim 2, characterized in that: The performing a routing control operation on the target message information based on the target transit mailbox includes: Sending the target message information in the local area network channel of the source controller to the first target mailbox; Routing the target message information in the first target mailbox to the second target mailbox; The target message information in the second target mailbox is sent to the target end controller local area network channel.

4. The message information routing method according to claim 2, characterized in that: The receiving mailbox corresponding to the local area network channel of the source controller and the sending mailbox corresponding to the local area network channel of the target controller are obtained by the following steps: Determining first message identification information and second message identification information, wherein the first message identification information indicates a message identification range corresponding to messages configured to be transmitted through the source-side controller LAN channel, and the second message identification information indicates a message identification range corresponding to messages configured to be transmitted through the target-side controller LAN channel; Based on the first message identification information, adjusting a message acceptance range corresponding to a first initial mailbox to obtain a receiving mailbox corresponding to the source-end controller LAN channel, where the first initial mailbox represents a mailbox for receiving messages sent from a controller LAN bus, and the message acceptance range of the receiving mailbox corresponding to the source-end controller LAN channel includes a message range corresponding to the first message identification information; Based on the second message identification information, the message sending range corresponding to the second initial mailbox is adjusted to obtain the sending mailbox corresponding to the target end controller LAN channel. The second initial mailbox represents the mailbox that sends the message to the controller LAN bus. The message sending range of the sending mailbox corresponding to the target end controller LAN channel includes the message range corresponding to the second message identification information.

5. The message information routing method according to claim 1, characterized in that: The target path information is obtained by the following steps: Obtaining routing indication information and target message identification information, wherein the routing indication information is used to describe the correspondence between message identification information corresponding to different message information and routing path information corresponding to the different message information, and the target message identification information is the message identification information corresponding to the target message information; The routing indication information is traversed according to the target message identification information, and the routing path information corresponding to the target message identification information is determined as the target path information.

6. The message information routing method according to claim 2 or 3, characterized in that: The method further comprises: When the second target mailbox receives the target message information, deleting the target message information in the first target mailbox; When the target end controller LAN channel receives the target message information, the target message information in the second target mailbox is deleted.

7. A message information routing device, characterized in that: The device comprises: A first acquisition module is used to obtain target message information to be routed and target path information corresponding to the target message information; A mailbox determination module, configured to determine a target transit mailbox based on the target path information, wherein the target transit mailbox is configured to implement routing of the target message information between the controller area network channels indicated by the target path information; The routing control module is used to perform routing control operations on the target message information based on the target transit mailbox.

8. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is used for executing the instructions to implement the message information routing method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the message information routing method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The computer program product includes a computer program, which is stored in a readable storage medium. At least one processor of a computer device reads and executes the computer program from the readable storage medium, so that the device performs the message information routing method according to any one of claims 1 to 6.