CAN / LIN communication analysis method and equipment

By configuring the CAN/LIN communication device with 2 CAN interfaces, 2 LIN interfaces, and RS485 interface, automated testing was achieved, solving the problem of existing equipment relying on host computer software, improving testing efficiency and result consistency, and making it suitable for multi-parameter concurrency and dynamic scenario simulation of complex electronic systems.

CN120915686AActive Publication Date: 2025-11-07HEFEI GAUSS INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511440632.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-10
Publication Date
2025-11-07
Estimated Expiration
2045-10-10

AI Technical Summary

Technical Problem

Existing CAN/LIN communication testing equipment relies on host computer software, lacks automation capabilities, and cannot effectively coordinate with external devices. This results in manual intervention required for parameter setting, data acquisition, and status judgment during the testing process, leading to low testing efficiency and inconsistent results.

Method used

It adopts 2 CAN and 2 LIN interfaces, is configured with 8 GPIO ports and 4 PWM signal sources, and controls external devices through RS485 interface to realize automated testing. It supports user programming and dynamic adjustment of communication parameters to optimize testing efficiency.

Benefits of technology

It achieves a fully automated testing process, improves testing efficiency and result consistency, reduces manpower and time costs, and can handle multi-parameter concurrent testing and dynamic scenario simulation of complex electronic systems, providing stable and efficient testing assurance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120915686A_ABST
    Figure CN120915686A_ABST
Patent Text Reader

Abstract

The invention discloses a CAN / LIN communication analysis method. The method comprises the following steps of information collection, test script writing, script execution, CAN / LIN communication testing and product internal state information output. Two paths of CANs and two paths of LINs are adopted, a plurality of products can be tested at the same time, user programming is supported, related functions can be completed through simple programming, the test efficiency can be improved, field debugging and rapid product remodeling requirements can be met, an RS485 communication interface is arranged, external equipment or a power supply can be supported and controlled, the automatic test requirement is met, and the test efficiency is improved. All tests can be completed without depending on other main control equipment, rapid deployment on a production line is facilitated, meanwhile, four paths of PWM driving signal sources are arranged, an LED brush direct current motor can be conveniently driven, eight output ports and eight input ports are arranged, and all the ports can be controlled through programming.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present research belongs to the technical field of communication testing, and relates to a CAN / LIN communication analysis method and device. BACKGROUND

[0002] With the continuous progress of automotive electronics technology, CAN communication and LIN communication technology are increasingly widely applied, prompting a rapid growth trend in detection tools for these two communication protocols. However, the detection tools on the current market generally have a common limitation, i.e., they need to be installed with dedicated host computer testing software on a computer for operation, which affects the flexibility of product debugging and testing. In addition, most of the testing devices cannot communicate with external variable programmable power supplies.

[0003] The existing detection devices have poor external device cooperation capability. Most of the devices cannot establish effective communication connection with external variable programmable power supplies, which makes it difficult for the testing system to realize linkage control of power supply parameters and communication protocol testing. Even a few tools equipped with programmable power supply function can only provide very small current output, which cannot meet the power supply demand in complex testing scenarios, and cannot realize flexible control of external programmable power supplies through secondary programming, which makes it difficult to complete the dynamic adjustment of power supply parameters and the synchronous verification of communication performance testing in the testing process. In the implementation of automated testing, due to the lack of cooperative communication capability and programmable control interface with external devices, the parameter setting, data acquisition, state judgment and other links in the testing process often need manual intervention, and it is difficult to build a fully automated testing closed loop. This semi-manual mode not only greatly reduces the testing efficiency, but also easily affects the consistency and accuracy of the testing results due to human operation errors. In the face of increasingly complex testing scenarios and continuously improving precision requirements, the comprehensive performance of the existing testing method has been difficult to meet the actual demand. With the diversification of automotive electronic system functions, the testing dimensions of CAN and LIN communication protocols are continuously expanding, and the inherent defects of traditional tools in flexibility, cooperation and automation make them unable to cope with the demand for multi-parameter concurrent testing, dynamic scenario simulation and other needs, and cannot provide comprehensive and efficient testing guarantee for complex electronic systems. SUMMARY

