Data forwarding apparatus and data forwarding system
By using the hardware forwarding mechanism of the data forwarding device, the problem of excessive CPU load on the MCU chip when handling CAN, LIN and Ethernet data forwarding is solved, achieving more efficient data forwarding and reducing CPU burden.
Patent Information
- Application Number
- CN202411423398.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2044-10-12
AI Technical Summary
With the increasing intelligence and miniaturization of automotive ECUs, MCU chips experience excessive CPU load when handling CAN, LIN, and Ethernet data forwarding, leading to problems such as task delays and system crashes.
A data forwarding device, including an input circuit, a mapping lookup circuit, and an output circuit, is used to convert data from the source bus to the destination bus through hardware forwarding, thereby reducing the CPU load.
Hardware forwarding reduces system latency, improves forwarding efficiency, reduces CPU load, and avoids task delays and system crashes.
Smart Images

Figure CN119299375B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of circuit design, and more particularly to a data forwarding device and a data forwarding system. Background Technology
[0002] As automotive ECUs (Electronic Control Units) become increasingly intelligent and miniaturized, more and more ECUs are integrating three automotive buses: CAN (Controller Area Network), LIN (Local Interconnect Network), and Ethernet. This leads to a significant increase in the amount of data exchanged between ECUs. To facilitate direct information flow between ECUs, each ECU will process data received from one bus and then transmit it through another bus, thus completing the information exchange.
[0003] The core component in the ECU that completes bus data reception and forwarding is the MCU (Microcontroller Unit) chip. The MCU chip uses its CPU (Central Processing Unit) to collect data from CAN, LIN, and Ethernet. It uses interrupts to copy data from the Data Register to RAM (Random Access Memory). After a series of permutations and combinations, the data is then sent out via CAN, LIN, or Ethernet through interrupts, thus completing the bus data forwarding.
[0004] With the advancement of vehicle intelligence, the amount of data on CAN, LIN, and Ethernet is constantly increasing, so the number of interrupts in the CPU of the MCU is also constantly increasing. In other words, the load on the CPU to handle interrupts is also constantly increasing, which may lead to problems such as task delays, system crashes, and overheating due to excessive CPU load. Summary of the Invention
[0005] This application provides a data forwarding device and a data forwarding system to reduce CPU load and thus reduce task latency.
[0006] In a first aspect, embodiments of this application provide a data forwarding apparatus. The apparatus 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. The source message and the target message have the same transmission content, and the target message is a message conforming to the transmission protocol of the destination bus. The apparatus includes:
[0007] An input circuit is connected to each of at least one source bus. For each source bus, the input circuit is used to receive a source message from the source bus, determine the 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 the source message identifier and actual transmission data corresponding to a source message.
[0008] The mapping lookup circuit is used to determine the destination bus and mapping rule corresponding to the source message for each first target line based on the source message identifier stored in the first target line; and to write the actual transmission data in the first target line into the destination message list corresponding to the destination bus according to the mapping rule. The destination message list includes multiple second target lines, and each second target line is used to store actual transmission data transformed according to the mapping rule.
[0009] The output circuit is connected to each of the at least one destination bus. For each second target line, the output circuit obtains a target message based on the actual transmission data stored in the second target line after being transformed according to the mapping rules, and sends the target message to the destination bus corresponding to the second target line so that the destination bus can transmit the target message.
[0010] In one possible implementation, when the input circuit determines the source message identifier and actual transmitted data corresponding to the source message, and writes the source message identifier and actual transmitted data into the source message list corresponding to the source bus, it is specifically used for:
[0011] Determine the message identifier corresponding to the source message;
[0012] When the message identifier is a preset message identifier, the actual transmission data corresponding to the source 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;
[0013] When the message identifier is not a preset message identifier, the source message is sent to the destination bus with the same transmission protocol as the source bus.
[0014] In one possible implementation, when the input circuit determines the actual transmitted data corresponding to the source message when the message identifier is a preset message identifier, it is specifically used for:
[0015] When the message identifier is a preset message identifier, the length and start bit of the actual transmitted data are determined according to the message identifier;
[0016] The actual transmitted data is determined based on the start bit and length.
[0017] In one possible implementation, when the mapping lookup circuit determines the destination bus corresponding to the source packet and the mapping rule based on the source packet identifier stored in the first target row, it is specifically used for:
[0018] Based on the source packet identifier stored in the first target row, the mapping relationship table is searched to determine the destination bus corresponding to the source packet and the mapping rule. The mapping relationship table includes: a source packet identifier field, a destination bus identifier field, and a data alignment method field. The field value of the data alignment method field is used to indicate the mapping rule.
[0019] In one possible implementation, the mapping table further includes multiple mapping map fields, wherein the number of mapping map fields is the same as the number of bits of the actual transmitted data;
[0020] The field values of the data alignment method field include: individually specified, and aligned from a preset position. When the field value of the data alignment method field is individually specified, the field value of the i-th mapping map field among the plurality of mapping map fields is used to indicate the storage position of the i-th bit in the actual transmitted data in the corresponding second target row. When the field value of the data alignment method field is aligned from a preset position, the field values of each mapping map field are preset values.
[0021] In one possible implementation, the mapping table further includes an operation field, the field values of which include a first field value and a second field value;
[0022] When the mapping lookup circuit determines the destination bus corresponding to the source message and the mapping rule based on the source message identifier stored in the first target row, it is specifically used for:
[0023] When the value of the operation field is the first 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.
[0024] When the value of the operation field is the second field value, the determination of the destination bus and mapping rule corresponding to the source message based on the source message identifier stored in the first target row is cancelled.
[0025] In one possible implementation, the mapping table further includes: a target message identifier field;
[0026] When the destination bus is an Ethernet bus, the destination message list corresponding to the Ethernet bus also includes a source address field and a destination address field, wherein 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 lookup circuit is further configured 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 one possible implementation, when the input circuit determines the source message identifier and actual transmitted data corresponding to the source message, and writes the source message identifier and actual transmitted data into the source message list corresponding to the source bus, it is specifically used for:
[0029] When the source bus is an Ethernet bus, the source address, destination address, and actual transmitted data corresponding to the source message are determined.
[0030] The source packet identifier is determined based on the source address and destination address;
[0031] Write the source address, destination address, source message identifier, and actual transmitted data into the source message list corresponding to the source bus;
[0032] The mapping table further 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 location of the source address and 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 location of the target message identifier in the corresponding second target row.
[0033] In one possible implementation, the mapping table further includes a progress field, which indicates the progress of the source message to target message conversion process; the field value of the progress field includes: partially completed; fully completed; the partially completed indicates that it has been written into the destination message list but has not been transmitted by the corresponding destination bus; the fully completed indicates that it has been transmitted by the corresponding destination bus.
[0034] In one possible implementation, the mapping table further includes an error type field, the field values of which include a first error type, a second error type, and a third error type, wherein the first error type indicates an error occurred during the process of writing to the source message list; the second error type indicates an error occurred during the process of writing to the destination list; and the third error type indicates an error occurred during transmission to the destination transmission bus.
[0035] Secondly, embodiments of this application provide 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 one-to-one with at least one first processing device. 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 with at least one second processing device. 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 apparatus and data forwarding system provided in this application include an input circuit, a mapping lookup circuit, and an output circuit. The input circuit receives a source packet from a source bus and writes the source packet identifier and actual transmission data corresponding to the source packet into a source message list corresponding to the source bus. The source message list includes multiple first target rows, each storing the source packet identifier and actual transmission data corresponding to a source packet. The mapping lookup circuit, for each first target row, determines the destination bus and mapping rule corresponding to the source packet based on the source packet identifier stored in the target row, and writes the actual transmission data from the first target row into the source message list according to the mapping rule. A destination message list corresponding to the destination bus includes multiple second target lines. Each second target line stores actual transmission data transformed according to mapping rules. The output circuit, for each second target line, obtains the target message based on the actual transmission data transformed according to mapping rules stored in that second target line, and sends the target message to the destination bus corresponding to the second target line, so that the destination bus can transmit the target message. Through the coordinated action of the input circuit, mapping lookup circuit, and output circuit, hardware forwarding from the source bus to the destination bus can be realized, reducing system latency, improving forwarding efficiency, and reducing the CPU load. Attached Figure Description
[0040] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0041] Figure 1 An application scenario diagram provided for an embodiment of this application;
[0042] Figure 2 This is a schematic diagram of the structure of a data forwarding device provided in an embodiment of this application;
[0043] Figure 3 A system architecture diagram provided for an embodiment of this application;
[0044] Figure 4 This is a flowchart illustrating an IP implementation method provided in an embodiment of this application.
[0045] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0046] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.
[0047] Current automotive MCU chip designs typically include a LIN controller, a CAN controller, and even more advanced automotive MCU chip designs may include an Ethernet controller. Moreover, the LIN, CAN, and Ethernet controllers are all independent, each being an independent IP (Intellectual Property, a verified, reusable integrated circuit module with a defined function).
[0048] As automotive ECUs become increasingly intelligent and miniaturized, more and more ECUs will integrate CAN, LIN, and Ethernet buses, significantly increasing the amount of data exchanged between them. To facilitate direct information flow between ECUs, each ECU will process data received from one bus and then transmit it through another bus, thus completing the information exchange. For example, an ECU might receive data from the CAN bus, process it using its MCU chip, and then transmit it via the LIN or Ethernet bus. The core component in the ECU responsible for bus reception and forwarding is the MCU chip.
[0049] While handling data forwarding between CAN, LIN, and Ethernet buses, the MCU is also responsible for other core algorithms and power processing. The CPU load of an MCU is generally quite high. Specifically, handling data forwarding between CAN, LIN, and Ethernet accounts for approximately 10% or more of the MCU's total CPU load.
[0050] In existing technologies, MCU chips use their CPU to collect data from CAN, LIN, and Ethernet. 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 out via 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 is constantly increasing, so the number of interrupts in the CPU of the MCU is also constantly increasing. In other words, the load on the CPU to handle interrupts is also constantly increasing. Then, the CPU also has to handle other more important core algorithms, functional components, etc., which may lead to excessive CPU load, resulting in task delays, system paralysis, overheating, and other phenomena.
[0052] In view of this, this application provides a data forwarding apparatus, comprising: an input circuit, a mapping lookup circuit, and an output circuit. The input circuit receives a source message from a source bus and writes the 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 storing the source message identifier and actual transmission data corresponding to a source message. The mapping lookup circuit, for each first target row, determines the destination bus and mapping rule corresponding to the source message based on the source message identifier stored in the target row, and writes the actual transmission data from the first target row into the source message list according to the mapping rule. The destination bus corresponds to a destination message list, which includes multiple second target lines. Each second target line stores actual transmission data transformed according to mapping rules. The output circuit, for each second target line, obtains the target message based on the actual transmission data transformed according to mapping rules stored in that second target line, and sends the target message to the destination bus corresponding to the second target line, so that the destination bus can transmit the target message. Through the coordinated action of the input circuit, mapping lookup circuit, and output circuit, hardware forwarding from the source bus to the destination bus can be realized, reducing system latency, improving forwarding efficiency, and reducing the CPU load.
[0053] Figure 1 An application scenario diagram provided for an embodiment of this application, such as... Figure 1 As shown, the system includes a data forwarding device, three source buses, three destination buses, and multiple processing devices. The three source buses are designated as source bus 1, source bus 2, and source bus 3, each with a different communication protocol. Source bus 1 is connected to processing device 1, source bus 2 to processing device 2, and source bus 3 to processing device 3. Each source bus is connected to an input circuit in the data forwarding device, and this source bus is used to transmit source messages sent by the connected processing device to the input circuit. The processing devices can be any device capable of sending, receiving, and processing messages, such as an ECU, MCU, CPU, etc.
[0054] The input circuit receives source messages from the source bus and writes the source message identifier and actual transmission data corresponding to the source message into the source message list corresponding to the source bus. The source message list includes multiple first target rows, each storing the source message identifier and actual transmission data corresponding to a source message. The mapping lookup circuit determines the destination bus and mapping rule corresponding to each first target row based on the source message identifier stored in the target row, and writes the actual transmission data in the first target row into the destination message list corresponding to the destination bus according to the mapping rule. The destination message list includes multiple second target rows, each storing actual transmission data transformed according to the mapping rule. The output circuit obtains the target message based on the actual transmission data transformed according to the mapping rule stored in the second target row for each second target row, and sends the target message to the destination bus corresponding to the second target row so that the destination bus can transmit the target message. ; The three destination buses are source bus 1, source bus 2 and source bus 3. 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. The source bus is used to transmit the source message sent by the processing device connected to it 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 to it for processing.
[0056] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0057] Figure 2 This is a schematic diagram of a data forwarding device provided in an embodiment of this 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 source message and the target message have the same transmission content, and the target message is a message conforming to the transmission protocol of the destination bus. As shown in Figure 2, the data forwarding device provided in this embodiment of the application may include:
[0058] The input circuit 201 is connected to each of the at least one source bus. For each source bus, the input circuit is used to receive a source message from the source bus, determine the source message identifier and actual transmission data corresponding to the source message, and write the source message identifier and actual transmission data into the 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 the source message identifier and actual transmission data corresponding to a source message.
[0059] In this context, the source bus and the destination bus are relative concepts. The bus that transmits messages sent by other processing devices to the data forwarding device is called the source bus, and the bus that transmits messages sent by the data forwarding device to other processing devices is called the destination bus.
[0060] Each source bus and each destination bus can be any communication system used in computer systems and other electronic devices to transmit data, addresses, and control signals. Examples include CAN bus, LIN bus, and Ethernet bus.
[0061] The communication protocols corresponding to each source bus in at least one source bus are different. Similarly, the communication protocols corresponding to each source bus in at least one destination bus are different.
[0062] Optionally, the source bus and the source message list can have a one-to-one correspondence. Each source message list is set in a register, which includes multiple storage units. Each storage unit corresponds to a row in the source message list and is used to store the source message identifier and the actual transmitted data corresponding to a source message. Each bit or field of each storage unit is predefined.
[0063] For example, Table 1 shows a source message list corresponding to the CAN bus, including a sequence number field, a source message identifier field, and an actual transmitted data field. Before using the data forwarding device provided in this application, each field of the source message list needs to be set and defined.
[0064] Table 1
[0065] Serial Number Source message identifier Actual transmitted data 1 0×12 000……000 2 0×13 111……111
[0066] The sequence number field value increases according to the natural sequence, meaning that the sequence number automatically increments by 1 for each incoming source packet.
[0067] The source message identifier field corresponds to the CAN ID (Identifier), which can be set using either a standard frame or an extended frame.
[0068] When configuring the actual transmitted data field, the data length of different types of CAN messages needs to be considered. For the CAN 2.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 of the at least one source bus. For each source bus, the input circuit is used to receive a source message from the source bus, determine the source message identifier and actual transmission data corresponding to the source message, and write the source message identifier and actual transmission data into the 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 the source message identifier and actual transmission data corresponding to a source message.
[0070] The circuits in this application can all be implemented using Verilog, HDL (Hardware Description Language), or other hardware description languages.
[0071] Optionally, when the input circuit determines the source message identifier and actual transmitted data corresponding to the source message, and writes the source message identifier and actual transmitted data into the source message list corresponding to the source bus, it is specifically used for:
[0072] Determine the message identifier corresponding to the source message;
[0073] When the message identifier is a preset message identifier, the actual transmission data corresponding to the source 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;
[0074] When the message identifier is not a preset message identifier, the source message is sent to the destination bus with the same transmission protocol as the source bus.
[0075] At least one first message identifier is stored in a fixed register.
[0076] Specifically, after receiving a source message, the input circuit first determines the message identifier corresponding to the source message, compares the determined message identifier with at least one first message identifier, and 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, it determines the actual transmitted data corresponding to the source data message and writes the source message identifier and the actual transmitted data into the source message list corresponding to the source bus.
[0077] If the identified message identifier is not one of at least one first message identifier, it means that the identified message identifier is not the preset message identifier. In this case, the source message is sent to the destination bus with the same transmission protocol as the source bus, and the processing device connected to the destination bus processes the source message.
[0078] In this way, when the source message identifier is the preset message identifier, the source message identifier and the actual transmitted data are written into the source message list and then forwarded. When the source message identifier is not the 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 input circuit determines the actual transmitted data corresponding to the source message when the message identifier is a preset message identifier, it is specifically used for:
[0080] When the message identifier is a preset message identifier, the length and start bit of the actual transmitted data are determined according to the message identifier;
[0081] The actual transmitted data is determined based on the start bit and length.
[0082] Specifically, when the input circuit determines that the message identifier is a preset message identifier, it determines the length and start bit of the actual transmitted data based on the message identifier, and then determines the actual transmitted data based on the length and start bit of the actual transmitted data. Optionally, the correspondence between the preset message identifier and the length and start bit of the actual transmitted data can be pre-stored in a fixed register.
[0083] Optionally, when the input circuit writes the source message identifier and the actual transmitted data into the source message list corresponding to the source bus, it is specifically used for:
[0084] Write the source message identifier, the actual transmitted data, and the length of the actual transmitted data into the source message list corresponding to the source bus.
[0085] For example, Table 2 shows another source message list corresponding to the CAN bus, including a sequence number field, a source message identifier field, an actual transmitted data field, and a length field. Before using the data forwarding device provided in this 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 transmitted data 1 0×12 Length 1 000……000 2 0×13 Length 2 111……111
[0088] The settings for the sequence number field, source message identifier field, and actual transmitted data field are the same as in Table 1.
[0089] When setting the length field, the set length should be consistent with the actual length of the transmitted data.
[0090] The mapping lookup circuit 301 is used to determine the destination bus and mapping rule corresponding to the source message for each first target line based on the source message identifier stored in the first target line; and to write the actual transmission data in the first target line into the destination message list corresponding to the destination bus according to the mapping rule. The destination message list includes multiple second target lines, and each second target line is used to store actual transmission data transformed according to the mapping rule.
[0091] Specifically, the mapping lookup circuit is used to determine the destination bus and mapping rule corresponding to the source message for each first target line based on the source message identifier stored in the first target line; and write the actual transmission data in the first target line into the destination message list corresponding to the destination bus according to the mapping rule. The destination message list includes multiple second target lines, and each second target line is used to store actual transmission data transformed according to the mapping rule.
[0092] Optionally, when the mapping lookup circuit determines the destination bus and mapping rule corresponding to the source message based on the source message identifier stored in the first target row, it is specifically used for:
[0093] Based on the source packet identifier stored in the first target row, the mapping relationship table is searched to determine the destination bus corresponding to the source packet and the mapping rule. The mapping relationship table includes: a source packet identifier field, a destination bus identifier field, and a data alignment method field. The field value of the data alignment method field is used to indicate the mapping rule.
[0094] The mapping table can be stored in a fixed register.
[0095] Table 3 is a mapping relationship table provided in the embodiments of this application. As shown in Table 3, the mapping relationship table includes: a sequence number field, a source message identifier field, a destination bus identifier field, and a data alignment method field.
[0096] Table 3
[0097] Serial Number Source message identifier Destination bus identifier Data alignment 1 0×12 01 Method 1 2 0×13 10 Method 2
[0098] In the destination bus identifier field, 01 can represent a LIN bus and 10 can represent an Ethernet bus. The data alignment field's value is used to indicate the mapping rules.
[0099] Specifically, the mapping lookup circuit can look up the mapping relationship table based on 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 method field.
[0100] In this way, by using a mapping table, the corresponding destination bus and mapping rule can be quickly found based on the source message identifier, reducing search time and improving the system's search efficiency.
[0101] Optionally, the mapping table may further include multiple mapping map fields, wherein the number of mapping map fields is the same as the number of bits in the actual transmitted data;
[0102] The field values of the data alignment method field include: individually specified, and aligned from a preset position. When the field value of the data alignment method field is individually specified, the field value of the i-th mapping map field among the plurality of mapping map fields is used to indicate the storage position of the i-th bit in the actual transmitted data in the corresponding second target row. When the field value of the data alignment method field is aligned from a preset position, the field values of each mapping map field are preset values.
[0103] Table 4 shows another mapping relationship table provided in the embodiments of this application. As shown in Table 4, the mapping relationship table includes: a sequence number field, a source message identifier field, a destination bus identifier field, a data alignment method field, and a mapping location field. Figure 1 Fields, mapping Figure 2 The number of fields in the mapping map is the same as the number of bits in the actual transmitted data.
[0104] Table 4
[0105]
[0106] Specifically, when the data alignment field value is specified individually, the field value of the i-th mapping map field among multiple mapping map fields is used to indicate the storage location of the i-th bit in the actual transmitted data in the corresponding second target row. For example, the mapping map... Figure 1 A field value of 2 indicates that the first bit of the actual transmitted data is stored in the second bit of the actual transmitted data storage area of the second target row, and is mapped to... Figure 2 The field value of 5 indicates that the second data in the actual transmitted data is stored in the fifth position of the actual transmitted data storage area of the second target row. The field value of the mapping map n is 4, indicating that the nth data in the actual transmitted data is stored in the fourth position of the actual transmitted data storage area of the second target row.
[0107] When the data alignment field value is aligned starting from the 5th position, it means that the 1st position of the actual transmitted data is stored in the 5th position of the actual transmitted data storage area of the second target row, the 2nd position of the actual transmitted data is stored in the 6th position of the actual transmitted data storage area of the second target row, and so on. In this case, the field values of each mapping map field are all preset values, such as 0.
[0108] In this way, flexible mapping and alignment methods can optimize the data transmission and storage process, improve data transmission efficiency, and reduce transmission latency. Furthermore, when the data alignment field is set to "specify separately," multiple mapping map fields can precisely indicate the storage location of each bit in the actual transmitted data within the corresponding second target row, achieving fine-grained data storage control.
[0109] Optionally, the mapping table further includes an operation field, wherein the field values of the operation field include a first field value and a second field value;
[0110] When the mapping lookup circuit determines the destination bus corresponding to the source message and the mapping rule based on the source message identifier stored in the first target row, it is specifically used for:
[0111] When the value of the operation field is the first 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.
[0112] When the value of the operation field is the second field value, the determination of the destination bus and mapping rule corresponding to the source message based on the source message identifier stored in the first target row is cancelled.
[0113] Table 5 shows another mapping relationship table provided in the embodiments of this application. As shown in Table 5, the mapping relationship table includes: operation field, sequence number field, source message identifier field, destination bus identifier field, data alignment method field, and mapping location field. Figure 1 Fields, mapping Figure 2 The number of fields in the mapping map is the same as the number of bits in the actual transmitted data.
[0114] Table 5
[0115]
[0116] For example, the first field value can be allowed, and the second field value can be disallowed. Only when the field value of the operation field is allowed can the destination bus corresponding to the source message and the mapping rule be determined according to the source message identifier stored in the first target line, and then the subsequent operation can be performed.
[0117] If the field value of the operation field is not allowed, cancel the determination of the destination bus and mapping rule corresponding to the source message based on the source message identifier stored in the first target row.
[0118] In other words, the field value of the operation field is used to indicate whether subsequent forwarding operations are allowed for the actual transmitted data in the first target line for each first target line.
[0119] In this way, by introducing operation fields, the system can take different actions based on different field values, increasing operational flexibility. For example, it can choose to perform a mapping lookup based on the source message identifier or cancel the mapping lookup. Furthermore, by clearly defining operation fields and corresponding operation methods, it can reduce erroneous operations and incorrect judgments, thereby improving the reliability and stability of the system.
[0120] Optionally, the mapping table may further include: a target message identifier field;
[0121] When the destination bus is an Ethernet bus, the destination message list corresponding to the Ethernet bus also includes a source address field and a destination address field, wherein 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 lookup circuit is further configured 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 correspondence between the source packet identifier and the destination packet identifier, and the correspondence between the destination packet identifier and the destination host address, can 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 the embodiments of this application. As shown in Table 6, it includes: sequence number field, destination address field, source address field, actual transmitted data field, and length / type field. The field value corresponding to the actual transmitted data field is the actual transmitted data after being transformed according to the mapping rules.
[0125] Table 6
[0126] Serial Number Destination address Source address Length / Type Actual transmitted data 1 2
[0127] The sequence number field value increases according to the natural sequence, meaning that the sequence number field value automatically increases by 1 for each piece of actual transmitted data written.
[0128] The value of the destination address field is the target host address, which is the host that processes the message. For example, the target host address can be the MAC (Medium Access Control) address of the target host.
[0129] The source address field has a local address as its value. For example, the local address can be the MAC address of the local machine.
[0130] Optionally, a value of 1500 or less in the length / type field indicates the actual length of the transmitted data, excluding padding. A value greater than 1500 indicates the type of message. For example, a value of 16'h0800 indicates an IP (Internet Protocol) message, a value of 16'h0806 indicates an ARP (Address Resolution Protocol) request / response message, and a value of 16'h8035 indicates a RARP (Reverse Address Resolution Protocol) request / response message.
[0131] Optionally, the field value of the actual transmitted data field can be between 46 and 1500 bytes.
[0132] Specifically, when the destination bus is an Ethernet bus, the mapping lookup circuit is also used to determine the destination message identifier based on the source message identifier stored in the first destination row, determine the destination host address based on the destination message identifier, and write the local address and the destination host address into the corresponding destination message list.
[0133] In this way, by automatically determining and filling 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. Furthermore, through explicit address mapping and autofill mechanisms, human error is reduced, the reliability and stability of the system are improved, and data can be accurately transmitted to the target host.
[0134] Optionally, when the input circuit determines the source message identifier and actual transmitted data corresponding to the source message, and writes the source message identifier and actual transmitted data into the source message list corresponding to the source bus, it is specifically used for:
[0135] When the source bus is an Ethernet bus, the source address, destination address, and actual transmitted data corresponding to the source message are determined.
[0136] The source packet identifier is determined based on the source address and destination address;
[0137] Write the source address, destination address, source message identifier, and actual transmitted data into the source message list corresponding to the source bus;
[0138] The mapping table further 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 location of the source address and 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 location of the target message identifier in the corresponding second target row.
[0139] The correspondence between the source address, destination address, and source packet 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 transmitted 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 transmitted data into the source message list corresponding to the source bus.
[0141] The mapping 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 location of the source address and destination address in the corresponding second target row. It can be stored in the storage area corresponding to the actual transmitted data field in the second target row. For example, the source address can be stored in the 1st to 8th bits of the storage area corresponding to the actual transmitted data field, and the destination address can be stored in the 9th to 16th bits of the storage area corresponding to the actual transmitted data field. The data alignment field in the mapping table is aligned starting from the 17th bit.
[0142] When the source bus is not an Ethernet bus, the packet identifier / address mapping field is used to indicate the storage location of the destination packet identifier in the corresponding second destination line. For example, the destination message list may include a destination packet identifier field, which can be stored in the storage area corresponding to the destination packet identifier field, or in the storage area corresponding to the actual transmitted data.
[0143] When the source bus is an Ethernet bus, the mapping lookup module is also used to write the source address and destination address into the destination message list corresponding to the destination bus according to the field value of the message identifier / address mapping field.
[0144] In this way, by determining the source address, destination address, and actual transmitted data when the source bus is an Ethernet bus, the system can support Ethernet communication, expanding its application scope. Furthermore, the message identifier / address mapping field in the mapping table indicates the storage location of the source and destination addresses in the second target row when the source bus is an Ethernet bus; and indicates the storage location of the destination message identifier when the source bus is not an Ethernet bus. This flexible field mapping mechanism allows the system to adapt to different types of buses, improving its versatility and adaptability.
[0145] The output circuit 302 is connected to each of the at least one destination bus. For each second target line, it obtains a target message based on the actual transmission data stored in the second target line after being transformed according to the mapping rules, and sends the target message to the destination bus corresponding to the second target line so that the destination bus can transmit the target message.
[0146] Specifically, the output circuit is connected to each destination bus in at least one destination bus, and is used to obtain the target message for each second target line according to the actual transmission data stored in the second target line after being transformed according to the mapping rules, and according to the preset rules, and send the target message to the destination bus corresponding to the second target line so that the destination bus can transmit the target message.
[0147] The data forwarding apparatus provided in this application includes an input circuit, a mapping lookup circuit, and an output circuit. The input circuit receives a source packet from a source bus and writes the source packet identifier and actual transmission data corresponding to the source packet into a source message list corresponding to the source bus. The source message list includes multiple first target rows, each storing the source packet identifier and actual transmission data corresponding to a source packet. The mapping lookup circuit, for each first target row, determines the destination bus and mapping rule corresponding to the source packet based on the source packet identifier stored in the target row, and writes the actual transmission data from the first target row into the destination bus according to the mapping rule. The bus corresponds to a destination message list, which includes multiple second target lines. Each second target line stores actual transmission data transformed according to mapping rules. The output circuit, for each second target line, obtains the target message based on the actual transmission data transformed according to mapping rules stored in that second target line, and sends the target message to the destination bus corresponding to the second target line, so that the destination bus can transmit the target message. Through the coordinated action of the input circuit, mapping lookup circuit, and output circuit, hardware forwarding from the source bus to the destination bus can be realized, reducing system latency, improving forwarding efficiency, and reducing the CPU load.
[0148] Optionally, the mapping table further includes a progress field, which indicates the progress of the source message to target message conversion process; the field value of the progress field includes: partially completed; fully completed; the partially completed indicates that it has been written into the destination message list but has not been transmitted by the corresponding destination bus; the fully completed indicates that it has been transmitted by the corresponding destination bus.
[0149] The mapping lookup circuit is also used to modify the value of the progress field to "partially completed" when the actual transmission data after being transformed according to the mapping rules is written into the destination message list; and to modify the value of the progress field to "fully completed" after the information in the destination message list has been converted into the target message and transmitted by the destination bus.
[0150] In this way, the progress field allows for real-time monitoring of the conversion process from source to target message, enabling better management and control of the conversion process.
[0151] Optionally, the mapping table further includes an error type field, the field values of which include: a first error type, a second error type, and a third error type. The first error type is used to indicate an error occurring during the process of writing to the source message list; the second error type is used to indicate an error occurring during the process of writing to the destination list; and the third error type is used to indicate an error occurring during the process of being transmitted by the destination transmission bus.
[0152] By defining different error types (first error type, second error type, and third error type), the specific stage at which the error occurs (source message list, destination list, transmission bus) can be clearly identified and located, thereby more effectively diagnosing problems and taking corresponding remedial measures. Introducing an error type field can significantly improve the system's error handling capabilities, reduce system downtime, and improve user experience.
[0153] Figure 3 A system architecture diagram provided for an embodiment of this application is 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 this application embodiment can be applied to an automotive MCU chip, which includes two or three of the following: a CAN bus controller, a LIN bus controller, and an Ethernet controller. It can realize hardware routing between the CAN controller, LIN controller, and Ethernet controller within the MCU, saving CPU resources and reducing bus routing latency.
[0154] The data forwarding device provided in this application can be implemented using Verilog, HDL, or other hardware description languages.
[0155] This invention can realize hardware forwarding between three types of buses. The following describes the IP implementation method using the hardware forwarding of messages from the CAN bus controller to the Ethernet controller. Figure 4 A flowchart of an IP implementation method provided in an embodiment of this application is shown below. Figure 4 As shown, it includes the following steps:
[0156] Step S1: Before using this invention, the source bus (Source), which is the message list of the CAN bus, needs to be set through the register.
[0157] Table 7 shows another type of source message list for the CAN bus.
[0158] Table 7
[0159] List Number ID (32-bit) Length (8 bits) Data (64 bytes) 1 0×12 length Data[0~63] 2 0×13 length Data[0~63]
[0160] In the CAN bus message list:
[0161] 1. The List Number (or sequence number) increases in natural order, so developers do not need to set it here.
[0162] 2. ID (Identification) column. The ID is the CAN ID of the source CAN message. In chip design, either a standard frame or an extended frame 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 this section, the data length of the CAN message needs to be considered. For CAN2.0, it needs to be designed to be 8 bytes; for CANFD, it needs to be designed to be 64 bytes.
[0165] 5. Status column. This field is a read-only area for developers and reflects whether the message was 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 on the Data register. After the CAN Controller receives the data corresponding to the CANID, it will automatically copy the Data to that line according to the Length.
[0169] 3. After the CAN message is forwarded, the Status bit will be automatically set to a certain state by the hardware (Pending, OK, Fail).
[0170] Step S2: Developers configure the destination bus in the register settings. In this example, this refers to the Ethernet destination message list.
[0171] Table 8 shows another list of destination messages for the Ethernet bus.
[0172] Table 8
[0173]
[0174] In the destination message list of the Ethernet bus:
[0175] 1. The List Number grows in natural sequence, so developers do not need to configure it here.
[0176] 2. Destination Address (DA) column. The destination address is the MAC address of the Ethernet destination.
[0177] 3. Source Address (SA) column. The source address is the MAC address of the Ethernet machine.
[0178] 4. Length / Type column. A field value less than or equal to 1500 indicates the effective data length of the frame. Length indicates the data length of the payload, excluding padding. 16'h0800 represents an IP packet; 16'h0806 represents an ARP request / response packet; 16'h8035 represents a RARP request / response packet.
[0179] 5. Data and padding column: The length of this data segment must be between 46 and 1500 bytes. The padding data will not change the value of Length.
[0180] 6. Frame Check Sequence (FCS): Used to store the check result of the CRC result.
[0181] Specifically:
[0182] 1. Developers need 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 fill in custom data according to their needs. When data forwarded from the CAN bus is mapped to this area, the mapping to which byte needs to be set in the LUT.
[0185] 4. The Frame Check Sequence (FCS) area is read-only for developers. The calculation of this area is done automatically by the system.
[0186] Step S3: After configuring the bus source and bus destination, the developer needs to configure the LUT module, i.e., the mapping table.
[0187] Tables 9 and 10 are another mapping relationship tables provided in the embodiments of this application.
[0188] Table 9
[0189]
[0190]
[0191] Table 10
[0192]
[0193] In Tables 9 and 10:
[0194] 1. The Action column indicates the action taken during the bus transition. The default is 0 - Stop (end) and 1 - Start (begin).
[0195] 2. The Source Channel column describes the source of the bus conversion. Specifically: 00 - CAN bus, 01 - LIN bus, 10 - Ethernet, 11 - Reserve.
[0196] 3. The Source List Number column indicates which ID of the bus Source is used for the conversion.
[0197] 4. Destination Channel column, used to describe the bus conversion destination. Where: 00 - CAN bus, 01 - LIN bus, 10 - Ethernet, 11 - Reserved.
[0198] 5. The Destination List Number column indicates which ID is obtained after the ID of the bus source is converted.
[0199] 6. The ID / Address Map column indicates which column in the Destination List Number corresponds to the ID in the Bus Source List Number. Specifically, 0x000 is the CAN / LIN destination ID (default option); 0x0yy is where the CAN / LIN data byte is placed in bits 0xyy and 0xyy+1 (following the LSB (Least Significant Bit) arrangement); and 0x1yy is where the Ethernet data byte is placed in bits 0xyy and 0xyy+1 (following the LSB arrangement).
[0200] 7. The Data Align Type column describes the alignment of Data in the List Number of the Bus Source and Data in the List Number of the Bus Destination. Among them, 00 - individually specified, that is, each byte in the Data Map is individually specified; 01 - alignment starts from Byte 0 of Data, and the alignment length is Length; 10 - alignment starts from the byte specified by DataMap[0], and the alignment length is Length; 11 - Reserved.
[0201] 8. The Data Map[n] column is used to describe the mapping relationship between the Data of the bus Source and the Data of the bus Destination.
[0202] 9. The Status column indicates the bus transition status. 000 - Init, initialization status; 001 - Pending, the bus source is ready and has been transmitted to the destination, but the destination has not yet been sent; 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 transition, error type yy.
[0203] The data yy=00 encountered an error during the Source preparation phase;
[0204] The data yy=01 has a format error during the Source to Destination conversion stage;
[0205] The data yy=10 encountered an error during the Destination transmission phase.
[0206] When developers use this feature, they should fill in the relevant information for the bus source to bus destination conversion in the Lookup Table.
[0207] 1. Select 00 in Source Channel, CAN bus.
[0208] 2. In Source List Number, select the List Number configured in CAN Source.
[0209] 3. Select 10 in Destination Channel, Ethernet bus.
[0210] 4. In Destination List Number, select the ListNumber in Ethernet that corresponds to CAN List Number.
[0211] 5. In this case, the CANID can be placed in the Ethernet Data area, tentatively in Data
[20] , and 0x014 can be filled in here.
[0212] 6. Data alignment method: Here, Data Align Type is set to 10, specifying the starting alignment of the specified bytes.
[0213] 7. Data Map[0], here 21 = 0x15 is set, and it is aligned according to the length specified by Length.
[0214] Compared with existing technologies, this application fully implements the forwarding of three common vehicle buses using a hardware design language, without any software intervention during hardware forwarding. At the same time, it innovatively uses List Number to map each bus one-to-one, realizing personalized forwarding. During hardware forwarding, different scenarios are still considered in the design, and configurable operations are performed to realize multi-scenario applications.
[0215] The solution of this invention implements bus conversion entirely in hardware, which reduces system latency, improves efficiency, and reduces CPU load.
[0216] This application embodiment 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 described 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 one-to-one with at least one first processing device. 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 with at least one second processing device. 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 and effects of the data forwarding system provided in this application can be found in the foregoing embodiments, and will not be repeated here.
[0221] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0222] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
[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 merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.
[0224] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0225] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
Claims
1. A data forwarding device, characterized in that, The apparatus 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 source message and the target message have the same transmission content, and the target message is a message conforming to the transmission protocol of the destination bus. The apparatus includes: An input circuit is connected to each of at least one source bus. For each source bus, the input circuit is used to receive a source message from the source bus, determine the 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 the source message identifier and actual transmission data corresponding to a source message. A mapping lookup circuit is used to, for each first target row, look up a mapping relationship table based on the source message identifier stored in the first target row to determine the destination bus and mapping rule corresponding to the source message; and according to the mapping rule, write the actual transmission data in the first target row into a destination message list corresponding to the destination bus. The destination message list includes multiple second target rows, each second target row being used to store actual transmission data transformed according to the mapping rule. The mapping relationship table includes: a source message identifier field, a destination bus identifier field, a data alignment method field, and multiple mapping map fields. The field value of the data alignment method field is used to indicate the mapping rule, and the number of mapping map fields is the same as the number of bits in the actual transmission data. The field value of the data alignment method field includes: individually specified, aligned from a preset position. When the field value of the data alignment method field is individually specified, the field value of the i-th mapping map field among 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. When the field value of the data alignment method field is aligned from a preset position, the field values of each mapping map field are preset values. The output circuit is connected to each of the at least one destination bus. For each second target line, the output circuit obtains a target message based on the actual transmission data stored in the second target line after being transformed according to the mapping rules, and sends the target message to the destination bus corresponding to the second target line so that the destination bus can transmit the target message.
2. The apparatus according to claim 1, characterized in that, When the input circuit determines the source message identifier and actual transmitted data corresponding to the source message, and writes the source message identifier and actual transmitted data into the source message list corresponding to the source bus, it is specifically used for: Determine the message identifier corresponding to the source message; When the message identifier is a preset message identifier, the actual transmission data corresponding to the source 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; When the message identifier is not a preset message identifier, the source message is sent to the destination bus with the same transmission protocol as the source bus.
3. The apparatus according to claim 2, characterized in that, When the message identifier is a preset message identifier, the input circuit, when determining the actual transmitted data corresponding to the source message, is specifically used for: When the message identifier is a preset message identifier, the length and start bit of the actual transmitted data are determined according to the message identifier; The actual transmitted data is determined based on the start bit and length.
4. The apparatus according to claim 1, characterized in that, The mapping table further includes an operation field, the field values of which include a first field value and a second field value; The mapping lookup circuit is specifically used for: When the value of the operation field is the first field value, the mapping relationship table is searched according to the source message identifier stored in the first target row to determine the destination bus and mapping rule corresponding to the source message; When the value of the operation field is the second field value, the determination of the destination bus and mapping rule corresponding to the source message based on the source message identifier stored in the first target row is cancelled.
5. The apparatus according to claim 1, characterized in that, The mapping table also includes: a target message identifier field; When the destination bus is an Ethernet bus, the destination message list corresponding to the Ethernet bus also includes a source address field and a destination address field, wherein 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 lookup circuit is further configured 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.
6. The apparatus according to claim 5, characterized in that, When the input circuit determines the source message identifier and actual transmitted data corresponding to the source message, and writes the source message identifier and actual transmitted data into the source message list corresponding to the source bus, it is specifically used for: When the source bus is an Ethernet bus, the source address, destination address, and actual transmitted data corresponding to the source message are determined. The source packet identifier is determined based on the source address and destination address; Write the source address, destination address, source message identifier, and actual transmitted data into the source message list corresponding to the source bus; The mapping table further 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 location of the source address and 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 location of the target message identifier in the corresponding second target row.
7. The apparatus according to claim 1, characterized in that, The mapping table also includes a progress field, which indicates the progress of the source message to target message conversion process; the field value of the progress field includes: partially completed; fully completed; partially completed indicates that it has been written into the destination message list but has not been transmitted by the corresponding destination bus; fully completed indicates that it has been transmitted by the corresponding destination bus.
8. The apparatus according to claim 7, characterized in that, The mapping table further includes an error type field, the field values of which include a first error type, a second error type, and a third error type. The first error type indicates an error occurred during the process of writing to the source message list; the second error type indicates an error occurred during the process of writing to the destination list; and the third error type indicates an error occurred during the transmission of the message to the destination bus.
9. A data forwarding system, characterized in that, The system includes: 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-8; 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 one-to-one with at least one first processing device. 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 with at least one second processing device. 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
Message forwarding method and message forwarding device
CN117278352A
Industrial Ethernet protocol conversion device and method
CN117749905A