CAN XL bus message and ETH bus message conversion method and FPGA-based converter
By designing the interconversion method between CAN XL bus and ETH bus on FPGA, and using preprocessing and filters to realize packet conversion, the problem of seamless bridging between CAN XL bus and ETH bus is solved, and the frame drop problem is avoided, which improves the conversion accuracy.
Patent Information
- Application Number
- CN202410302893.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-18
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-03-18
AI Technical Summary
The prior art is difficult to seamlessly bridge the CAN XL bus with the ETH bus without replacing the controller, and frame dropping is prone to occur when the software-level interface protocol is transferred.
A method of interchangeing CAN XL bus data and ETH bus data based on FPGA is designed. The CAN XL bus message is converted into ETH bus messages through preprocessing and filters, or vice versa, maintaining the message protocol format to avoid frame drop problems caused by long processing time at the software level.
It realizes seamless interchange between the CAN XL bus and the ETH bus, avoids frame loss problems, improves conversion accuracy, and reduces the authentication cost and cycle after device upgrade.
Smart Images

Figure CN118450013B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of bus message processing, and in particular relates to a method for converting CAN XL bus data to ETH bus data and a converter based on FPGA. Background Art
[0002] Currently, there is a market demand for CAN XL (Controller Area Network extended data-field length) devices to be connected to the ETH (Ethernet) bus, and there is also a market demand for Ethernet devices to be connected to the CANXL bus. Currently, the LLC (Logic Link Control) Data field has been defined in the CAN XL message to be compatible with the Ethernet message (IEEE 802.3), and the AF field has been added to store the intercepted destination MAC address. Since CAN XL is a new bus, most controllers currently do not support this bus standard, but need to be connected to the CAN XL network. In the automotive / industrial fields, replacing the controller will bring investment in R&D / testing costs and bring product uncertainty risks. Vehicle manufacturers or other customers are also very cautious about changes at the component controller level. The cost and cycle of re-certification after equipment upgrades will also bring more risks. Therefore, there is an urgent need for a converter that can seamlessly bridge the traditional controller and the new CAN XL bus standard.
[0003] The general-purpose chip ARM can also allow CAN XL and ETH to convert interface protocols at the software level. However, due to the long software processing time (ARM is not good at streaming data processing, and the memory reading of a frame of messages is very time-consuming, often in microseconds), there is a situation where the next frame of messages arrives before the previous frame of messages is processed, which will cause queue congestion and cause frame loss. Summary of the invention
[0004] The purpose of the present invention is to provide a method and a converter for converting CAN XL bus data to ETH bus data.
[0005] In order to solve the above technical problems, the present invention provides a method for converting CAN XL bus data to ETH bus data, comprising:
[0006] Step S101, preprocessing the CAN XL bus message to obtain the CAN XL bus message to be converted;
[0007] Step S102, extracting the CAN XL bus message to be converted, and putting it into the corresponding field of the ETH bus message to realize conversion; or
[0008] Step S201, preprocessing the ETH bus message to obtain the ETH bus message to be converted;
[0009] Step S202: extract the ETH bus message to be converted and put it into the corresponding field of the CAN XL bus message to realize conversion.
[0010] In another aspect, the present invention further provides a converter for converting between CAN XL bus messages and ETH bus messages, comprising:
[0011] a main controller module configured to set preprocessing parameters of the filter, and to convert the preprocessed CANXL bus message into an ETH bus message and send it to the ETH interface, or to convert the preprocessed ETH bus message into a CAN XL bus message and send it to the CAN XL interface; and
[0012] FPGA module, configured to include:
[0013] A CAN XL interface, configured to receive or send CAN XL bus messages;
[0014] ETH interface, configured to receive or send ETH bus messages;
[0015] The filter is configured to pre-process the CAN XL bus message or the ETH bus message according to the pre-processing parameters output by the main controller module, and send the pre-processed CAN XL bus message or the ETH bus message to the main controller module.
[0016] In a third aspect, the present invention also provides a CAN XL bus message and ETH bus message interconversion system, comprising: a computer device;
[0017] The computer device is configured to include:
[0018] a preprocessing module configured to preprocess the CAN XL bus message or the ETH bus message to obtain a CAN XL bus message or an ETH bus message to be converted; and
[0019] The conversion module is configured to extract the CAN XL bus message or ETH bus message to be converted and put it into the corresponding field of the ETH bus message or the CAN XL bus message to realize the conversion.
[0020] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above-mentioned conversion method when executed by a computer processor.
[0021] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program / instruction, which, when executed by a processor of a computer, implements the steps of the above-mentioned conversion method.
[0022] The beneficial effect of the present invention is that the method for converting CAN XL bus data to ETH bus data of the present invention maintains the protocol format of the corresponding bus message during the preprocessing process through each filter, which greatly simplifies the conversion method between the two bus messages. The conversion can be achieved by simply placing the field content of one bus message into the corresponding field of another bus message, and avoids the frame loss problem caused by the interface protocol conversion at the software level in the related art, thereby improving the conversion accuracy between the two bus messages.
[0023] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description and the drawings.
[0024] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] FIG. 1( a ) shows a step diagram of converting a CAN XL bus message to an ETH bus message according to some embodiments;
[0027] FIG. 1( b ) shows a diagram of steps for converting an ETH bus message to a CAN XL bus message according to some embodiments;
[0028] Figure 2 The CAN XL bus message format involved in some embodiments is shown;
[0029] Figure 3 The ETH bus message format involved in some embodiments is shown;
[0030] Figure 4 A filtering flow chart of each filter involved in some embodiments is shown;
[0031] Figure 5A principle block diagram of a converter for converting between CAN XL bus messages and ETH bus messages involved in some embodiments is shown;
[0032] Figure 6 A principle block diagram of a CAN XL bus message and ETH bus message mutual conversion system involved in some embodiments is shown. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] Currently, there is a market demand for CAN XL devices to be connected to the ETH bus, and there is also a market demand for Ethernet devices to be connected to the CAN XL bus. Currently, the LLC Data field has been defined in the CAN XL message to be compatible with the Ethernet message (IEEE 802.3), and the AF field has been added to store the intercepted destination MAC address. Since CANXL is a new bus, most controllers currently do not support this bus standard, but need to be connected to the CAN XL network. In the automotive / industrial fields, if the controller is replaced, it will not only bring investment in R&D / testing costs, but also bring product uncertainty risks. Vehicle manufacturers or other customers are also very cautious about changes at the component controller level. The cost and cycle of re-certification after equipment upgrades will also bring more risks. Therefore, it is urgent to design a dedicated converter for converting between the CAN XL interface and the ETH interface.
[0035] Therefore, at least one embodiment provides a method for converting CAN XL bus messages to ETH bus messages, including:
[0036] Step S101, preprocessing the CAN XL bus message to obtain the CAN XL bus message to be converted;
[0037] Step S102, extracting the CAN XL bus message to be converted, and putting it into the corresponding field of the ETH bus message to realize conversion; or
[0038] Step S201, preprocessing the ETH bus message to obtain the ETH bus message to be converted;
[0039] Step S202: extract the ETH bus message to be converted and put it into the corresponding field of the CAN XL bus message to realize conversion.
[0040] The method for converting CAN XL bus messages to ETH bus messages of this embodiment maintains the protocol format of the corresponding bus messages during the preprocessing process through each filter, which greatly simplifies the conversion method between the two bus messages. The conversion can be achieved by simply placing the field content of one bus message into the corresponding field of another bus message. The problem of frame loss caused by the interface protocol conversion at the software level in the related art is avoided, and the conversion accuracy is improved.
[0041] Various non-limiting implementations of the embodiments of the present disclosure are described in detail below in conjunction with the accompanying drawings.
[0042] As shown in FIG1 , some embodiments provide a method for converting a CAN XL bus message to an ETH bus message, including:
[0043] Step S101, preprocessing the CAN XL bus message to obtain the CAN XL bus message to be converted;
[0044] Step S102, extracting the CAN XL bus message to be converted, and putting it into the corresponding field of the ETH bus message to realize conversion; or
[0045] Step S201, preprocessing the ETH bus message to obtain the ETH bus message to be converted;
[0046] Step S202: extract the ETH bus message to be converted and put it into the corresponding field of the CAN XL bus message to realize conversion.
[0047] Specifically, in some embodiments, when converting a CAN XL bus message into an ETH bus message, the CAN XL bus message is preprocessed, including:
[0048] Transmitting the CAN XL bus message to the first filtering module to filter the arbitration field ID of the CAN XL bus message; and
[0049] The CAN XL bus message passing through the first filtering module is transmitted to the second filtering module to filter the destination MAC address of the CAN XL bus message and at least one field content other than the destination MAC address to obtain the CAN XL bus message to be converted.
[0050] In some embodiments, the first filter module includes a first filter; the second filter module includes: a second filter and a third filter;
[0051] Filtering the destination MAC address of the CAN XL bus message and at least one field content other than the destination MAC address, including:
[0052] Determine the location of the above field content in the CAN XL bus message:
[0053] If the contents of the above fields are all located after the destination MAC address, the CAN XL bus message that passes through the first filtering module is transmitted to the second filter to filter the destination MAC address of the CAN XL bus message, and then the CAN XL bus message that passes through the second filter is transmitted to the third filter to filter the contents of the above fields to obtain the CAN XL bus message to be converted; or
[0054] If part of the above-mentioned field content is located before the destination MAC address and the other part is located after the destination MAC address, the CAN XL bus message passing through the first filter is first transmitted to the third filter to customize the filtering of the field content located before the destination MAC address; then the CAN XL bus message passing through the third filter is transmitted to the second filter to filter the destination MAC address of the CAN XL bus message; and then the CAN XL bus message passing through the second filter is transmitted to the third filter to customize the filtering of the field content located after the destination MAC address, so as to obtain the CAN XL bus message to be converted.
[0055] Specifically, the front end of the message in the CAN XL interface protocol is an 11-bit arbitration field ID, which represents the priority of each bus device. Before the CAN XL bus message is converted into an ETH bus message, it is first filtered by the first filter. The main function of the first filter is to filter the 11-bit low-priority CAN XL bus message, which can greatly reduce the traffic volume of the CAN XL bus message according to the priority.
[0056] The method for filtering 11-bit low-priority CAN XL bus messages through a first filter includes: assuming that the arbitration field ID field of the CAN XL bus message is x; configuring parameters a and b to the first filter through a main controller module, wherein parameter a is the lowest priority arbitration field ID corresponding to the CAN XL bus messages allowed to pass through the first filter, and parameter b is the highest priority arbitration field ID corresponding to the CAN XL bus messages allowed to pass through the first filter; and allowing CAN XL bus messages with x greater than or equal to a and x less than b to pass through the first filter.
[0057] For example, if you want to filter out CAN XL bus messages with arbitration field ID less than 16, then parameter a is 16, parameter b is 2 11 , that is, 16≤x<2 11 The message will pass the first filter, meeting our requirement that the CAN XL bus message arbitration field ID field x ≥ 16.
[0058] Specifically, the CAN XL interface protocol already contains the intercepted destination MAC address, which intercepts the 48-bit destination MAC address to 32 bits. The main function of the second filter is to filter the destination MAC address in the CAN XL bus message, which can remove the destination MAC address that is not needed or does not match the main controller module, thereby reducing the traffic volume of the CAN XL bus message.
[0059] The third filter is used to filter other fields of the CAN XL bus message, such as the type field, the load data field, etc. The user can customize the filtering content according to the needs.
[0060] The third filter is composed of multiple small filters in parallel, each of which is an independent structure similar to a sequence detector. The number of small filters in the third filter can be arbitrarily defined according to user needs.
[0061] The second filter and the third filter have the same structure, including a main switch, a unit enable switch c and a filter value d. The main controller module decides whether to turn on the main switch. When turned on, it means that this filter is enabled; the filter value d is the actual value of the corresponding bit of the bus message. Only when this value is met will the filter be judged as passed; the unit enable switch c determines which bit of the filter value d is valid, which can accurately control each bit in a set of filter values, which is suitable for application scenarios where fields or bits with different meanings need to be controlled.
[0062] The method for filtering the destination MAC address in the CAN XL bus message through the second layer filter includes: assuming that the destination MAC address field in the CAN XL bus message is y; configuring parameters c and d to the second filter through the main controller module, the parameter c is a unit enable switch, and the parameter d is an actual filter value; performing a bitwise AND gate operation on the parameters c and d through the second filter to obtain a parameter e; and passing the CAN XL bus message with y equal to e through the second filter.
[0063] For example, if you want to filter out CAN XL bus messages with destination MAC address not 32'h016789AB, then parameters c and d are 48'hFF0000FFFFFF and 48'h01XXXX6789AB respectively, that is, CAN XL bus messages with destination MAC address y=48'h01XXXX6789AB will pass the second filter (X is an arbitrary value).
[0064] In some embodiments, extracting a CAN XL bus message to be converted and placing it into a corresponding field of an ETH bus message to achieve conversion includes: extracting a destination MAC address, a source MAC address, a TPID and a TCI, a CAN XL type, and load data in the LLC Data field of the CAN XL bus message in sequence; and placing the extracted information in the corresponding field of the ETH bus message in sequence to achieve conversion.
[0065] Specifically, the CAN XL bus message to be converted is extracted through the main controller module, and is placed into the corresponding field of the ETH bus message to achieve conversion.
[0066] In some embodiments, when converting the ETH bus message into the CAN XL bus message, the ETH bus message is preprocessed, including:
[0067] The ETH bus message is transmitted to the first filtering module to filter the preamble code of the ETH bus message; and the ETH bus message passing the first filtering module is transmitted to the second filtering module to filter the destination MAC address of the ETH bus message and at least one field content other than the destination MAC address to obtain the ETH bus message to be converted.
[0068] In some embodiments, filtering the destination MAC address of the ETH bus message and at least one field content other than the destination MAC address includes:
[0069] Determine the location of the above field content in the bus message:
[0070] If the contents of the above fields are all located after the destination MAC address, the ETH bus message passing through the first filtering module is transmitted to the second filter to filter the destination MAC address of the ETH bus message, and then the ETH bus message passing through the second filter is transmitted to the third filter to filter the contents of the above fields to obtain the ETH bus message to be converted; or
[0071] If part of the above-mentioned field content is located before the destination MAC address and the other part is located after the destination MAC address, the ETH bus message passing through the first filter is first transmitted to the third filter to customize the filtering of the field content located before the destination MAC address; then the ETH bus message passing through the third filter is transmitted to the second filter to filter the destination MAC address of the ETH bus message; and then the ETH bus message passing through the second filter is transmitted to the third filter to customize the filtering of the field content located after the destination MAC address to obtain the ETH bus message to be converted.
[0072] In this embodiment, CAN XL bus messages and ETH bus messages can share filters. The main controller module configures the parameters of each filter according to the bus message type (CAN XL bus message and ETH bus message). In this way, the filters can be reused and the chip resources and power consumption can be minimized by using shared resources.
[0073] Therefore, when converting ETH bus messages to CAN XL bus messages, the method for preprocessing ETH bus messages is similar to the method for preprocessing CAN XL bus messages mentioned above. For similar contents, please refer to the method for preprocessing CAN XL bus messages mentioned above, which will not be described here. The differences are as follows:
[0074] The front end of the message in the ETH interface protocol is a 7-byte preamble, each byte is 0x55. The Ethernet message will be received only when the preamble is correct, otherwise it will be regarded as an error frame. Before the ETH bus message is converted to the CAN XL bus message, it is first filtered by the first filter. The first filter is mainly used for Ethernet bus messages with incorrect preambles, which can prevent invalid Ethernet bus messages generated by incorrect preambles from being processed and converted later.
[0075] The method for filtering ETH bus messages with erroneous preambles through a first filter includes: assuming that the preamble field of the ETH bus message is x; configuring parameters a and b to the first filter through a main controller module, wherein parameter a is the preamble field value corresponding to the ETH bus message allowed to pass through the first filter, and parameter b is equal to parameter a plus 1; and allowing CAN XL bus messages with x greater than or equal to a and x less than b to pass through the first filter.
[0076] For example, if you want to filter the ETH bus message with the preamble equal to 11'h555, then the parameters a and b are 11'h555 and 11'h556 respectively, that is to say, the message with 11'h555≤x<11'h556 will pass the first filter, satisfying our requirement that the bus message preamble field x=11'h555.
[0077] The method for filtering the destination MAC address in the ETH bus message through the second layer filter includes: assuming that the destination MAC address field in the ETH bus message is y; configuring parameters c and d to the second filter through the main controller module, parameter c is a unit enable switch, and parameter d is an actual filter value; performing a bitwise AND gate operation on parameters c and d through the second filter to obtain parameter e; and passing the ETH bus message with y equal to e through the second filter.
[0078] For example, if you want to filter out ETH bus messages whose destination MAC address is not 48'h0123456789AB, then parameter c and parameter d are 48'h0123456789AB and
[0079] 48'hFFFFFFFFFFFF, that is, the ETH bus message with the destination MAC address y=48'h0123456789AB will pass through the second filter.
[0080] In some embodiments, extracting the ETH bus message to be converted and placing it into the corresponding field of the CAN XL bus message to achieve conversion includes:
[0081] Extracting the destination MAC address, source MAC address, TPID and TCI, Ethernet type and payload data in the corresponding fields of the ETH bus message in sequence; and
[0082] The extracted information is sequentially placed into the LLC Data field of the CAN XL bus message to achieve conversion.
[0083] CAN XL bus message such as Figure 2 As shown, the format of the ETH bus message is as follows Figure 3 shown.
[0084] Specifically, the ETH bus message to be converted is extracted through the main controller module, and is placed into the corresponding field of the CAN XL bus message to achieve conversion.
[0085] like Figure 4 As shown, the structure of the first filter and the second filter is serial, that is, only bus messages that have passed the first filter can flow to the second filter, otherwise this frame of messages will be directly discarded. After the bus message passes the first filter, the main controller module will first determine the position of the field content except the destination MAC address in the bus message and then decide whether to pass through the second filter first, or pass through the third filter first and then return to the second filter. Therefore, the main controller module will decide whether to call the third filter first after the first filter based on the actual filtering requirements of the bus message to meet the filtering requirements of the corresponding fields of the bus message.
[0086] like Figure 5 As shown, some embodiments further provide a converter for converting CAN XL bus messages to ETH bus messages based on FPGA, including:
[0087] a main controller module configured to set preprocessing parameters of the filter, and to convert the preprocessed CANXL bus message into an ETH bus message and send it to the ETH interface, or to convert the preprocessed ETH bus message into a CAN XL bus message and send it to the CAN XL interface; and
[0088] FPGA module, configured to include:
[0089] A CAN XL interface, configured to receive or send CAN XL bus messages;
[0090] ETH interface, configured to receive or send ETH bus messages;
[0091] The filter is configured to pre-process the CAN XL bus message or the ETH bus message according to the pre-processing parameters output by the main controller module, and send the pre-processed CAN XL bus message or the ETH bus message to the main controller module.
[0092] Specifically, the filter includes: a first filter module and a second filter module, and the first filter module includes a first filter; the second filter module includes: a second filter and a third filter.
[0093] Specifically, the main controller module can be implemented using ARM, and the functions of the CAN XL interface, ETH interface and filter can be implemented in the FPGA module.
[0094] In some embodiments, the entire converter can be an FPGA (wherein the main controller module can be implemented by building a soft-core ARM using the logic circuit of the FPGA).
[0095] In some embodiments, the converter may also be implemented using an application specific integrated circuit (ASIC).
[0096] In some embodiments, the converter may also adopt a system-on-chip SOC structure (FPGA+ARM architecture, the main controller module is implemented with a hard-core ARM).
[0097] In some embodiments, the converter further comprises: a data cache module;
[0098] The filter is configured to send the pre-processed CAN XL bus message or ETH bus message to the data buffer module; and
[0099] The main controller module is also configured to extract the pre-processed CAN XL bus message or ETH bus message from the data cache module for conversion.
[0100] Specifically, the data cache module includes a receiving cache module and a sending cache module; whether it is a CAN XL bus message or an ETH bus message, it is first converted into a single-bit stream data after passing through the respective interface communication modules, and then it will be filtered and pre-processed through three common filters. The pre-processed data stream will be stored in the receiving cache module (BRAM), and then the main controller module will extract the stream data in the data cache module and convert the subsequent bus messages according to the needs. Finally, the main controller module will transmit the converted bus messages through the sending cache module and the corresponding interface communication module. The data cache module can be closed according to the needs, and the stream data is directly output.
[0101] Specifically, the function of the data cache module can be implemented in an FPGA module.
[0102] This embodiment can solve the transplantation risk problem caused by replacing the controller. By directly inserting the converter of this embodiment into the CAN XL bus and the controller, the CAN XL bus signal can be converted into the ETH bus signal supported by the traditional controller. The user only needs to add the converter of this embodiment to the circuit board or the outside of the component to seamlessly mount the traditional controller to the CAN XL bus network. The main controller module can adopt an FPGA module. The converter of this embodiment is designed based on FPGA. The converter based on FPGA realizes the conversion between the CAN XL interface and the ETH interface. When processing a frame of message (stream data), no data caching is required. Only a few cycles (tens of nanoseconds) are needed to directly complete the conversion between the CAN XL bus message and the ETH bus message.
[0103] As shown in FIG6 , some embodiments further provide a CAN XL bus message and ETH bus message mutual conversion system, comprising: a computer device;
[0104] The computer device is configured to include:
[0105] a preprocessing module configured to preprocess the CAN XL bus message or the ETH bus message to obtain a CAN XL bus message or an ETH bus message to be converted; and
[0106] The conversion module is configured to extract the CAN XL bus message or ETH bus message to be converted and put it into the corresponding field of the ETH bus message or the CAN XL bus message to realize the conversion.
[0107] The specific implementation functions of the preprocessing module and the conversion module are implemented in a computer device, and the contents of the aforementioned method for converting CAN XL bus data to ETH bus data may be specifically referred to.
[0108] Some embodiments further provide a computer-readable storage medium having a computer program / instruction stored thereon, wherein the computer program / instruction, when executed by a processor of a computer, implements the steps of the above-mentioned conversion method.
[0109] Please refer to the detailed description of the method of converting CAN XL bus data to ETH bus data.
[0110] Some embodiments further provide a computer program product, including a computer program / instruction, characterized in that the computer program / instruction implements the steps of the above-mentioned conversion method when executed by a computer processor.
[0111] Please refer to the detailed description of the method of converting CAN XL bus data to ETH bus data.
[0112] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0113] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0114] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
[0115] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A method for converting CAN XL bus messages to ETH bus messages, characterized in that: include: Step S101, preprocessing the CAN XL bus message to obtain the CAN XL bus message to be converted; Step S102, extracting the CAN XL bus message to be converted, and putting it into the corresponding field of the ETH bus message to realize conversion; in When converting CAN XL bus messages to ETH bus messages, the CAN XL bus messages are preprocessed, including: Transmitting the CAN XL bus message to the first filtering module to filter the arbitration field ID of the CAN XL bus message; and The CAN XL bus message passing through the first filtering module is transmitted to the second filtering module to filter the destination MAC address of the CAN XL bus message and at least one field content other than the destination MAC address to obtain the CAN XL bus message to be converted; The second filter module includes: a second filter and a third filter; Filtering the destination MAC address of the CAN XL bus message and at least one field content other than the destination MAC address, including: Determine the location of the above field content in the CAN XL bus message: If the contents of the above fields are all located after the destination MAC address, the CAN XL bus message that passes through the first filtering module is transmitted to the second filter to filter the destination MAC address of the CAN XL bus message, and then the CAN XL bus message that passes through the second filter is transmitted to the third filter to filter the contents of the above fields to obtain the CAN XL bus message to be converted; or If part of the above-mentioned field content is located before the destination MAC address and the other part is located after the destination MAC address, the CAN XL bus message passing through the first filter is first transmitted to the third filter to customize the filtering of the field content located before the destination MAC address; then the CAN XL bus message passing through the third filter is transmitted to the second filter to filter the destination MAC address of the CANXL bus message; and then the CAN XL bus message passing through the second filter is transmitted to the third filter to customize the filtering of the field content located after the destination MAC address to obtain the CAN XL bus message to be converted; or Step S201, preprocessing the ETH bus message to obtain the ETH bus message to be converted; Step S202, extracting the ETH bus message to be converted and placing it into the corresponding field of the CAN XL bus message to achieve conversion; wherein When converting ETH bus messages to CAN XL bus messages, the ETH bus messages are preprocessed, including: Transmitting the ETH bus message to the first filtering module to filter the preamble of the ETH bus message; and The ETH bus message passing through the first filtering module is transmitted to the second filtering module to filter the destination MAC address of the ETH bus message and at least one field content other than the destination MAC address to obtain the ETH bus message to be converted; The second filter module includes: a second filter and a third filter; Filtering the destination MAC address of the ETH bus message and at least one field content other than the destination MAC address, including: Determine the location of the above field content in the bus message: If the contents of the above fields are all located after the destination MAC address, the ETH bus message passing through the first filtering module is transmitted to the second filter to filter the destination MAC address of the ETH bus message, and then the ETH bus message passing through the second filter is transmitted to the third filter to filter the contents of the above fields to obtain the ETH bus message to be converted; or If part of the above-mentioned field content is located before the destination MAC address and the other part is located after the destination MAC address, the ETH bus message passing through the first filter is first transmitted to the third filter to customize the filtering of the field content located before the destination MAC address; then the ETH bus message passing through the third filter is transmitted to the second filter to filter the destination MAC address of the ETH bus message; and then the ETH bus message passing through the second filter is transmitted to the third filter to customize the filtering of the field content located after the destination MAC address to obtain the ETH bus message to be converted; The third filter is composed of multiple small filters in parallel, each of which is an independent structure similar to a sequence detector; The second filter and the third filter have the same structure, including a main switch, a unit enable switch c and a filter value d, and the filter value d is the actual value of the corresponding bit of the bus message. The main switch is decided by a main controller module to determine whether to turn it on. When turned on, it means that the corresponding filter is enabled; the unit enable switch c determines which bit of the filter value d is valid.
2. The interconversion method according to claim 1, characterized in that: Extract the CAN XL bus message to be converted and put it into the corresponding field of the ETH bus message to achieve conversion, including: Extract the destination MAC address, source MAC address, TPID and TCI, CANXL type and load data in the LLC Data field of the CAN XL bus message in sequence; and The extracted information is sequentially placed into the corresponding fields of the ETH bus message to achieve conversion.
3. The interconversion method according to claim 1, characterized in that: Extract the ETH bus message to be converted and put it into the corresponding field of the CAN XL bus message to achieve conversion, including: Extracting the destination MAC address, source MAC address, TPID and TCI, Ethernet type and load data in the corresponding fields of the ETH bus message in sequence; and The extracted information is sequentially placed into the LLC Data field of the CAN XL bus message to achieve conversion.
4. A converter based on FPGA and using the conversion method as described in any one of claims 1 to 3 to convert CAN XL bus messages to ETH bus messages, characterized in that: include: A main controller module is configured to set preprocessing parameters of the filter, and to convert the preprocessed CAN XL bus message into an ETH bus message and send it to the ETH interface, or to convert the preprocessed ETH bus message into a CAN XL bus message and send it to the CAN XL interface; as well as FPGA module, configured to include: A CAN XL interface, configured to receive or send CAN XL bus messages; ETH interface, configured to receive or send ETH bus messages; The filter is configured to pre-process the CAN XL bus message or the ETH bus message according to the pre-processing parameters output by the main controller module, and send the pre-processed CAN XL bus message or the ETH bus message to the main controller module.
5. The converter according to claim 4, characterized in that The converter further comprises: a data cache module; The filter is configured to send the pre-processed CAN XL bus message or ETH bus message to the data buffer module; and The main controller module is also configured to extract the pre-processed CAN XL bus message or ETH bus message from the data cache module for conversion.
6. A system for converting CAN XL bus messages and ETH bus messages using the conversion method according to any one of claims 1 to 3, characterized in that: include: Computer devices; The computer device is configured to include: A preprocessing module is configured to preprocess the CAN XL bus message or the ETH bus message to obtain a CAN XL bus message or an ETH bus message to be converted; as well as The conversion module is configured to extract the CAN XL bus message or ETH bus message to be converted and put it into the corresponding field of the ETH bus message or the CAN XL bus message to realize the conversion.
7. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor of a computer, the steps of the interconversion method as claimed in any one of claims 1 to 3 are implemented.
8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a computer processor, the steps of the conversion method as claimed in any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Redundant industry Ethernet system with message multistage filtering function and service classification control function
CN104539408A
Service-oriented CAN XL and Ethernet bridge chip
CN116633716A