[0004] The present application aims to solve the problems of existing CAN / LIN communication testing devices, such as dependence on host computer software, lack of automation capability, and inability to effectively cooperate with external devices. The centralized AI reasoning cannot easily collect information from distributed edge nodes, resulting in ineffective centralized schedulers, increased heterogeneity of hardware and services, increased complexity of topology optimization and graph merging strategies, significant scheduling complexity and delay of edge systems, and insufficient consideration of edge AI reasoning systems.

[0005] The object of the present application can be achieved by the following technical solutions. The application discloses a CAN / LIN communication analysis method, comprising the following steps: Information collection: complete LDF / DBC file analysis, obtain LIN / CAN message information, and initialize device drivers; Test script writing: complete test script writing according to the LIN / CAN message information collected above and use requirements; Script execution: perform communication testing on the CAN / LIN product, and realize obtaining GPIO input state, PWM output control, controlling external power supply, and controlling GPIO output state through multiple selection or selection or ignoring in the test script running, so as to feedback to the CAN / LIN communication testing link to assist the communication testing on the CAN / LIN product. The feedback mechanism optimizes communication efficiency by monitoring the GPIO input state in real time and dynamically adjusting the CAN / LIN message sending frequency.

[0006] CAN / LIN communication testing: send and receive the CAN / LIN message data generated by the communication testing on the CAN / LIN product, and analyze the CAN / LIN message data; Output product internal state information: obtain internal state parameters representing the actual operation condition of the CAN / LIN product according to the analyzed CAN / LIN message data, including whether the CAN / LIN product can process the received command, whether self-learning is normal, whether the internal voltage and temperature are normal, and motor position information.

[0007] Preferably, the LIN / CAN message information includes message length, signal name in the message, signal size, signal offset position, and message delay time.

[0008] Preferably, the LIN / CAN message information is displayed on the screen in an array manner, facilitating real-time observation of signals.

[0009] Preferably, when the LDF file is analyzed, the information collection further comprises: obtaining a version parameter of a LIN protocol in the LDF file, providing a check basis for the LIN message; Obtaining a communication baud rate parameter in the LDF file, initializing and setting the LIN physical layer. Meanwhile, the communication baud rate parameter is saved into the LIN message information data.

[0010] Preferably, the LIN protocol version parameter uses LIN1.3 and LIN1.3 and below versions, and the message check uses a classic check. If the LIN protocol version uses 2.0 and above versions, the message check uses an enhanced check, but the diagnostic message remains the classic check. The classic check does not check the message ID, but only checks the data field of the message. The enhanced check checks the message ID and the data field. The check method is to add each byte of the check object with a carry (when the result is greater than or equal to 256, subtract 255), and take the final sum bit by bit to get the result as the check sum to be sent. The receiver checks the received data according to the check sum type, and the final sum is not taken bit by bit. The final sum and the received check sum are added, and if the result is 0xFF, the check sum is correct, which ensures the correctness of data transmission to a certain extent. At the same time, the LIN protocol version parameter is saved to the message information data.

[0011] Preferably, when testing LIN product components, the corresponding LIN command message is sent. The LIN product component receives the message and executes the corresponding command. If the internal parameters of the LIN product component are to be obtained, the header of the LIN product component feedback message needs to be sent first, and then the LIN product component message data field is received. After the reception is completed, the message data is combined with the LDF file for data analysis to obtain the internal state and parameters of the component, and the corresponding signal value is displayed on the screen, facilitating the user to understand the actual condition of the product.

[0012] Preferably, when testing CAN product components, the corresponding CAN command message is sent. The CAN product component receives the message and executes the corresponding command. When the CAN product component feedback message is received, it is combined with the DBC file for analysis to obtain the internal state parameters of the CAN product component, and the corresponding signal value is displayed on the screen to help the user understand the actual condition of the product.

