A CAN FD conversion method using RJ45 communication interface
The CAN FD conversion method through the RJ45 interface solves the problems of low transmission rate and large delay of the traditional CAN bus, realizes efficient vehicle diagnosis and flashing, improves the transmission rate and data throughput, and adapts to the high bandwidth requirements of new energy vehicles. .
Patent Information
- Application Number
- CN202311821363.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2043-12-27
AI Technical Summary
The traditional CAN bus in automobiles has a low transmission rate and a large delay time, which cannot meet the higher bandwidth and data throughput requirements of new energy vehicles, and the diagnosis and flashing efficiency is low.
The CAN FD conversion method using the RJ45 communication interface is implemented by obtaining the initialization command, switching the electronic switch path, generating a return response command, sending the data packet to the ARM processor, converting it into the CAN FD format, and sending it to the CAN FD transceiver. Quick diagnosis and flashing, supporting random switching between CAN and CAN FD.
It improves the efficiency of car diagnosis and flashing, the transmission rate can reach 5Mb/s, reduces the delay time and system overhead, enhances the data throughput and real-time performance, and reduces the risk of error detection.
Smart Images

Figure CN117811965B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of automobile electronic communication interfaces, and in particular relates to a CANFD conversion method using an RJ45 communication interface. Background Art
[0002] CAN is a serial communication protocol bus for real-time applications. The CAN protocol is used for communication between various components in the car, replacing expensive and bulky distribution harnesses. The robustness of the protocol extends its use to other automation and industrial applications. The characteristics of the CAN protocol include complete serial data communication, real-time support, and a maximum transmission rate of only 1Mb / s. As the functions of automobiles become more and more numerous and complex, the load rate of the traditional CAN bus is getting higher and higher, even as high as 95%, and there are still some limitations to the traditional CAN bus. As well as the rapid development of the new energy vehicle market, most of them communicate through CAN FD. The traditional CAN bus is gradually unable to meet its higher bandwidth and data throughput. The effective data field of the standard frame of the traditional CAN message is only 8 bytes, the transmission rate is low, the delay time is large, the data throughput is small, and the software efficiency is low when sending large data objects. Summary of the invention
[0003] The purpose of the present invention is to provide a CAN FD conversion method using an RJ45 communication interface, which can realize rapid diagnosis and rapid flashing of ECU, and can be connected with ordinary CAN diagnostic equipment, so as to realize the arbitrary switching between CAN and CAN FD, and effectively improve the efficiency of automobile diagnosis and flashing.
[0004] The technical solution adopted by the present invention is as follows:
[0005] A CAN FD conversion method using an RJ45 communication interface, comprising:
[0006] Obtaining an initialization command sent by the client to the server, wherein the initialization command includes a designated ECU device ID to be diagnosed and a specific electronic switch path selection command;
[0007] The server side switches the server side electronic switch to the OBD interface network path that complies with the electronic switch path selection command according to the obtained initialization command, and generates a return response instruction;
[0008] Obtaining a data packet, and according to the return response instruction generated by the server obtained by the client, sending the data packet to the ARM processor through the OBD interface network path that complies with the electronic switch path selection command;
[0009] The ARM processor receives the data packet from the client and determines whether the data packet is correct;
[0010] If the data packet is correct, it means that the data in the data packet is normal;
[0011] If the data packet is incorrect, it indicates that the data in the data packet is abnormal, and an error code is generated and sent to the client;
[0012] Get the CAN node virtualized by the CAN FD chip, convert the data in the data packet into the data format required by CAN FD, and send it to the CAN FD transceiver according to the CAN node virtualized by the CAN FD chip;
[0013] Get the CAN FD data received by the CAN FD transceiver and send it to the CAN FD bus.
[0014] In a preferred solution, before the step of obtaining the initialization command sent by the client to the server, the following steps are included:
[0015] According to the Ethernet chip of the MDIO protocol, the MDIO protocol interface of the ARM processor is connected to the Ethernet chip;
[0016] Through the TCP / IP protocol, the client establishes a communication connection with the server through the TCP / IP protocol.
[0017] In a preferred solution, the step of obtaining an initialization command sent by the client to the server includes:
[0018] Obtaining an initialization command, wherein the initialization command includes a specified ECU device ID to be diagnosed and a specific electronic switch path selection command, namely, the ECU device to be diagnosed and the selected electronic switch path;
[0019] The initialization command is sent to the server via TCP / IP protocol.
[0020] In a preferred embodiment, the server generates a step of returning a response instruction according to the acquired initialization command and switching the server electronic switch to the OBD interface network path that complies with the electronic switch path selection command, including:
[0021] The server receives and identifies the initialization command from the client, and identifies the electronic switch path selection command and the diagnostic ECU device ID;
[0022] According to the electronic switch path selection command obtained by identification, the server switches the electronic switch to the OBD interface network adapted to the selected path and obtains a switching completion instruction;
[0023] According to the switching completion instruction, the server generates a return response instruction and sends it to the client. The return response instruction includes communication parameters or status information.
[0024] In a preferred embodiment, the step of obtaining a data packet and sending the data packet to the ARM processor through an OBD interface network path that complies with the electronic switch path selection command according to the return response instruction generated by the server obtained by the client includes:
[0025] Get the data packet;
[0026] The client obtains the return response instruction;
[0027] According to the return response command generated by the server obtained by the client, the OBD interface network path that meets the electronic switch path selection command will be selected;
[0028] If the selected OBD interface network path does not match, it means that the selection fails, and then continue to select a matching OBD interface network path according to the electronic switch path selection command;
[0029] If the selected OBD interface network path is consistent, it means that the selection is successful, and a communication connection between the client and the ARM processor in the server is established through the selected OBD interface network path;
[0030] The data packet is sent to the ARM processor according to the OBD interface network path that complies with the electronic switch path selection command.
[0031] In a preferred solution, the data packet includes a 2-byte header of user-defined data, a 4-byte valid length bit, valid data less than 4096 bytes, and a tail check code.
[0032] In a preferred solution, the ARM processor receives a data packet from a client and determines whether the data packet is correct, including:
[0033] Obtain standard evaluation data, wherein the standard evaluation data includes 2 bytes of custom data at the head, 4 bytes of valid length bits, and a tail check code;
[0034] Get the 2-byte custom data at the head, 4-byte valid length and the checksum at the end of the data packet;
[0035] Determine whether it is standard assessment data;
[0036] If it is standard evaluation data, it means that the data in the data packet is normal;
[0037] If it does not belong to the standard evaluation data, it indicates that the 2-byte custom data at the head, the 4-byte valid length bit, or the tail check code in the data packet is abnormal, and an error code is generated and sent to the client, and the client sends the data packet again.
[0038] In a preferred solution, the steps of obtaining a CAN node virtualized by a CAN FD chip, converting data in a data packet into a data format required by CAN FD, and sending the data to a CAN FD transceiver according to the CAN node virtualized by the CAN FD chip include:
[0039] Through the virtual CAN node of the CAN FD chip, a communication connection is established;
[0040] The data in the data packet is converted into a data format required by the CAN FD protocol, and CAN data is extracted from the data packet, wherein the CAN data includes valid data less than 4096 bytes;
[0041] According to the CAN node virtualized by the CAN FD chip, the data in the data packet is converted into the data format required by CAN FD and then sent to the CAN FD transceiver.
[0042] In a preferred solution, the step of obtaining CAN FD data received by the CAN FD transceiver and sending the data to the CAN FD bus includes:
[0043] Get CAN FD data;
[0044] Establish a communication connection between the CAN FD transceiver and the CAN FD bus;
[0045] The CAN FD data is converted into electrical signals by the CAN FD transceiver and sent to the CAN FD bus.
[0046] And, a CAN FD conversion terminal using an RJ45 communication interface, comprising:
[0047] one or more processors;
[0048] a storage device having one or more programs stored thereon;
[0049] When the one or more programs are executed by the one or more processors, the one or more processors implement the CAN FD conversion method using the RJ45 communication interface.
[0050] The technical effects achieved by the present invention are:
[0051] The present invention obtains diagnostic data through a specific path, which is helpful for accurately analyzing problems. When the data is abnormal, the sending of error codes can help the client understand the specific cause of the diagnostic problem. Using the correct path to transmit data ensures data integrity and accuracy. Extracting and utilizing CAN data helps to deeply analyze the control system and network of the vehicle, which helps comprehensive vehicle diagnosis, as well as faster ecu flashing. The transmission rate is faster, and stable transmission can be up to 5Mb / s. The effective data field of the standard frame of the traditional CAN message is only 8 bytes, while CAN FD can accommodate 8 to 64 bytes, which effectively improves the bit rate while providing shorter CAN frames, shorter delay time, better real-time performance, higher bandwidth, relatively less system overhead, better data throughput, and simpler and more efficient software when sending larger data objects. CAN FD has a higher performance CRC algorithm, which reduces the risk of undetected errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 is a flow chart of the method provided by the present invention;
[0053] Figure 2 It is a data transmission structure diagram provided by the present invention;
[0054] Figure 3 It is a diagram of the electronic switch provided by the present invention;
[0055] Figure 4 This is a diagram of the format of a data packet sent by a client provided by the present invention. DETAILED DESCRIPTION
[0056] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0057] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0058] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure or characteristic that may be included in at least one implementation of the present invention. The phrase "in a preferred embodiment" that appears in different places in this specification does not refer to the same embodiment, nor is it a separate or selective embodiment that is mutually exclusive with other embodiments.
[0059] Secondly, the present invention is described in detail in conjunction with schematic diagrams. When describing the embodiments of the present invention in detail, for the convenience of explanation, the schematic diagrams are only examples and should not limit the scope of protection of the present invention.
[0060] Please see attached Figure 1 As shown, a CAN FD conversion method using an RJ45 communication interface is provided, including:
[0061] S1. Obtain the initialization command sent by the client to the server, where the initialization command includes the ECU device ID to be diagnosed and the specific electronic switch path selection command;
[0062] S2, the server side switches the server side electronic switch to the OBD interface network path that complies with the electronic switch path selection command according to the obtained initialization command, and generates a return response instruction;
[0063] S3, obtaining a data packet, and according to the return response instruction generated by the server obtained by the client, sending the data packet to the ARM processor through the OBD interface network path that complies with the electronic switch path selection command;
[0064] S4, the ARM processor receives the data packet from the client and determines whether the data packet is correct;
[0065] If the data packet is correct, it means that the data in the data packet is normal;
[0066] If the data packet is incorrect, it indicates that the data in the data packet is abnormal, and an error code is generated and sent to the client;
[0067] S5, obtaining the CAN node virtualized by the CAN FD chip, converting the data in the data packet into the data format required by CAN FD, and sending it to the CAN FD transceiver according to the CAN node virtualized by the CAN FD chip;
[0068] S6. Acquire the CAN FD data received by the CAN FD transceiver, and send it to the CAN FD bus.
[0069] As in the above steps S1 to S6, in the automobile diagnostic system, the client sends instructions to the server, including the diagnostic ECU device ID (for example, the engine control unit) and the electronic switch path selection command (selecting the engine diagnostic path). The server adjusts the electronic switch according to the initialization command and sets it to the OBD interface network (adapted to the engine diagnostic path) to ensure that the data can be transmitted through the correct path. The client prepares and sends the (engine) diagnostic data packet to the OBD interface network path according to the confirmation instruction of the server, and sends it to the ARM processor of the automobile via the path. After receiving the data packet, the ARM processor verifies its correctness. If the engine diagnostic data in the data packet is correct, the ARM processor determines that the data is normal; otherwise, the ARM processor generates an error code and sends it back to the client. The ARM processor extracts the CAN data in the data packet and prepares to send it to the CAN FD transceiver through the virtual CAN node of the CAN FD chip, and finally transmits it to the CAN FD transceiver through the CAN The FD transceiver sends it to the CANFD bus. This process ensures the effective transmission and processing of CAN data. The system obtains (engine) diagnostic data through a specific channel, which helps to accurately analyze engine problems. When the data is abnormal, the sending of error codes can help the client understand the specific cause of the diagnostic problem. Using the correct channel to transmit data ensures data integrity and accuracy. Extracting and utilizing CAN data helps to deeply analyze the vehicle's control system and network, and helps comprehensive vehicle diagnosis.
[0070] It should be noted that the data packet includes 2 bytes of custom data at the head, 4 bytes of valid length bits, valid data less than 4096 bytes and a tail check code.
[0071] like Figure 1 As shown, the CAN device communicates with the CAN FD device server through the client's TCP / IP protocol. The CAN FD device server converts the TCP / IP data into the data frame required by the CAN FD format to communicate with the ECU, and also has the function of switching through an electronic switch (one of the two).
[0072] like Figure 2 As shown, the switching path of the electronic switch is described as follows:
[0073] Scenario 1: When the CAN diagnostic device communicates directly with the ECU, close one of SW1-3, SW1-1, SW1-2, and SW4 (the specific closed path is specified according to the initialization instruction sent by the client), then close SW5, and the other switches are open, to achieve CAN protocol communication with the ECU device;
[0074] Scenario 2: When the CAN FD protocol is required to communicate with the ECU, the CAN FD mode is entered by judging the holding time of the level state change of the OBD.8 (detecting the ADC voltage value). After confirmation, SW3-1 and SW3-2 are closed, and then one of SW1-3, SW1-1, SW1-2, and SW4 is closed according to the path pointed to by the initialization instruction sent by the client, and one of SW21, SW22, SW23, and SW24 is closed. The remaining switches are opened to realize the CAN FD protocol communication with the ECU device.
[0075] like Figure 3 As shown, the data packet format is 2 bytes of custom data, 4 bytes of effective length, and a data packet smaller than 4096. The tail check code is the addition and inversion of the data packets to retain the last 1 byte value.
[0076] Before the step of obtaining the initialization command sent by the client to the server, it includes:
[0077] Stp1, according to the Ethernet chip of the MDIO protocol, the MDIO protocol interface of the ARM processor is connected to the Ethernet chip;
[0078] Stp2, through the TCP / IP protocol, the client establishes a communication connection with the server through the TCP / IP protocol.
[0079] As in the above steps Stp1 to Stp2, MDIO is a protocol for managing Ethernet physical layer devices. By obtaining the Ethernet chip of the MDIO protocol, the client can communicate with the network device. RJ45 is a network connection interface. Through this interface, the client can physically connect to the Ethernet chip of the MDIO protocol. This connection allows the client to control or exchange data and information between network devices. TCP / IP is the basis of network communication protocols, which allows data exchange between different devices. Through TCP / IP, the client can establish a connection with the server for data transmission and communication. By establishing a TCP / IP connection, the client can remotely manage and monitor the switch, perform configuration changes, collect status information and other operations. Through the MDIO protocol chip and RJ45 connection, the client can monitor the status of the network device in real time, identify and solve problems in time. Through this connection method, the client can control the network device, such as remote restart, configuration changes and other operations.
[0080] The steps of obtaining the initialization command sent by the client to the server include:
[0081] S101, obtaining an initialization command, the initialization command including a designated ECU device ID to be diagnosed and a specific electronic switch path selection command, namely, the ECU device to be diagnosed and the selected electronic switch path;
[0082] S102: Send an initialization command to the server via TCP / IP protocol.
[0083] As in the above steps S101 to S102, in the diagnostic system, the client obtains instructions in a specific format, including the ECU device ID to be diagnosed and the electronic switch path selection command, which instructs the server to perform corresponding diagnostic operations. TCP / IP is a network communication protocol that allows a reliable connection to be established between the client and the server and data to be exchanged. The client sends the obtained initialization command to the server through the TCP / IP protocol to instruct the server to perform corresponding operations. In the automobile diagnostic system, the client is a diagnostic tool that needs to diagnose the vehicle. The client obtains the diagnostic ID of the specified vehicle engine control unit (ECU) and determines the electronic switch path selection command required for diagnosis (such as selecting the engine diagnostic path). Subsequently, through the TCP / IP connection, the client sends these instructions to the server diagnostic system of the car, specifies the specific ECU device to be diagnosed and the required diagnostic path, and ensures the accuracy of the diagnosis. Through the TCP / IP protocol, the client can remotely send diagnostic instructions to the server, realize the ability of remote diagnosis and control, realize real-time communication between the client and the server, allow rapid transmission of diagnostic instructions and reception of diagnostic results, and improve diagnostic efficiency.
[0084] The server side switches the server side electronic switch to the OBD interface network path that complies with the electronic switch path selection command according to the obtained initialization command, and generates a return response instruction, including:
[0085] S201, the server receives and identifies the initialization command from the client, and identifies the electronic switch path selection command and the diagnostic ECU device ID therein;
[0086] S202, according to the electronic switch path selection command obtained by identification, the server switches the electronic switch to the OBD interface network adapted to the selected path, and obtains a switching completion instruction;
[0087] S203. According to the switching completion instruction, the server generates a return response instruction and sends it to the client. The return response instruction includes communication parameters or status information.
[0088] As in the above steps S201 to S203, the server receives the initialization command from the client, identifies the electronic switch path selection command and the diagnostic ECU device ID, and involves parsing the command format to extract the required information. The server performs corresponding operations to switch the electronic switch to the OBD interface network adapted to the selected path according to the identified electronic switch path selection command, ensuring that the data flows through the correct path. After completing the electronic switch switching, the server generates a return response instruction, which includes communication parameters or status information, and then sends the instruction to the client. This instruction informs the client that the electronic switch switching operation has been completed. In the automobile diagnostic system, the server receives the initialization command from the client, and the diagnosis specifies the engine control unit ( ECU device ID), and includes an electronic switch path selection command for selecting the engine diagnostic path. The server switches the electronic switch of the vehicle to the OBD interface network adapted to the engine diagnostic path according to the command, ensuring that the diagnostic data can flow through the correct path. Subsequently, the server generates a return response instruction containing confirmation that the switching is complete, and sends it to the client, so that the client knows that the server has completed the corresponding operation preparation, identified and switched the correct path according to the initialization command, ensuring that the diagnostic data flows through the correct path. The return response instruction can inform the client that the switching operation is completed, allowing the client to perform the next step when necessary. The return response instruction may contain communication parameters or status information, which helps the client understand the communication status and further optimize the communication efficiency.
[0089] The steps of obtaining a data packet and sending the data packet to the ARM processor through an OBD interface network path that complies with the electronic switch path selection command according to a return response instruction generated by the server obtained by the client include:
[0090] S301, obtaining a data packet;
[0091] S302, the client obtains a return response instruction;
[0092] S303, according to the return response instruction generated by the server obtained by the client, the OBD interface network path that meets the electronic switch path selection command is selected;
[0093] If the selected OBD interface network path does not match, it means that the selection fails, and then continue to select a matching OBD interface network path according to the electronic switch path selection command;
[0094] If the selected OBD interface network path is consistent, it means that the selection is successful, and a communication connection between the client and the ARM processor in the server is established through the selected OBD interface network path;
[0095] S304, sending the data packet to the ARM processor according to the OBD interface network path that complies with the electronic switch path selection command.
[0096] As in the above steps S301 to S304, the client obtains a data packet from the server, which includes specific diagnostic data or response information. The client receives and parses the return response instruction sent by the server, which confirms the OBD interface network path corresponding to the selected electronic switch path selection command. If the selected OBD interface network path does not meet the requirements of the electronic switch path selection command, the client will try to continue to select other suitable OBD interface network paths according to the electronic switch path selection command until a path that meets the conditions is found. After the client selects an OBD interface network path that meets the requirements according to the electronic switch path selection command, a communication connection is established. The client sends the data packet to the ARM processor through the selected OBD interface network path that meets the electronic switch path selection command. In the automobile diagnostic system, the client receives the OBD interface network path from the server. The return response instruction of the end determines the OBD interface network path corresponding to the selected electronic switch path selection command. If the initially selected path does not meet the requirements, the client will continue to try other OBD interface network paths according to the command until a suitable path is found. Once the selection is successful, the client uses the path to establish a connection and send the data packet to the ARM processor to ensure that the data flows through the correct path to the target processor, and ensure that the data packet flows to the ARM processor according to the correct path to avoid data loss or incorrect sending path. Successfully select and use the appropriate OBD interface network path to ensure that a communication connection is established between the client and the ARM processor, so that the diagnostic data can be accurately processed. The client can continue to try when selecting a path to find a suitable OBD interface network path that is suitable for the electronic switch path selection command to ensure the effectiveness of data transmission.
[0097] The ARM processor receives the data packet from the client and determines whether the data packet is correct, including:
[0098] S401, obtaining standard evaluation data, the standard evaluation data including 2 bytes of custom data at the head, 4 bytes of effective length bits and a tail check code;
[0099] S402, obtaining the header 2 bytes of custom data, 4 bytes of valid length bits and the tail check code in the data packet;
[0100] S403, determining whether it is standard evaluation data;
[0101] If it is standard evaluation data, it means that the data in the data packet is normal;
[0102] If it does not belong to the standard evaluation data, it indicates that the 2-byte custom data at the head, the 4-byte valid length bit, or the tail check code in the data packet is abnormal, and an error code is generated and sent to the client, and the client sends the data packet again.
[0103] As in the above steps S401 to S403, the ARM processor predefines the standard format of the data packet, including the header custom data, the valid length bit and the tail check code, for subsequent verification. The ARM processor extracts the header custom data, the valid length bit and the tail check code from the received data packet. If the information extracted from the data packet conforms to the predefined standard format, that is, the header custom data, the valid length bit and the tail check code all match the expected values, then the data in the data packet is determined to be normal. If the extracted information does not conform to the predefined standard format, such as the header custom data, the valid length bit or the tail check code is abnormal, then it is considered that there is an abnormality in the data packet, and the ARM processor generates an error code and sends it to the client, prompting the client that the data packet is abnormal and needs to be resent. In the automobile diagnostic system, the ARM processor A standard evaluation data format is predefined, including header custom data for identifying the data packet type, valid length bit indicating data length, and tail check code for verifying data packet integrity. When the ARM processor receives the data packet, it extracts the header custom data, valid length bit, and tail check code. If this information matches the expected format, the ARM processor determines that the data packet is normal. If some information does not match expectations, the ARM processor will generate an error code and send it to the client to inform it of the data packet abnormality and request the client to resend the data. By verifying the standard evaluation data format of the data packet, it ensures that the received data packet is complete and in the correct format. When the data packet is abnormal, the ARM processor can immediately generate an error code and send it to the client, so that the client knows the data abnormality and can take corrective measures in time.
[0104] The steps of obtaining a CAN node virtualized by a CAN FD chip, converting data in a data packet into a data format required by CAN FD, and sending the data to a CAN FD transceiver according to the CAN node virtualized by the CAN FD chip include:
[0105] S501, establish a communication connection through a virtual CAN node of the CAN FD chip;
[0106] S502, converting the data in the data packet into a data format required by CAN FD through the CAN FD protocol, and extracting CAN data from the data packet, where the CAN data includes valid data less than 4096 bytes;
[0107] S503 . According to the CAN node virtualized by the CAN FD chip, convert the data in the data packet into the data format required by CAN FD and send it to the CAN FD transceiver.
[0108] As in the above steps S501 to S503, first, hardware or software operations are performed to obtain the CAN node virtualized by the CAN FD chip, and a communication connection with the node is established. According to the CAN FD protocol, CAN data is extracted from the received data packet. These data usually include valid data less than 4096 bytes, which complies with the provisions of the CAN FD protocol. The CAN data extracted from the data packet is formatted according to the requirements of the CAN FD protocol, and then sent to the connected CAN FD transceiver through the CAN node virtualized by the CAN FD chip. In the CAN bus system of the car, the CAN FD chip simulates multiple CAN nodes, including nodes that send and receive data. The ARM processor, as a node, first establishes a communication connection with the CAN node simulated by the CAN FD chip. The ARM processor receives the CAN data packet and extracts the CAN data in the data packet according to the CAN FD protocol to ensure that the data complies with the prescribed format and length requirements. Subsequently, the ARM processor sends the data to the connected CAN FD transceiver using the CAN node virtualized by the CAN FD chip in accordance with the format of the CAN FD protocol to ensure that the data flows correctly into the CAN bus. The FD protocol extracts data, ensures that the data format and length meet the specification requirements, sends data through the virtual CAN node of the CANFD chip, ensures that the data flows to the correct CAN FD transceiver for further transmission to the CAN bus, follows the protocol and sends data using the CAN FD protocol format, ensuring the efficiency and accuracy of data transmission on the CAN bus.
[0109] The steps of obtaining CAN FD data received by the CAN FD transceiver and sending the data to the CAN FD bus include:
[0110] S601, obtaining CAN FD data;
[0111] S602, establishing a communication connection between the CAN FD transceiver and the CAN FD bus;
[0112] S603 . Convert the CAN FD data into electrical signals through the CAN FD transceiver, and send the electrical signals to the CAN FD bus.
[0113] As in the above steps S601 to S603, the CAN FD transceiver receives CAN FD data from the CAN bus. These data usually contain the format and content specified by the CAN FD protocol. To ensure that a reliable communication connection is established between the CAN FD transceiver and the CAN FD bus, it is usually necessary to configure appropriate hardware or software settings to ensure that data transmission proceeds normally. The CAN FD transceiver converts the received CAN FD data into electrical signals and sends them to the CAN FD bus. In the CAN bus system of the car, the CAN FD transceiver is responsible for receiving CAN FD data and ensuring the stability and reliability of the data. Once the data is received, the transceiver establishes a communication connection with the CAN FD bus to ensure that data can be transmitted between the two parties. Then, the transceiver converts the received CAN FD data into electrical signals and sends these signals to the CAN FD bus through the established communication connection. This ensures that the CAN FD transceiver can receive and process CAN FD data to perform corresponding control or diagnostic functions. By establishing a communication connection and data conversion, it is ensured that the CAN FD transceiver reliably transmits data to the CAN FD bus to avoid data loss or damage. Establishing a communication connection helps CAN The FD transceiver and the CAN FD bus achieve seamless data exchange, enabling the entire system to operate efficiently. By converting data into electrical signals and sending them to the controller, the accuracy and stability of the data during transmission are ensured to ensure the normal operation of the system functions.
[0114] And, a CAN FD conversion terminal using an RJ45 communication interface, comprising:
[0115] one or more processors;
[0116] a storage device having one or more programs stored thereon;
[0117] When one or more programs are executed by one or more processors, the one or more processors implement a CAN FD conversion method using an RJ45 communication interface.
[0118] The above is only a preferred embodiment of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principles of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention. The structures, devices and operating methods not specifically described and explained in the present invention shall be implemented according to the conventional means in the art unless otherwise specified and limited.
Claims
1. A CAN FD conversion method using an RJ45 communication interface, characterized in that: include: Obtaining an initialization command sent by the client to the server, wherein the initialization command includes a designated ECU device ID to be diagnosed and a specific electronic switch path selection command; The server side switches the server side electronic switch to the OBD interface network path that complies with the electronic switch path selection command according to the obtained initialization command, and generates a return response instruction; Obtaining a data packet, and according to the return response instruction generated by the server obtained by the client, sending the data packet to the ARM processor through the OBD interface network path that complies with the electronic switch path selection command; The ARM processor receives the data packet from the client and determines whether the data packet is correct; If the data packet is correct, it means that the data in the data packet is normal; If the data packet is incorrect, it indicates that the data in the data packet is abnormal, and an error code is generated and sent to the client; Get the CAN node virtualized by the CAN FD chip, convert the data in the data packet into the data format required by CAN FD, and send it to the CAN FD transceiver according to the CAN node virtualized by the CAN FD chip; Get the CAN FD data received by the CAN FD transceiver and send it to the CAN FD bus.
2. The CAN FD conversion method using the RJ45 communication interface according to claim 1, characterized in that: Before the step of obtaining the initialization command sent by the client to the server, the method includes: According to the Ethernet chip of the MDIO protocol, the MDIO protocol interface of the ARM processor is connected to the Ethernet chip; Through the TCP / IP protocol, the client establishes a communication connection with the server through the TCP / IP protocol.
3. The CAN FD conversion method using the RJ45 communication interface according to claim 2, characterized in that: The step of obtaining the initialization command sent by the client to the server includes: Obtaining an initialization command, wherein the initialization command includes a specified ECU device ID to be diagnosed and a specific electronic switch path selection command, namely, the ECU device to be diagnosed and the selected electronic switch path; The initialization command is sent to the server via TCP / IP protocol.
4. The CAN FD conversion method using the RJ45 communication interface according to claim 3, characterized in that: The server side switches the server side electronic switch to the OBD interface network path that complies with the electronic switch path selection command according to the acquired initialization command, and generates a step of returning a response instruction, including: The server receives and identifies the initialization command from the client, and identifies the electronic switch path selection command and the diagnostic ECU device ID; According to the electronic switch path selection command obtained by identification, the server switches the electronic switch to the OBD interface network adapted to the selected path and obtains a switching completion instruction; According to the switching completion instruction, the server generates a return response instruction and sends it to the client. The return response instruction includes communication parameters or status information.
5. The CAN FD conversion method using the RJ45 communication interface according to claim 1, characterized in that: The step of obtaining a data packet and sending the data packet to the ARM processor through the OBD interface network path that complies with the electronic switch path selection command according to the return response instruction generated by the server obtained by the client includes: Get the data packet; The client obtains the return response instruction; According to the return response command generated by the server obtained by the client, the OBD interface network path that meets the electronic switch path selection command will be selected; If the selected OBD interface network path does not match, it means that the selection fails, and then continue to select a matching OBD interface network path according to the electronic switch path selection command; If the selected OBD interface network path is consistent, it means that the selection is successful, and a communication connection between the client and the ARM processor in the server is established through the selected OBD interface network path; The data packet is sent to the ARM processor according to the OBD interface network path that complies with the electronic switch path selection command.
6. The CAN FD conversion method using the RJ45 communication interface according to claim 1, characterized in that: The data packet includes 2 bytes of custom data at the head, 4 bytes of valid length, valid data less than 4096 bytes and a tail check code.
7. The CAN FD conversion method using the RJ45 communication interface according to claim 6, characterized in that: The ARM processor receives a data packet from a client and determines whether the data packet is correct, including: Obtain standard evaluation data, wherein the standard evaluation data includes 2 bytes of custom data at the head, 4 bytes of valid length bits, and a tail check code; Get the 2-byte custom data at the head, 4-byte valid length and the checksum at the end of the data packet; Determine whether it is standard assessment data; If it is standard evaluation data, it means that the data in the data packet is normal; If it does not belong to the standard evaluation data, it indicates that the 2-byte custom data at the head, the 4-byte valid length bit, or the tail check code in the data packet is abnormal, and an error code is generated and sent to the client, and the client sends the data packet again.
8. The CAN FD conversion method using the RJ45 communication interface according to claim 1, characterized in that: The step of obtaining the CAN node virtualized by the CAN FD chip, converting the data in the data packet into the data format required by the CAN FD, and sending the data to the CAN FD transceiver according to the CAN node virtualized by the CAN FD chip includes: Through the virtual CAN node of the CAN FD chip, a communication connection is established; The data in the data packet is converted into a data format required by the CAN FD protocol, and CAN data is extracted from the data packet, wherein the CAN data includes valid data less than 4096 bytes; According to the CAN node virtualized by the CAN FD chip, the data in the data packet is converted into the data format required by CAN FD and then sent to the CAN FD transceiver.
9. The CAN FD conversion method using the RJ45 communication interface according to claim 8, characterized in that: The step of obtaining CAN FD data received by the CAN FD transceiver and sending the data to the CAN FD bus includes: Get CAN FD data; Establish a communication connection between the CAN FD transceiver and the CAN FD bus; The CAN FD data is converted into electrical signals by the CAN FD transceiver and sent to the CAN FD bus.
10. A CAN FD conversion terminal using an RJ45 communication interface, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the CAN FD conversion method using the RJ45 communication interface as described in any one of claims 1 to 9.
