Data forwarding device and data forwarding system
By designing a data forwarding device in a car ECU, hardware forwarding from the source bus to the destination bus is realized using input, mapping search and output circuits, the problem of excessive load on the MCU CPU is solved, and data transmission efficiency and system stability are improved.
Patent Information
- Application Number
- CN202411423398.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-10-12
AI Technical Summary
With the intelligence and miniaturization of automotive ECUs, the amount of data on the CAN, LIN and Ethernet buses increases, resulting in excessive CPU load on the MCU, which may lead to problems such as task delay, system paralysis and overheating.
Design a data forwarding device, including an input circuit, a mapping search circuit and an output circuit, by receiving messages from the source bus, determining message identification and actual data, converting data into target messages according to mapping rules, and on the destination bus It can transmit on the top to realize hardware forwarding from the source bus to the destination bus, reducing system delay and CPU burden.
Through hardware forwarding, efficient data transmission is achieved, CPU load is reduced, forwarding efficiency is improved, task delay is reduced, and system paralysis and overheating is avoided.
Smart Images

Figure CN119299375A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of circuit design, and in particular to a data forwarding device and a data forwarding system. Background Art
[0002] As automotive ECUs (Electronic Control Units) move toward intelligence and miniaturization, more and more ECUs will integrate the three automotive buses of CAN (Controller Area Network), LIN (Local Interconnect Network) and Ethernet, and the amount of data between ECUs will increase significantly. In order to directly transfer information between ECUs, ECUs will send data received from one bus through another bus after basic processing, thereby completing the information exchange.
[0003] The core component in the ECU that completes bus collection and forwarding is the MCU (Microcontroller Unit) chip. The MCU chip uses its CPU (Central Processing Unit) to collect CAN, LIN and Ethernet data, that is, it uses interrupts to copy data from the Data Register to the RAM (Random Access Memory), and then after a series of permutations and combinations, it sends the data through CAN, LIN or Ethernet through interrupts, thereby completing the forwarding of the bus data.
[0004] With the advancement of vehicle intelligence, the amount of data on CAN, LIN and Ethernet continues to grow, so the interrupts of the CPU in the MCU are also increasing. In other words, the load of the CPU used to handle interrupts is also increasing, which may lead to task delays, system paralysis, overheating and other phenomena due to excessive CPU load. Summary of the invention
[0005] The embodiments of the present application provide a data forwarding device and a data forwarding system, which are used to reduce CPU load and thus reduce task delay.
[0006] In a first aspect, an embodiment of the present application provides a data forwarding device, the device being used to convert a source message received from at least one source bus into a target message, and forward the message to a corresponding destination bus, wherein the transmission content corresponding to the source message and the target message is the same, and the target message is a message that complies with the transmission protocol of the destination bus, the device comprising:
[0007] An input circuit, the input circuit is connected to each source bus of at least one source bus, and for each source bus, the input circuit is used to receive a source message from the source bus, determine a source message identifier and actual transmission data corresponding to the source message, and write the source message identifier and the actual transmission data into a source message list corresponding to the source bus, the source message list includes a plurality of first target rows, each first target row is used to store a source message identifier and actual transmission data corresponding to a source message;
[0008] A mapping search circuit is used to determine, for each first target row, a destination bus corresponding to the source message and a mapping rule according to a source message identifier stored in the first target row; and write the actual transmission data in the first target row into a destination message list corresponding to the destination bus according to the mapping rule, wherein the destination message list includes a plurality of second target rows, each second target row being used to store a piece of actual transmission data transformed according to the mapping rule;
[0009] An output circuit is respectively connected to each destination bus in at least one destination bus, and is used to obtain a target message for each second target row according to actual transmission data stored in the second target row after being transformed according to a mapping rule, and send the target message to the destination bus corresponding to the second target row, so that the destination bus transmits the target message.
[0010] In a possible implementation manner, when the input circuit determines the source message identifier and the actual transmission data corresponding to the source message, and writes the source message identifier and the actual transmission data into the source message list corresponding to the source bus, it is specifically used to:
[0011] Determine a message identifier corresponding to the source message;
[0012] When the message identifier is a preset message identifier, determining actual transmission data corresponding to the source message, and writing the source message identifier and the actual transmission data into a source message list corresponding to the source bus;
[0013] When the message identifier is not a preset message identifier, the source message is sent to a destination bus having the same transmission protocol as the source bus.
[0014] In a possible implementation manner, when the message identifier is a preset message identifier, the input circuit, when determining the actual transmission data corresponding to the source message, is specifically configured to:
[0015] When the message identifier is a preset message identifier, determining the length and start bit of the actual transmission data according to the message identifier;
[0016] The actual transmission data is determined according to the start bit and the length.
[0017] In a possible implementation manner, when the mapping search circuit determines the destination bus corresponding to the source message and the mapping rule according to the source message identifier stored in the first target row, it is specifically configured to:
[0018] According to the source message identifier stored in the first target row, a mapping relationship table is searched to determine the destination bus corresponding to the source message and the mapping rule. The mapping relationship table includes: a source message identifier field, a destination bus identifier field, and a data alignment field. The field value of the data alignment field is used to indicate the mapping rule.
[0019] In a possible implementation manner, the mapping relationship table further includes a plurality of mapping map fields, wherein the number of mapping map fields is the same as the number of bits of the actual transmission data;
[0020] The field value of the data alignment field includes: individually specified, aligned from a preset position; when the field value of the data alignment field is individually specified, the field value of the i-th mapping map field in the multiple mapping map fields is used to indicate the storage position of the i-th bit in the actual transmission data in the corresponding second target row, and when the field value of the data alignment field is aligned from a preset position, the field value of each mapping map field is a preset value.
[0021] In a possible implementation manner, the mapping relationship table further includes: an operation field, and a field value of the operation field includes: a first field value and a second field value;
[0022] When the mapping search circuit determines the destination bus corresponding to the source message and the mapping rule according to the source message identifier stored in the first target row, the mapping search circuit is specifically used to:
[0023] When the field value of the operation field is the first field value, determining the destination bus corresponding to the source message and the mapping rule according to the source message identifier stored in the first target row;
[0024] When the field value of the operation field is the second field value, the destination bus and mapping rule corresponding to the source message are determined according to the source message identifier stored in the first target row.
[0025] In a possible implementation manner, the mapping relationship table further includes: a target message identification field;
[0026] When the destination bus is an Ethernet bus, the destination message list corresponding to the Ethernet bus further includes a source address field and a destination address field, the source address field corresponds to the local address, and the destination address field corresponds to the target host address;
[0027] When the destination bus is an Ethernet bus, the mapping search circuit is also used to determine the target message identifier based on the source message identifier stored in the first target row, determine the target host address based on the target message identifier, and write the local address and the target host address into the corresponding destination message list.
[0028] In a possible implementation manner, when the input circuit determines the source message identifier and the actual transmission data corresponding to the source message, and writes the source message identifier and the actual transmission data into the source message list corresponding to the source bus, it is specifically used to:
[0029] When the source bus is an Ethernet bus, determining a source address, a destination address, and actual transmission data corresponding to the source message;
[0030] Determining the source message identifier according to the source address and the destination address;
[0031] Writing the source address, destination address, source message identifier and actual transmission data into a source message list corresponding to the source bus;
[0032] The mapping relationship table also includes: a message identifier / address mapping field. When the source bus is an Ethernet bus, the message identifier / address mapping field is used to indicate the storage position of the source address and the destination address in the corresponding second target row. When the source bus is not an Ethernet bus, the message identifier / address mapping field is used to indicate the storage position of the target message identifier in the corresponding second target row.
[0033] In one possible implementation, the mapping relationship table also includes: a progress field, which is used to indicate the progress of the process of converting the source message to the target message; the field value of the progress field includes: partially completed; fully completed; the partially completed is used to indicate that it has been written into the destination message list but has not been transmitted out by the corresponding destination bus; the fully completed is used to indicate that it has been transmitted out by the corresponding destination bus.
[0034] In a possible implementation, the mapping relationship table also includes: an error type field, the field value of the error type field includes: a first error type, a second error type and a third error type, the first error type is used to indicate that an error occurred in the process of writing the source message list; the second error type is used to indicate that an error occurred in the process of writing the destination list; the third error type is used to indicate that an error occurred in the process of transmission by the destination transmission bus.
[0035] In a second aspect, an embodiment of the present application provides a data forwarding system, the system comprising: a data forwarding device, at least one source bus, at least one destination bus, at least one first processing device, and at least one second processing device;
[0036] The data forwarding device is the device described in the first aspect;
[0037] For any source bus, one end of the source bus is connected to the data forwarding device, and the other end of the source bus is connected to the first processing device, the at least one source bus corresponds to at least one first processing device in a one-to-one manner, and the source bus is used to transmit the source message received from the first processing device to the data forwarding device;
[0038] For any destination bus, one end of the destination bus is connected to the data forwarding device, and the other end of the destination bus is connected to the second processing device. The at least one destination bus corresponds one-to-one to at least one second processing device, and the destination bus is used to transmit the target message received from the data forwarding device to the second processing device.
[0039] The data forwarding device and data forwarding system provided by the embodiment of the present application include: an input circuit, a mapping search circuit and an output circuit, wherein the input circuit is used to receive a source message from a source bus, and write a source message identifier and actual transmission data corresponding to the source message into a source message list corresponding to the source bus, wherein the source message list includes a plurality of first target rows, each of which is used to store a source message identifier and actual transmission data corresponding to a source message; the mapping search circuit is used to determine, for each first target row, the destination bus corresponding to the source message and a mapping rule according to the source message identifier stored in the target row, and write the actual transmission data in the first target row into the source message list corresponding to the source bus according to the mapping rule. A destination message list corresponding to a destination bus, the destination message list includes a plurality of second target rows, each second target row is used to store actual transmission data transformed according to a mapping rule; an output circuit is used to obtain a target message for each second target row according to the actual transmission data transformed according to the mapping rule stored in the second target row, and send the target message to the destination bus corresponding to the second target row, so that the destination bus transmits the target message. Through the coordinated action of the input circuit, the mapping search circuit and the output circuit, hardware forwarding from the source bus to the destination bus can be realized, thereby reducing system latency, improving forwarding efficiency and alleviating the burden on the CPU. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0041] Figure 1 An application scenario diagram provided for an embodiment of the present application;
[0042] Figure 2 A schematic diagram of the structure of a data forwarding device provided in an embodiment of the present application;
[0043] Figure 3 A system architecture diagram provided for an embodiment of the present application;
[0044] Figure 4 A flowchart of an IP implementation method provided in an embodiment of the present application.
[0045] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0046] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.
[0047] The current design of automotive MCU chips generally includes LIN Controller, CAN Controller, and even more advanced automotive MCU chip designs contain Ethernet Controller. Moreover, the LIN, CAN and Ethernet Controllers are independent, and each is an independent IP (Intellectual Property, a verified, reusable integrated circuit module with a certain function).
[0048] As automotive ECUs move toward intelligence and miniaturization, more and more ECUs will integrate the three automotive buses of CAN, LIN and Ethernet, and the amount of data between ECUs will increase significantly. In order to directly transfer information between ECUs, ECU will process the data received from one bus and send it out through another bus to complete the information exchange. For example, ECU will process the data received from CAN bus through its MCU chip and then send it out through LIN bus or Ethernet bus. The core component of ECU that completes bus collection and forwarding is MCU chip.
[0049] While processing data forwarding between CAN, LIN, and Ethernet buses, the MCU is also responsible for other core algorithms, power processing, and other data. The CPU load of the MCU is generally high. The data forwarding of CAN, LIN, and Ethernet processed by the MCU accounts for more than 10% of the total CPU load.
[0050] In the prior art, MCU chips use their CPU to collect CAN, LIN and Ethernet data, that is, they use interrupts to copy data from the Data Register to RAM, and then after a series of permutations and combinations, they send the data through CAN, LIN or Ethernet through interrupts, thereby completing the forwarding of bus data.
[0051] However, with the advancement of vehicle intelligence, the amount of data on CAN, LIN and Ethernet continues to grow, so the interrupts of the CPU in the MCU are also growing, that is, the load of the CPU used to process interrupts is also growing. Then the CPU has to process other more important core algorithms, functional components, etc., which may cause the CPU to be overloaded, and then lead to task delays, system paralysis, overheating and other phenomena.
[0052] In view of this, the present application provides a data forwarding device, which includes: an input circuit, a mapping search circuit and an output circuit, wherein the input circuit is used to receive a source message from a source bus, and write a source message identifier and actual transmission data corresponding to the source message into a source message list corresponding to the source bus, the source message list includes multiple first target rows, each first target row is used to store a source message identifier and actual transmission data corresponding to a source message; the mapping search circuit is used to determine, for each first target row, the destination bus corresponding to the source message and a mapping rule according to the source message identifier stored in the target row, and write the actual transmission data in the first target row into the source message list corresponding to the source bus according to the mapping rule. A destination message list corresponding to the destination bus, the destination message list includes multiple second target rows, each second target row is used to store actual transmission data transformed according to a mapping rule; the output circuit is used to obtain a target message for each second target row according to the actual transmission data transformed according to the mapping rule stored in the second target row, and send the target message to the destination bus corresponding to the second target row, so that the destination bus transmits the target message. Through the coordinated action of the input circuit, the mapping search circuit and the output circuit, hardware forwarding from the source bus to the destination bus can be achieved, which reduces the system delay, improves the forwarding efficiency and reduces the burden on the CPU.
[0053] Figure 1 An application scenario diagram provided for an embodiment of the present application, such as Figure 1 As shown, it includes a data forwarding device, three source buses, three destination buses and multiple processing devices, wherein the three source buses are source bus 1, source bus 2 and source bus 3, and the communication protocols corresponding to the three source buses are different. Source bus 1 is connected to processing device 1, source bus 2 is connected to processing device 2, and source bus 3 is connected to processing device 3. For each source bus, the source bus is connected to the input circuit in the data forwarding device, and the source bus is used to transmit the source message sent by the processing device connected thereto to the input circuit. The processing device can be any device that can send, receive and process messages, such as ECU, MCU, CPU, etc.
[0054] The input circuit is used to receive a source message from a source bus, and write a source message identifier and actual transmission data corresponding to the source message into a source message list corresponding to the source bus, wherein the source message list includes a plurality of first target rows, each of which is used to store a source message identifier and actual transmission data corresponding to a source message; the mapping search circuit is used to determine, for each first target row, a destination bus corresponding to the source message and a mapping rule according to the source message identifier stored in the target row, and write the actual transmission data in the first target row into a destination message list corresponding to the destination bus according to the mapping rule, wherein the destination message list includes a plurality of second target rows, each of which is used to store an actual transmission data after being transformed according to the mapping rule. Transmission data; the output circuit is used to obtain a target message for each second target row according to the actual transmission data stored in the second target row after being transformed according to the mapping rule, and send the target message to the destination bus corresponding to the second target row, so that the destination bus transmits the target message; the three destination buses are source bus 1, source bus 2 and source bus 3, respectively, and the communication protocols corresponding to the three source buses are different. Source bus 1 is connected to processing device 1, source bus 2 is connected to processing device 2, and source bus 3 is connected to processing device 3. For each source bus, the source bus is connected to the input circuit in the data forwarding device, and the source bus is used to transmit the source message sent by the processing device connected thereto to the input circuit.
[0055] The three destination buses are destination bus 1, destination bus 2 and destination bus 3. The communication protocols corresponding to the three source buses are different. Destination bus 1 is connected to processing device 4, destination bus 2 is connected to processing device 5, and destination bus 3 is connected to processing device 6. For each destination bus, the destination bus is connected to the output circuit in the data forwarding device. The destination bus is used to transmit the target message to the processing device connected thereto for processing.
[0056] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0057] Figure 2 A schematic diagram of the structure of a data forwarding device provided in an embodiment of the present application. The device is used to convert a source message received from at least one source bus into a target message and forward it to the corresponding destination bus. The transmission content corresponding to the source message and the target message is the same, and the target message is a message that complies with the transmission protocol of the destination bus. As shown in Figure 2, the data forwarding device provided in an embodiment of the present application may include:
[0058] An input circuit 201 is connected to each source bus in at least one source bus, respectively. For each source bus, the input circuit is used to receive a source message from the source bus, determine a source message identifier and actual transmission data corresponding to the source message, and write the source message identifier and actual transmission data into a source message list corresponding to the source bus. The source message list includes multiple first target rows, and each first target row is used to store a source message identifier and actual transmission data corresponding to a source message.
[0059] Among them, the source bus and the destination bus are relative concepts. The bus that transmits the messages sent by other processing devices to the data forwarding device is called the source bus, and the bus that transmits the messages sent by the data forwarding device to other processing devices is called the destination bus.
[0060] Each source bus and each destination bus may be any communication system used to transmit data, address and control signals in computer systems and other electronic devices, such as CAN bus, LIN bus and Ethernet bus.
[0061] The communication protocols corresponding to the source buses in at least one source bus are all different. Similarly, the communication protocols corresponding to the source buses in at least one destination bus are all different.
[0062] Optionally, the source bus and the source message list may be in a one-to-one correspondence, and each source message list is set in a register, which includes a plurality of storage units, each storage unit corresponds to a row in the source message list, and is used to store a source message identifier and actual transmission data corresponding to a source message. Each bit or field of each storage unit is defined in advance.
[0063] Exemplarily, Table 1 is a source message list corresponding to the CAN bus, including a sequence number field, a source message identification field and an actual transmission data field. Before using the data forwarding device provided by the present application, each field of the source message list needs to be set and defined.
[0064] Table 1
[0065] Serial number Source message identifier Actual data transmission 1 0×12 000……000 2 0×13 111……111
[0066] The field value of the sequence number increases in natural sequence, that is, the sequence number automatically increases by 1 for each source message data.
[0067] The source message identification field corresponds to the CAN ID (Identifier). When setting, a standard frame or an extended frame can be used.
[0068] When setting the actual transmission data field, you need to consider the data length of different types of CAN messages. For the CAN2.0 protocol, the data length needs to be designed to be 8 bytes. For the CAN FD (Flexible Data-rate) protocol, the data length needs to be designed to be 64 bytes.
[0069] Specifically, the input circuit is connected to each source bus in at least one source bus respectively. For each source bus, the input circuit is used to receive a source message from the source bus, determine a source message identifier and actual transmission data corresponding to the source message, and write the source message identifier and actual transmission data into a source message list corresponding to the source bus. The source message list includes multiple first target rows, and each first target row is used to store a source message identifier and actual transmission data corresponding to a source message.
[0070] The circuits in this application can be implemented with the help of Verilog language, HDL (Hardware Description Language) or other hardware description languages.
[0071] Optionally, when the input circuit determines the source message identifier and the actual transmission data corresponding to the source message, and writes the source message identifier and the actual transmission data into the source message list corresponding to the source bus, it is specifically used to:
[0072] Determine a message identifier corresponding to the source message;
[0073] When the message identifier is a preset message identifier, determining actual transmission data corresponding to the source message, and writing the source message identifier and the actual transmission data into a source message list corresponding to the source bus;
[0074] When the message identifier is not a preset message identifier, the source message is sent to a destination bus having the same transmission protocol as the source bus.
[0075] Wherein, at least one first message identifier is stored in a fixed register.
[0076] Specifically, after receiving the source message, the input circuit first determines the message identifier corresponding to the source message, and compares the determined message identifier with at least one first message identifier. If it is one of the at least one first message identifier, it means that the determined message identifier is a preset message identifier, then the actual transmission data corresponding to the source data message is determined, and the source message identifier and the actual transmission data are written into the source message list corresponding to the source bus.
[0077] If it is not one of the at least one first message identifier, indicating that the determined message identifier is not a preset message identifier, the source message is sent to a destination bus with the same transmission protocol as the source bus, and the source message is processed by a processing device connected to the destination bus.
[0078] In this way, when the source message identifier is a preset message identifier, the source message identifier and the actual transmission data are written into the source message list, and subsequent forwarding operations are performed. When the source message identifier is not a preset message identifier, the source message is directly sent to the destination bus with the same transmission protocol as the source bus, which can improve the overall source message processing efficiency.
[0079] Optionally, when the message identifier is a preset message identifier, the input circuit determines the actual transmission data corresponding to the source message, specifically for:
[0080] When the message identifier is a preset message identifier, determining the length and start bit of the actual transmission data according to the message identifier;
[0081] The actual transmission data is determined according to the start bit and the length.
[0082] Specifically, when the determined message identifier is a preset message identifier, the input circuit determines the length and start bit of the actual transmission data according to the message identifier, and determines the actual transmission data according to the length and start bit of the actual transmission data. Optionally, the correspondence between the preset message identifier and the length and start bit of the actual transmission data can be pre-stored in a fixed register.
[0083] Optionally, when the input circuit writes the source message identifier and the actual transmission data into the source message list corresponding to the source bus, it is specifically used to:
[0084] The source message identifier, the actual transmission data and the length of the actual transmission data are written into the source message list corresponding to the source bus.
[0085] Exemplarily, Table 2 is another source message list corresponding to the CAN bus, including a sequence number field, a source message identification field, an actual transmission data field, and a length field. Before using the data forwarding device provided by the present application, each field of the source message list needs to be set and defined.
[0086] Table 2
[0087] Serial number Source message identifier length Actual data transmission 1 0×12 Length 1 000……000 2 0×13 Length 2 111……111
[0088] Among them, the settings of the sequence number field, the source message identification field, and the actual transmission data field are the same as those in Table 1.
[0089] When setting the length field, the set length should be consistent with the length of the actual transmitted data.
[0090] The mapping search circuit 301 is used to determine, for each first target row, the destination bus corresponding to the source message and the mapping rule according to the source message identifier stored in the first target row; and according to the mapping rule, write the actual transmission data in the first target row into the destination message list corresponding to the destination bus, the destination message list includes multiple second target rows, each second target row is used to store an actual transmission data transformed according to the mapping rule.
[0091] Specifically, the mapping search circuit is used to determine, for each first target row, the destination bus corresponding to the source message and the mapping rule according to the source message identifier stored in the first target row; and according to the mapping rule, write the actual transmission data in the first target row into the destination message list corresponding to the destination bus, the destination message list includes multiple second target rows, and each second target row is used to store the actual transmission data transformed according to the mapping rule.
[0092] Optionally, when determining the destination bus corresponding to the source message and the mapping rule according to the source message identifier stored in the first target row, the mapping search circuit is specifically configured to:
[0093] According to the source message identifier stored in the first target row, a mapping relationship table is searched to determine the destination bus corresponding to the source message and the mapping rule. The mapping relationship table includes: a source message identifier field, a destination bus identifier field, and a data alignment field. The field value of the data alignment field is used to indicate the mapping rule.
[0094] The mapping relationship table may be stored in a fixed register.
[0095] Table 3 is a mapping relationship table provided in an embodiment of the present application. As shown in Table 3, the mapping relationship table includes: a sequence number field, a source message identification field, a destination bus identification field, and a data alignment field.
[0096] Table 3
[0097] Serial number Source message identifier Destination Bus ID Data alignment 1 0×12 01 Method 1 2 0×13 10 Method 2
[0098] In the destination bus identification field, 01 can represent a LIN bus, 10 can represent an Ethernet bus, and the field value of the data alignment field is used to indicate a mapping rule.
[0099] Specifically, the mapping search circuit can search the mapping relationship table according to the source message identifier stored in the first target row, determine the destination bus corresponding to the source message through the field value of the corresponding destination bus identifier field, and determine the mapping rule through the field value of the data alignment field.
[0100] In this way, by using the mapping relationship table, the corresponding destination bus and mapping rule can be quickly found according to the source message identifier, which reduces the search time and improves the search efficiency of the system.
[0101] Optionally, the mapping relationship table further includes a plurality of mapping map fields, wherein the number of mapping map fields is the same as the number of bits of the actual transmitted data;
[0102] The field value of the data alignment field includes: individually specified, aligned from a preset position; when the field value of the data alignment field is individually specified, the field value of the i-th mapping map field in the multiple mapping map fields is used to indicate the storage position of the i-th bit in the actual transmission data in the corresponding second target row, and when the field value of the data alignment field is aligned from a preset position, the field value of each mapping map field is a preset value.
[0103] Table 4 is another mapping relationship table provided in an embodiment of the present application. As shown in Table 4, the mapping relationship table includes: a sequence number field, a source message identification field, a destination bus identification field, a data alignment field, a mapping address field, Figure 1 Field, Mapping Figure 2 field...map map n fields, the number of map fields is the same as the number of bits of data actually transmitted.
[0104] Table 4
[0105]
[0106] Specifically, when the field value of the data alignment field is specified separately, the field value of the i-th mapping map field in the plurality of mapping map fields is used to indicate the storage position of the i-th bit in the actual transmission data in the corresponding second target row. Figure 1 The field value is 2, indicating that the first bit of the actual transmission data is stored in the second bit of the actual transmission data storage area of the second target row, and the mapping address Figure 2 The field value of is 5, indicating that the data of the 2nd bit in the actual transmission data is stored in the 5th bit of the actual transmission data storage area of the second target row, and the field value of mapping map n is 4, indicating that the data of the nth bit in the actual transmission data is stored in the 4th bit of the actual transmission data storage area of the second target row.
[0107] When the field value of the data alignment field is aligned from the 5th bit, it means that the 1st bit of the actual transmission data is stored in the 5th bit of the actual transmission data storage area of the second target row, and the 2nd bit of the actual transmission data is stored in the 6th bit of the actual transmission data storage area of the second target row, and so on. At this time, the field values of each mapping map field are preset values, such as 0.
[0108] In this way, through flexible mapping and alignment, the data transmission and storage process can be optimized, data transmission efficiency can be improved, and transmission delay can be reduced. In addition, when the field value of the data alignment field is "specified individually", through multiple mapping map fields, the storage position of each bit in the actual transmission data in the corresponding second target row can be accurately indicated, realizing refined data storage control.
[0109] Optionally, the mapping relationship table further includes: an operation field, and the field value of the operation field includes: a first field value and a second field value;
[0110] When the mapping search circuit determines the destination bus corresponding to the source message and the mapping rule according to the source message identifier stored in the first target row, the mapping search circuit is specifically used to:
[0111] When the field value of the operation field is the first field value, determining the destination bus corresponding to the source message and the mapping rule according to the source message identifier stored in the first target row;
[0112] When the field value of the operation field is the second field value, the destination bus and mapping rule corresponding to the source message are determined according to the source message identifier stored in the first target row.
[0113] Table 5 is another mapping relationship table provided in an embodiment of the present application. As shown in Table 5, the mapping relationship table includes: an operation field, a sequence number field, a source message identification field, a destination bus identification field, a data alignment field, a mapping address field, Figure 1 Field, Mapping Figure 2 field...map map n fields, the number of map fields is the same as the number of bits of data actually transmitted.
[0114] Table 5
[0115]
[0116] Exemplarily, the first field value may be allowed, and the second field value may be not allowed. Only when the field value of the operation field is allowed, the destination bus and mapping rules corresponding to the source message can be determined according to the source message identifier stored in the first target row, and subsequent operations can be performed.
[0117] When the field value of the operation field is not allowed, the destination bus corresponding to the source message and the mapping rule determined according to the source message identifier stored in the first target row are cancelled.
[0118] That is to say, the field value of the operation field is used to indicate, for each first target row, whether a subsequent forwarding operation is allowed on the actual transmission data in the first target row.
[0119] In this way, by introducing the operation field, the system can adopt different operation modes according to different field values, which increases the flexibility of operation. For example, you can choose to perform mapping search according to the source message identifier, or cancel the mapping search. And through clear operation fields and corresponding operation modes, you can reduce misoperation and misjudgment, and improve the reliability and stability of the system.
[0120] Optionally, the mapping relationship table further includes: a target message identification field;
[0121] When the destination bus is an Ethernet bus, the destination message list corresponding to the Ethernet bus further includes a source address field and a destination address field, the source address field corresponds to the local address, and the destination address field corresponds to the target host address;
[0122] When the destination bus is an Ethernet bus, the mapping search circuit is also used to determine the target message identifier based on the source message identifier stored in the first target row, determine the target host address based on the target message identifier, and write the local address and the target host address into the corresponding destination message list.
[0123] The corresponding relationship between the source message identifier and the target message identifier, and the corresponding relationship between the target message identifier and the target host address may be stored in the same fixed register or in different registers.
[0124] Table 6 is a destination message list corresponding to an Ethernet bus provided in an embodiment of the present application, as shown in Table 6, including: a sequence number field, a destination address field, a source address field, an actual transmission data field, and a length / type field, wherein the field value corresponding to the actual transmission data field is the actual transmission data transformed according to the mapping rule.
[0125] Table 6
[0126] Serial number Destination Address Source Address Length / Type Actual data transmission 1 2
[0127] The field value of the sequence number field increases in natural sequence, that is, each time a piece of actual transmission data is written, the field value of the sequence number field automatically increases by 1.
[0128] The field value of the destination address field is the target host address, and the target host is the host that processes the message. Exemplarily, the target host address may be the MAC (Medium Access Control) address of the target host.
[0129] The field value of the source address field is the local address. Exemplarily, the local address may be the MAC address of the local machine.
[0130] Optionally, when the field value of the length / type field is less than or equal to 1500, it can indicate the length of the actual transmitted data, excluding the length of the padding. When the field value is greater than 1500, it can indicate the type of message. For example, when the field value is 16'h0800, it indicates an IP (Internet Protocol) message; when the field value is 16'h0806, it indicates an ARP (Address Resolution Protocol) request / response message; and when the field value is 16'h8035, it indicates a RARP (Reverse Address Resolution Protocol) request / response message.
[0131] Optionally, the field value of the actual transmission data field can be between 46 and 1500 bytes.
[0132] Specifically, when the destination bus is an Ethernet bus, the mapping search circuit is also used to determine the target message identifier based on the source message identifier stored in the first target row, determine the target host address based on the target message identifier, and write the local address and the target host address into the corresponding destination message list.
[0133] In this way, by automatically determining and filling in address information, the preparation time before data transmission is reduced and the data transmission efficiency is improved. Especially in the Ethernet environment, it can quickly respond to and process data packets, and through clear address mapping and automatic filling mechanisms, human errors are reduced, the reliability and stability of the system are improved, and data can be ensured to be transmitted to the target host accurately.
[0134] Optionally, when the input circuit determines the source message identifier and the actual transmission data corresponding to the source message, and writes the source message identifier and the actual transmission data into the source message list corresponding to the source bus, it is specifically used to:
[0135] When the source bus is an Ethernet bus, determining a source address, a destination address, and actual transmission data corresponding to the source message;
[0136] Determining the source message identifier according to the source address and the destination address;
[0137] Writing the source address, destination address, source message identifier and actual transmission data into a source message list corresponding to the source bus;
[0138] The mapping relationship table also includes: a message identifier / address mapping field. When the source bus is an Ethernet bus, the message identifier / address mapping field is used to indicate the storage position of the source address and the destination address in the corresponding second target row. When the source bus is not an Ethernet bus, the message identifier / address mapping field is used to indicate the storage position of the target message identifier in the corresponding second target row.
[0139] The corresponding relationship among the source address, the destination address and the source message identifier is stored in a fixed register.
[0140] Specifically, when the source bus is an Ethernet bus, the input circuit determines the source address, destination address and actual transmission data corresponding to the source message; determines the source message identifier based on the source address and destination address; and writes the source address, destination address, source message identifier and actual transmission data into a source message list corresponding to the source bus.
[0141] The mapping relationship table also includes: a message identification / address mapping field. When the source bus is an Ethernet bus, the message identification / address mapping field is used to indicate the storage position of the source address and the destination address in the corresponding second target row, and can be stored in the storage area corresponding to the actual transmission data field in the second target row. Exemplarily, the source address can be stored in the 1st to 8th bits of the storage area corresponding to the actual transmission data field, and the destination address can be stored in the 9th to 16th bits of the storage area corresponding to the actual transmission data field. The field value of the data alignment field in the mapping relationship table is aligned from the 17th bit.
[0142] When the source bus is not an Ethernet bus, the message identifier / address mapping field is used to indicate the storage location of the target message identifier in the corresponding second target row. Exemplarily, the destination message list may include a target message identifier field, and the target message identifier may be stored in a storage area corresponding to the target message identifier field, or in a storage area corresponding to the actual transmission data.
[0143] Wherein, when the source bus is an Ethernet bus, the mapping search module is further used to write the source address and the destination address into the destination message list corresponding to the destination bus according to the field value of the message identification / address mapping field.
[0144] In this way, by determining the source address, destination address and actual transmission data when the source bus is an Ethernet bus, the system can support Ethernet communication, expanding the application scope of the system, and the message identifier / address mapping field in the mapping relationship table is used to indicate the storage location of the source address and the destination address in the second target row when the source bus is an Ethernet bus; when the source bus is not an Ethernet bus, it is used to indicate the storage location of the target message identifier. This flexible field mapping mechanism enables the system to adapt to different types of buses, improving the versatility and adaptability of the system.
[0145] Output circuit 302, which is respectively connected to each destination bus in at least one destination bus, and is used to obtain a target message for each second target row according to the actual transmission data stored in the second target row after being transformed according to the mapping rule, and send the target message to the destination bus corresponding to the second target row, so that the destination bus transmits the target message.
[0146] Specifically, the output circuit is respectively connected to each destination bus in at least one destination bus, and is used to obtain a target message for each second target row according to actual transmission data stored in the second target row after being transformed according to a mapping rule, according to preset rules, and send the target message to the destination bus corresponding to the second target row, so that the destination bus transmits the target message.
[0147] The data forwarding device provided by the embodiment of the present application includes: an input circuit, a mapping search circuit and an output circuit, wherein the input circuit is used to receive a source message from a source bus, and write a source message identifier and actual transmission data corresponding to the source message into a source message list corresponding to the source bus, wherein the source message list includes a plurality of first target rows, each of which is used to store a source message identifier and actual transmission data corresponding to a source message; the mapping search circuit is used to determine, for each first target row, a destination bus corresponding to the source message and a mapping rule according to the source message identifier stored in the target row, and write the actual transmission data in the first target row into the destination bus corresponding to the source bus according to the mapping rule. A destination message list corresponding to the bus, the destination message list includes multiple second target rows, each second target row is used to store actual transmission data transformed according to a mapping rule; the output circuit is used to obtain a target message for each second target row according to the actual transmission data transformed according to the mapping rule stored in the second target row, and send the target message to the destination bus corresponding to the second target row, so that the destination bus transmits the target message. Through the coordinated action of the input circuit, the mapping search circuit and the output circuit, hardware forwarding from the source bus to the destination bus can be achieved, which reduces the system delay, improves the forwarding efficiency and reduces the burden on the CPU.
[0148] Optionally, the mapping relationship table also includes: a progress field, which is used to indicate the progress of the process of converting the source message to the target message; the field value of the progress field includes: partially completed; fully completed; the partially completed is used to indicate that it has been written into the destination message list but has not been transmitted out by the corresponding destination bus; the fully completed is used to indicate that it has been transmitted out by the corresponding destination bus.
[0149] Among them, the mapping search circuit is also used to modify the field value of the progress field to partially completed when the actual transmission data after transformation according to the mapping rules is written into the destination message list; after the information in the destination message list has been converted into the target message and transmitted out by the destination bus, the field value of the progress field is modified to fully completed.
[0150] In this way, through the progress field, the process status of the conversion from the source message to the target message can be understood in real time, so as to better manage and monitor the conversion process.
[0151] Optionally, the mapping relationship table also includes: an error type field, the field value of the error type field includes: a first error type, a second error type and a third error type, the first error type is used to indicate that an error occurred in the process of writing the source message list; the second error type is used to indicate that an error occurred in the process of writing the destination list; the third error type is used to indicate that an error occurred in the process of transmission by the destination transmission bus.
[0152] In this way, by defining different error types (first error type, second error type, third error type), the specific stage where the error occurs (source message list, destination list, transmission bus) can be clearly identified and located, so as to more effectively diagnose the problem and take corresponding repair measures. The introduction of the error type field can significantly improve the system's error handling capabilities, reduce system failure time, and improve user experience.
[0153] Figure 3 A system architecture diagram provided for an embodiment of the present application, as described above Figure 3 As shown, it includes: a source bus, a destination bus and a bus LUT (Look-Up Table). The data forwarding device of the embodiment of the present application can be applied to a vehicle-mounted MCU chip, which includes two or three of a CAN bus controller, a LIN bus controller and an Ethernet controller, and can realize hardware routing between the CAN Controller, the LIN Controller and the Ethernet Controller inside the MCU, saving CPU resources and reducing bus routing delay.
[0154] The data forwarding device provided in the present application can be implemented with the help of Verilog language, HDL language or other hardware description languages.
[0155] The present invention can realize hardware forwarding between three buses. The IP implementation method is described below by taking the message hardware forwarding of the CAN bus controller to the Ethernet controller. Figure 4 A flowchart of an IP implementation method provided in an embodiment of the present application, such as Figure 4 As shown, the following steps are included:
[0156] Step S1: Before using the present invention, it is necessary to first set the source bus (Source) through a register, that is, the message list of the CAN bus.
[0157] Table 7 is another source message list corresponding to the CAN bus.
[0158] Table 7
[0159] List Number ID(32Bit) Length(8Bit) Data(64Byte) 1 0×12 length Data[0~63] 2 0×13 length Data[0~63]
[0160] In the CAN bus message list:
[0161] 1. List Number (serial number) increases in natural sequence, and developers do not need to set it here.
[0162] 2. ID (Identification) column: ID is the CAN ID of the CAN message as the source. When designing the chip, standard frames or extended frames can be used.
[0163] 3. Length column: In the Length column, developers need to set the length of the CAN message. The length here should be consistent with the subsequent Data column.
[0164] 4. Data column. When designing here, you need to consider the Data length of the CAN message. For CAN2.0, it needs to be designed as 8 bytes; for CANFD, it needs to be designed as 64 bytes.
[0165] 5. Status column: This field is a read-only area for developers and reflects whether the message is sent successfully.
[0166] Specifically:
[0167] 1. When developers perform hardware forwarding from CAN to Ethernet, the first step is to set the CANID to be forwarded, and the second step is to set the corresponding Length of the ID;
[0168] 2. Developers do not need to operate the Data register. After the CAN Controller receives the data of the corresponding CANID, it will automatically copy the Data data to the line according to the Length.
[0169] 3. After the CAN message is forwarded, the Status bit will be automatically set to a certain state (Pending, OK, Fail) by the hardware.
[0170] Step S2: The developer sets the register to set the destination bus (Destination), which in this example is the Ethernet destination message list.
[0171] Table 8 is another destination message list corresponding to the Ethernet bus.
[0172] Table 8
[0173]
[0174] In the Ethernet bus destination message list:
[0175] 1. List Number grows in natural sequence, and developers do not need to set it here.
[0176] 2. Destination Address DA (Destination Address) column. The destination address is the MAC address of the Ethernet destination.
[0177] 3. Source Address SA (Source Address) column. The source address is the MAC address of the Ethernet local machine.
[0178] 4. Length / Type column. If the field value is less than or equal to 1500, it indicates the effective data length of the frame. Length identifies the data length of the effective load, excluding the length of padding. 16'h0800 represents an IP message; 16'h0806 identifies an ARP request / reply message; 16'h8035 identifies an RARP request / reply message.
[0179] 5. Data and padding column: The length of this data segment must be between 46 and 1500 bytes. Padding data will not change the value of Length.
[0180] 6. Frame Check Sequence (FCS): used to store the check result of CRC result.
[0181] Specifically:
[0182] 1. The developer needs to fill the MAC addresses of the destination address (DA) and source address (SA) into the corresponding columns.
[0183] 2. Developers fill in the Length / Type column based on actual application scenarios. If the value here is less than or equal to 1500, it represents the effective length of the frame. If it is greater than 1500, it represents the protocol frame type.
[0184] 3. In the data and fill columns, developers can fill in custom data as needed. When the data forwarded from the CAN bus is mapped to this area, it is necessary to set which byte to map to in the LUT.
[0185] 4. Frame Check Sequence (FCS) For developers, this area is read-only. The calculation of this area is automatically calculated by the system.
[0186] Step S3: After configuring the bus source and bus destination, the developer needs to configure the LUT module, that is, the mapping relationship table.
[0187] Tables 9 to 10 are another mapping relationship table provided in the embodiments of the present application.
[0188] Table 9
[0189]
[0190]
[0191] Table 10
[0192]
[0193] In Tables 9 to 10:
[0194] 1. The Action column indicates the action of the bus conversion. The default is 0-Stop, 1-Start.
[0195] 2. Source Channel column is used to describe the source of bus conversion, including: 00-CAN bus, 01-LIN bus, 10-Ethernet, 11-Reserve.
[0196] 3. The Source List Number column is used to indicate which ID of the bus Source is used for conversion.
[0197] 4. Destination Channel column is used to describe the destination of bus conversion, including: 00-CAN bus, 01-LIN bus, 10-Ethernet, 11-Reserve.
[0198] 5. The Destination List Number column is used to indicate which ID is obtained after the bus Source ID is converted.
[0199] 6. The ID / Address Map column is used to indicate which column in the Destination List Number the ID in the Source List Number corresponds to. Among them, 0x000-CAN / LIN target ID (default option), 0x0yy-CAN / LIN Data Byte is placed at 0xyy and 0xyy+1 (arranged in accordance with LSB (Least Significant Bit)), 0x1yy-Ethernet Data Byte is placed at 0xyy and 0xyy+1 (arranged in accordance with LSB)
[0200] 7. Data Align Type column is used to describe the alignment of Data in List Number of Source and Data in List Number of Destination. 00-Specify individually, that is, each Byte is specified individually in Data Map; 01-Alignment starts from Byte 0 of Data, and the length of alignment is Length; 10-Alignment starts from the Byte specified by DataMap[0], and the length of alignment is Length; 11-Reserve.
[0201] 8. The Data Map[n] column is used to illustrate the mapping relationship between the data of the bus Source and the data of the bus Destination.
[0202] 9. Status column, used to describe the status of bus conversion. Among them, 000-Init, initialization status; 001-Pending, the bus Source is ready and has been transmitted to the Destination, but the Destination has not been sent out; 010-Done, the transmission from the bus Source to the bus Destination has been completed, and the Destination has been sent; 1yy-an error occurred during the bus conversion process, and the error type is yy;
[0203] yy=00 data error occurred during Source preparation;
[0204] yy=01 The data format is wrong during the Source to Destination conversion phase;
[0205] yy=10 An error occurred in the data sending phase at the Destination.
[0206] When using it, developers fill in the information of the conversion from the relevant bus Source to the bus Destination in the Lookup Table (mapping relationship table):
[0207] 1. Select 00, CAN bus in Source Channel.
[0208] 2. In Source List Number, select the List Number configured in CAN Source.
[0209] 3. Select 10, Ethernet bus, in Destination Channel.
[0210] 4. In Destination List Number, select the Ethernet List Number that corresponds to the CAN List Number.
[0211] 5. In this case, CANID can be placed in the Data area of Ethernet, tentatively in Data
[20] , and fill in 0x014 here.
[0212] 6. Data alignment: Set Data Align Type = 10 here, and the alignment starts from the specified Byte.
[0213] 7. Data Map[0], set 21=0x15 here and align according to the length specified by Length.
[0214] Compared with the prior art, this application uses hardware design language to fully realize the forwarding of three commonly used vehicle buses. When hardware forwarding, no software intervention is required. At the same time, the List Number is innovatively used to map each bus one-to-one to achieve personalized forwarding. When hardware forwarding, different scenarios are still taken into consideration during the design, and configurable operations are performed to achieve multi-scenario applications.
[0215] The solution of the present invention realizes the bus conversion completely by hardware, reduces the delay of the system, improves the efficiency and reduces the load of the CPU.
[0216] The embodiment of the present application also provides a data forwarding system, the system comprising: a data forwarding device, at least one source bus, at least one destination bus, at least one first processing device, and at least one second processing device;
[0217] The data forwarding device is the device in any of the above embodiments;
[0218] For any source bus, one end of the source bus is connected to the data forwarding device, and the other end of the source bus is connected to the first processing device, the at least one source bus corresponds to at least one first processing device in a one-to-one manner, and the source bus is used to transmit the source message received from the first processing device to the data forwarding device;
[0219] For any destination bus, one end of the destination bus is connected to the data forwarding device, and the other end of the destination bus is connected to the second processing device. The at least one destination bus corresponds one-to-one to at least one second processing device, and the destination bus is used to transmit the target message received from the data forwarding device to the second processing device.
[0220] The specific implementation method and effect of the data forwarding system provided in the embodiment of the present application can be found in the aforementioned embodiment and will not be repeated here.
[0221] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
[0222] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
[0223] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0224] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0225] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
Claims
1. A data forwarding device, characterized in that: The device is used to convert a source message received from at least one source bus into a target message and forward it to a corresponding destination bus, wherein the transmission contents corresponding to the source message and the target message are the same, and the target message is a message that complies with the transmission protocol of the destination bus, and the device includes: An input circuit, the input circuit is connected to each source bus of at least one source bus, and for each source bus, the input circuit is used to receive a source message from the source bus, determine a source message identifier and actual transmission data corresponding to the source message, and write the source message identifier and the actual transmission data into a source message list corresponding to the source bus, the source message list includes a plurality of first target rows, each first target row is used to store a source message identifier and actual transmission data corresponding to a source message; A mapping search circuit is used to determine, for each first target row, a destination bus corresponding to the source message and a mapping rule according to a source message identifier stored in the first target row; and write the actual transmission data in the first target row into a destination message list corresponding to the destination bus according to the mapping rule, wherein the destination message list includes a plurality of second target rows, each second target row being used to store a piece of actual transmission data transformed according to the mapping rule; An output circuit is respectively connected to each destination bus in at least one destination bus, and is used to obtain a target message for each second target row according to actual transmission data stored in the second target row after being transformed according to a mapping rule, and send the target message to the destination bus corresponding to the second target row, so that the destination bus transmits the target message.
2. The device according to claim 1, characterized in that When the input circuit determines the source message identifier and the actual transmission data corresponding to the source message, and writes the source message identifier and the actual transmission data into the source message list corresponding to the source bus, it is specifically used to: Determine a message identifier corresponding to the source message; When the message identifier is a preset message identifier, determining actual transmission data corresponding to the source message, and writing the source message identifier and the actual transmission data into a source message list corresponding to the source bus; When the message identifier is not a preset message identifier, the source message is sent to a destination bus having the same transmission protocol as the source bus.
3. The device according to claim 2, characterized in that When the message identifier is a preset message identifier, the input circuit determines the actual transmission data corresponding to the source message, specifically for: When the message identifier is a preset message identifier, determining the length and start bit of the actual transmission data according to the message identifier; The actual transmission data is determined according to the start bit and the length.
4. The device according to claim 1, characterized in that When the mapping search circuit determines the destination bus corresponding to the source message and the mapping rule according to the source message identifier stored in the first target row, the mapping search circuit is specifically used to: According to the source message identifier stored in the first target row, a mapping relationship table is searched to determine the destination bus corresponding to the source message and the mapping rule. The mapping relationship table includes: a source message identifier field, a destination bus identifier field, and a data alignment field. The field value of the data alignment field is used to indicate the mapping rule.
5. The device according to claim 4, characterized in that The mapping relationship table further includes a plurality of mapping map fields, wherein the number of mapping map fields is the same as the number of bits of the actual transmission data; The field value of the data alignment field includes: individually specified, aligned from a preset position; when the field value of the data alignment field is individually specified, the field value of the i-th mapping map field in the multiple mapping map fields is used to indicate the storage position of the i-th bit in the actual transmission data in the corresponding second target row, and when the field value of the data alignment field is aligned from a preset position, the field value of each mapping map field is a preset value.
6. The device according to claim 4, characterized in that The mapping relationship table further includes: an operation field, and the field value of the operation field includes: a first field value and a second field value; When the mapping search circuit determines the destination bus corresponding to the source message and the mapping rule according to the source message identifier stored in the first target row, the mapping search circuit is specifically used to: When the field value of the operation field is the first field value, determining the destination bus corresponding to the source message and the mapping rule according to the source message identifier stored in the first target row; When the field value of the operation field is the second field value, the destination bus and the mapping rule corresponding to the source message are determined according to the source message identifier stored in the first target row.
7. The device according to claim 4, characterized in that The mapping relationship table also includes: a target message identification field; When the destination bus is an Ethernet bus, the destination message list corresponding to the Ethernet bus further includes a source address field and a destination address field, the source address field corresponds to the local address, and the destination address field corresponds to the target host address; When the destination bus is an Ethernet bus, the mapping search circuit is also used to determine the target message identifier based on the source message identifier stored in the first target row, determine the target host address based on the target message identifier, and write the local address and the target host address into the corresponding destination message list.
8. The device according to claim 7, characterized in that When the input circuit determines the source message identifier and the actual transmission data corresponding to the source message, and writes the source message identifier and the actual transmission data into the source message list corresponding to the source bus, it is specifically used to: When the source bus is an Ethernet bus, determining a source address, a destination address, and actual transmission data corresponding to the source message; Determining the source message identifier according to the source address and the destination address; Writing the source address, destination address, source message identifier and actual transmission data into a source message list corresponding to the source bus; The mapping relationship table also includes: a message identifier / address mapping field. When the source bus is an Ethernet bus, the message identifier / address mapping field is used to indicate the storage position of the source address and the destination address in the corresponding second target row. When the source bus is not an Ethernet bus, the message identifier / address mapping field is used to indicate the storage position of the target message identifier in the corresponding second target row.
9. The device according to claim 4, characterized in that The mapping relationship table also includes: a progress field, which is used to indicate the progress of the process of converting the source message to the target message; the field values of the progress field include: partially completed; fully completed; the partially completed is used to indicate that it has been written into the destination message list but has not been transmitted out by the corresponding destination bus; the fully completed is used to indicate that it has been transmitted out by the corresponding destination bus.
10. The device according to claim 9, characterized in that The mapping relationship table also includes: an error type field, the field value of the error type field includes: a first error type, a second error type and a third error type, the first error type is used to indicate that an error occurred in the process of writing the source message list; the second error type is used to indicate that an error occurred in the process of writing the destination list; the third error type is used to indicate that an error occurred in the process of transmission by the destination transmission bus.
11. A data forwarding system, characterized in that: The system comprises: a data forwarding device, at least one source bus, at least one destination bus, at least one first processing device, and at least one second processing device; The data forwarding device is the device according to any one of claims 1 to 10; For any source bus, one end of the source bus is connected to the data forwarding device, and the other end of the source bus is connected to the first processing device, the at least one source bus corresponds to at least one first processing device in a one-to-one manner, and the source bus is used to transmit the source message received from the first processing device to the data forwarding device; For any destination bus, one end of the destination bus is connected to the data forwarding device, and the other end of the destination bus is connected to the second processing device. The at least one destination bus corresponds one-to-one to at least one second processing device, and the destination bus is used to transmit the target message received from the data forwarding device to the second processing device.
Citation Information
Patent Citations
Vehicle function implementation method and device, equipment and storage medium
CN114896087A
Instrument interconnection method and device, equipment and storage medium
CN116647576A
Message forwarding method and message forwarding device
CN117278352A
Industrial Ethernet protocol conversion device and method
CN117749905A
Automatic protocol conversion method, control unit, network architecture and medium
CN118748652A