[0013] An electronic device includes a memory, a processor, and a PWM power supply, a computer program stored on the memory and executable on the processor, and the processor executes the computer program to implement the CAN / LIN communication analysis method.

[0014] Preferably, the electronic device is configured with 8 input GPIO ports and 8 output GPIO ports, 2-way CAN, and 2-way LIN. According to the product testing needs, the corresponding process control signals are replaced by PLC, and the corresponding test result indication or state indication is replaced by PLC. The electronic device is configured with 4-way PWM output signals, and can be powered by 5V and 12V as needed, and the PWM signals can provide PWM signal sources for LED lamps, DC brush motors and the like.

[0015] By the above technical scheme, the application provides a CAN / LIN communication analysis method and device, which has at least the following beneficial effects: The application adopts 2-way CAN and 2-way LIN, can simultaneously test multiple products, supports user programming, can complete related functions through simple programming, can improve test efficiency, is convenient for on-site debugging and rapid product change requirements, is provided with an RS485 communication interface, can support control of external equipment or power supply, realizes automatic test requirements, can complete all tests without relying on other host devices, is convenient for rapid deployment on production lines, is provided with 4-way PWM driving signal sources, can conveniently drive LED\brush DC motors, and is provided with 8 output ports and 8 input ports, all of which can be controlled through programming; By optimizing the cooperative communication capability of the device and setting a standardized programmable control interface, the application realizes full automation of parameter setting, data acquisition, state judgment and other links in the test process, and can complete the entire test process without manual intervention, which completely changes the disadvantages of the traditional semi-manual mode, significantly improves test efficiency, reduces test result deviation caused by human operation errors, guarantees consistency and precision of test results in different batches and different scenarios, reduces labor and time costs, and provides reliable support for large-scale and high-frequency test requirements; In view of the CAN and LIN communication protocol test dimension expansion problem caused by the functional diversification of the automotive electronic system, the application has the advantages of flexibility, cooperation and automation, and can easily cope with complex test requirements such as multi-parameter concurrent testing and dynamic scene simulation, whether it is simulating power fluctuations, communication load changes and other dynamic scenes in vehicle operation, or performing concurrent testing of multiple protocols and multiple nodes, the application can provide stable and efficient test guarantee, and provides comprehensive technical support for the research and verification of complex electronic systems, and helps to improve the reliability and safety of the automotive electronic system. BRIEF DESCRIPTION OF DRAWINGS

[0016] The drawings described herein are used to provide further understanding of the application, constitute a part of the application, the illustrative embodiments of the application and the description thereof are used to explain the application, and do not constitute an improper limitation on the application. In the drawings: Figure 1 It is a principle framework diagram of the CAN / LIN communication analysis method in the application; Figure 2 It is a scene schematic diagram of the application for testing a vehicle; Figure 3 The scene diagram for the actual test of a single component in the present application; Figure 4 The interface and components of the test device in the present application are shown in the diagram; Figure 5 The display diagram of the message signal array in the present application. DETAILED DESCRIPTION

[0017] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0018] Please refer to Figure 1 The present embodiment proposes a CAN / LIN communication analysis method, which is divided into the steps of information collection, test script writing, script execution, CAN / LIN communication testing, and output of product internal state information. The device has 2-way CAN and 2-way LIN interfaces, supports user programming, can control external devices through RS485, and realizes automatic testing. It is provided with 4-way PWM signal source and 16 GPIO ports, which can drive LED and brush DC motor, and is suitable for rapid deployment on production line. Specifically as follows: Information collection: complete LDF / DBC file analysis, obtain LIN / CAN message information, and initialize device driver processing; Test script writing: complete test script writing according to the collected LIN / CAN message information and use requirements (such as atmosphere lamp test, motor test, door handle product test, etc.); Script execution: perform communication testing on CAN / LIN products, and manually select multiple or one or directly ignore to execute the following operations in the test script running, including obtaining GPIO input state, PWM output control, controlling external power supply, controlling GPIO output state, etc. to feedback to the CAN / LIN communication testing link to assist the communication testing of CAN / LIN products. The feedback mechanism adjusts the CAN / LIN message sending frequency dynamically by monitoring the GPIO input state in real time, thereby optimizing the communication efficiency.

[0019] CAN / LIN communication testing: send and receive CAN / LIN message data generated by CAN / LIN product communication testing, and analyze CAN / LIN message data; Output product internal state information: according to the parsed CAN / LIN message data, internal state parameters are obtained to represent the actual running state of the CAN / LIN product, including whether the CAN / LIN product can process the received command, whether self-learning is normal, whether the internal voltage and temperature are normal, and the position information of the motor of the motor product.

[0020] The application can load the LDF / DBC file of the vehicle parts, and when the LDF / DBC file is loaded, the LDF / DBC file stored in the U disk or the device is linked first, and then the format of the LDF / DBC file is obtained. The LIN / CAN message information includes the ID of the message, the length of the message, the signal name in the message, the size of the signal and the signal offset position, the message delay time, and is saved in the corresponding message information data, and the signal acquisition of the message is completed. As long as the data is read or written, it is equivalent to reading or writing the message.

[0021] Please refer to Figure 5 According to actual needs, the user can click the icon in front of the message name, and the signals in the message will be displayed in an array on the screen, which is convenient for real-time observation. For the message sent by the device, there is a pen-shaped icon behind it, which means that the signal value can be edited, that is, the signal value is set by using the keyboard input mode. After the signal value is set, the message will be updated immediately, sent to the bus, and displayed on the corresponding data bar. For the message received by the device, when the device receives the corresponding message, the data will be displayed in the corresponding data bar. According to actual needs, the actual situation of each signal value in the message can be viewed by clicking the icon in front of the message name.

[0022] When the LDF file is parsed, the information collection further includes: obtaining the version parameter of the LIN protocol in the LDF file to provide a check basis for the LIN message, obtaining the communication baud rate parameter in the LDF file to initialize the LIN physical layer. At the same time, the communication baud rate parameter is saved to the message information data.

[0023] The LIN protocol version parameters used are LIN 1.3 and earlier versions, employing classic checksum verification. If the LIN protocol version is 2.0 or later, enhanced checksum verification is used. However, diagnostic messages retain classic checksum verification. Classic checksum verification only checks the data field, not the message ID. Enhanced checksum verification checks both the message ID and the data field. The verification method involves performing binary addition with carry on each byte of the checksum object (subtracting 255 whenever the result is greater than or equal to 256), and then inverting each bit of the final sum. This result is used as the checksum to be sent. The receiver performs the same binary addition with carry on the received data, without inverting each bit of the final sum, and adds this final sum to the received checksum. If the result is 0xFF, the checksum is correct, which to some extent ensures the correctness of data transmission. The LIN protocol version parameters are also saved in the message information data.

[0024] When sending a LIN message, first copy the message ID and data field into the transmission data buffer, then call the LIN message sending main function to send the LIN message onto the bus.

[0025] When sending a CAN message, first copy the message ID and data field into the transmission data buffer, then call the CAN message sending main function to send the CAN message onto the bus.

[0026] For LIN product testing, if this device only sends the header and needs to receive the data in the feedback message, it first sends the header and then immediately enters the data receiving state. Once the feedback message data has been received, it verifies the data. If the data verification is successful, a successful reception flag is set, indicating a message update task and a new message requiring processing. This updates the data field associated with the message on the screen. If needed, this can be done by clicking the button before the message name. The system retrieves the corresponding signal bit field from the relevant byte, assigns it to the LIN signal, and updates the signal value associated with the message on the screen. Users can also perform some logical applications based on the received message data.

[0027] When this device receives a CAN product feedback message, it will update the data field associated with that message on the screen. If needed, you can click on the area in front of the message name. The icon will extract the corresponding signal bit field from the byte, assign it to the CAN signal, and update the signal value associated with the message on the screen. Users can also perform some logical applications based on the received message data.

[0028] In this embodiment, the LIN message sending entry main function is: voID mlinTask Func(u8 linx,mlinFrameMode_Def Task_t) { if(Lin Mode[linx] == Maste_Mode) { switch(Task_t) { case mNo Task: break case mx Header: mLin Task[linx]:mTx Header i Lin sendBreak(linx); break case mx Message: mLin Task[linx] = mTx Message; / ****calculate checksum**** / Erm mDatallinxl[len mData[linx,+1] = lin checksum(linx, FrmmDatallinxl,len mDatallinx1); Lin sendBreak(linx); Break } } } The Break field, synchronization signal, message ID, data field, and checksum are sent sequentially. After each transmission is completed, the interrupt function is entered. In the interrupt function, you only need to set the byte value to be sent next.

[0029] The main function for sending CAN messages is: voID CAN TxMessageHandle(u8 *msg) { u8 i; u8 mbox; CAN ArbitrationControlField _Def CAN ACF; CanTxMsg TxMessage; CAN_ACF.Byte[O] = msg[l]; TxMessage.IDE = CAN ACF.Bits.IDE; TxMessage.RTR = CAN ACF.Bits.RTR; TxMessage.DLC = CAN ACF.Bits.dlc; if(CAN _ACF.Bits.IDE == STANDARD_ID) ( TxMessage.StdID = (uint32_t) (msg[2]<<8) + (uint32_t) (msg[3]<<0); ) else( TxMessage.ExtID = (uint32_t) (msg[2]<<24) + (uint32_t) (msg[3]<<16) +\ (uint32_t) (msg[4]<<8) + (uint32_t) (msg[5]<<0); } if(CAN ACF.Bits.RTR == DATA_FRAME) { if(CAN _ACF.Bits.IDE == STANDARD_ID) { for(i=0,i<TxMessage.DLC;i++){ TxMessage.Data[i] = msg[5+i]; } } Else{ for(i=O;i<TxMessage.DLC;i++){ TxMessage.Data[i] = msg[7+i]; } } } if(CAN ACF.Bits.chanSel == 0) { mbox= CAN_Transmit (CAN1, &TxMessage); } else if (CAN_ACF.Bits.chanSel == 1) { mbox = CAN_Transmit(CAN2, TxMessage); } } When CAN message is written into CAN transmit register, the hardware will complete the message sending task.

[0030] As shown in Figure 2 , as a real vehicle application test application scenario: according to the needs, the CAN / LIN bus message can be monitored, and after message analysis, the signal value is displayed on the screen; the CAN / LIN bus message can be recorded and played back, which is convenient for detailed analysis of the message later; diagnostic messages can be sent to obtain product information of product parts, such as part number, software version number, etc.

[0031] Please refer to Figure 3 , when testing LIN product parts, send the corresponding LIN command message, and the LIN product parts execute the corresponding command after receiving the message. If you want to get the internal parameters of the LIN product parts, you need to send the header of the LIN product parts feedback message first, and then start receiving the LIN product parts message data field. When the receiving is completed, the message data is combined with the LDF file for data analysis to obtain the internal state parameters of the LIN product parts, and the corresponding signal value is displayed on the screen, which is convenient for users to understand the actual situation of the product.

[0032] Users can also monitor or record bus messages according to their needs, play back messages or analyze messages in detail to understand the actual situation of the product during testing.

[0033] Users can also send diagnostic messages according to their needs to obtain product information of product parts, such as part number, software version number, etc., or other diagnostic services.

[0034] The product has an RS485 communication interface, supports Modbus communication protocol, and users can write scripts according to actual needs to set the voltage and current of external programmable power supply. The voltage value can be set first, or the current value can be set first. The command message for external power supply setting contains the address of external power supply device and the address of target register, as well as the target voltage value or current value. If you want to know the parameters of the external power supply, you can send the corresponding read command message to read the status parameters of the external power supply, so as to judge whether the external power supply is set successfully or the actual use situation.

[0035] If it is necessary to test the working condition of the product under different voltages, the voltage and current size can be changed according to time or events, etc., to realize automatic testing.

[0036] When the tested is a CAN product component, the corresponding CAN command message is sent, the CAN product component receives the message and executes the corresponding command, when the CAN product component feedback message is received, the DBC file is parsed to obtain the internal state parameters of the CAN product component, and the corresponding signal value is displayed on the screen to help the user understand the actual condition of the product.

[0037] The embodiment also provides an electronic device, including a memory, a processor and a PWM power supply, a computer program stored on the memory and executable on the processor, and the processor executes the computer program to realize the CAN / LIN communication analysis method provided in the embodiment.

[0038] The electronic device is configured with 8 input GPIO ports and 8 output GPIO ports, 2-way CAN and 2-way LIN, according to the product test needs, the corresponding process control signals are replaced by PLC, and the corresponding test result indication or state indication is replaced by PLC. And the electronic device is configured with 4-way PWM output signal, and can be needed, PWM power supply is provided with 5V and 12V two kinds, these PWM signals can provide PWM signal source for LED lamp, direct current brush motor and the like, the electronic device is also provided with 2-way CAN, 2-way LIN; As Figure 4 shown, it is an interface and component expansion diagram of the electronic device, wherein: A is a capacitive touch display screen: realizing monitoring and control of the device, human-computer interaction between the user and the device; B is a device rear side plate interface schematic diagram, which includes the following port components: The DC power input end 1 provides working power for the device, uses a 2PIN wiring terminal, and the model is KF2EDGRC-5.08 2P.

[0039] The external programmable power supply control end 2 uses an RS485 communication mode for communication, can be used to set the voltage and maximum current of the external power supply, and can also read the internal working condition of the external programmable power supply. A 3PIN wiring terminal is used, and the model is KF2EDGRC-5.08 3P.

[0040] The DB25 male terminal 3 has the internal pin function definition as shown in Table 1: Table 1 Internal pin function definition of DB25 male terminal The device includes two-way CAN, two-way LIN, an external power input end and 8 input ports.

[0041] C: Device front side plate interface diagram, which contains the following port components: DB15 male terminal 10: its internal pin function definition is shown in Table 2: Table 2 Internal pin function definition of DB15 male terminal Serial communication port 11, using USB Type-c terminal, can be used with terminal software to perform necessary software debugging.

[0042] OTG interface 12, using USB Type-c terminal.

[0043] USB interface 13, the number is 2, any one can be used to import LDF file or internal software upgrade.

[0044] Ethernet interface 14, connect to the network, and perform remote assistance operation.

[0045] D is the device right side plate component diagram, which contains the following components: 2-position dial switch 4, ON indicates that the device CAN bus is connected with 120 ohm resistor, OFF indicates that no 120 ohm terminal resistor is used.

[0046] Power indicator 5; lin1 working indicator 6; lin0 working indicator 7; CAN1 working indicator 8; CAN0 working indicator 9.

[0047] The device can test multiple products at the same time, support user programming, and complete related functions through simple programming, which can improve test efficiency, facilitate on-site debugging and product quick change requirements, and has RS485 communication interface, which can support control external equipment or power supply, realize automatic test requirements, and complete all tests without relying on other host devices, which is convenient for rapid deployment on production line. At the same time, 4-way PWM drive signal source is provided, which can conveniently drive LED\brushed DC motor, and 8 output ports and 8 input ports are provided, all of which can be controlled by programming.

[0048] The above embodiments can be realized by software, hardware, firmware or any combination thereof, in whole or in part. When realized by software, the above embodiments can be realized in the form of computer program product in whole or in part. Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in the present text can be realized by electronic hardware or combination of computer software and electronic hardware. Whether the functions are realized by hardware or software depends on the specific application and design constraints of the technical solutions.

[0049] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, which may be located in one place, or distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0050] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.

Claims

1. A CAN / LIN communication analysis method, characterized by, The method comprises the following steps: Information collection: complete LDF / DBC file parsing, and obtain LIN / CAN message information; Test script writing: complete test script writing according to the collected LIN / CAN message information and use requirements; Script execution: perform communication testing on the CAN / LIN product, and obtain the GPIO input state, PWM output control, control external power supply, and control GPIO output state through multiple selection, selection or ignoring in the test script running, so as to feedback to the CAN / LIN communication testing link to assist the communication testing on the CAN / LIN product; CAN / LIN communication testing: send and receive the CAN / LIN message data generated by the communication testing on the CAN / LIN product, and parse the CAN / LIN message data; Output product internal state information: obtain the internal state parameters representing the actual operation status of the CAN / LIN product according to the parsed CAN / LIN message data, including whether the CAN / LIN product can process the received command, whether self-learning is normal, whether the internal voltage and temperature are normal, and the position information of the motor.

2. The CAN / LIN communication analysis method according to claim 1, characterized in that, The LIN / CAN message information comprises message length, signal name in the message, signal size, signal offset position, and message delay time.

3. The CAN / LIN communication analysis method according to claim 2, characterized in that, The LIN / CAN message information is displayed on the screen in an array manner.

4. The CAN / LIN communication analysis method according to claim 1, characterized in that, When the LDF file is parsed, the information collection further comprises: Obtain the LIN protocol version parameter in the LDF file; Obtain the communication baud rate parameter in the LDF file, initialize the LIN physical layer, and save the communication baud rate parameter to the message information data.

5. The CAN / LIN communication analysis method according to claim 4, characterized in that, The LIN protocol version parameter uses LIN1.3 and versions below LIN1.3, and the message check adopts a classic check. If the LIN protocol version uses the 2.0 version and versions above the 2.0 version, the message check adopts an enhanced check. The classic check keeps the classic check for the diagnostic message, and does not check the message ID, but checks only the data field of the message. The enhanced check checks the message ID and the data field, and the check method is as follows: each byte of the check object is subjected to a carry binary addition, and the final sum is taken bit by bit to obtain a result, which is taken as the check sum to be sent. The receiver performs the same carry binary addition on the received data, and the final sum is not taken bit by bit to obtain a result. The final sum and the received check sum are added, and if the result is 0xFF, the check sum is correct.

6. The CAN / LIN communication analysis method according to claim 1, characterized in that, When testing the LIN product components, the corresponding LIN command message is sent. After the LIN product components receive the message, the corresponding command is executed. If the internal parameters of the LIN product components are to be obtained, the header of the LIN product component feedback message needs to be sent first, and then the LIN product component message data field is received. After the reception is completed, the message data is combined with the LDF file for data analysis, the internal state parameters of the LIN product components are obtained, and the corresponding signal values are displayed on the screen.

7. The CAN / LIN communication analysis method according to claim 1, characterized in that, When testing the CAN product components, the corresponding CAN command message is sent, the CAN product components receive the message and execute the corresponding command, when receiving the CAN product component feedback message, the DBC file is parsed to obtain the internal state parameters of the CAN product components, and the corresponding signal values are displayed on the screen.

8. An electronic device, comprising: The CAN / LIN communication analysis method comprises a memory, a processor and a PWM power supply, a computer program stored on the memory and executable on the processor, and the processor executes the computer program to implement the CAN / LIN communication analysis method according to any one of claims 1 to 7.

9. The electronic device of claim 8, wherein, The electronic device is configured with 8 input GPIO ports and 8 output GPIO ports, 2-way CAN and 2-way LIN, and replaces PLC to give corresponding process control signals and corresponding test result indications or state indications. The electronic device is configured with 4-way PWM output signals, the PWM power supply is provided with 5V and 12V, the 4-way PWM output signals are LED lights, and the PWM signal source is provided through a direct-current brush motor.

Citation Information

Patent Citations

  • Method and tool for automatically generating automatic test script of automobile instrument

    CN110543300A

  • Controller CAN signal test method and system

    CN116389314A

  • CAN checksum script automatic generation method and device, equipment and storage medium

    CN118409915A

  • Vehicle-mounted multi-communication protocol test mainboard

    CN120200949A