Method and device for testing consistency of physical layer of CAN (Controller Area Network) bus
By connecting the computer and the oscilloscope, the application software is used to automatically control the oscilloscope to conduct the CAN bus physical layer consistency test, which solves the problem of low test efficiency in the existing technology and achieves more efficient and accurate test result processing.
Patent Information
- Application Number
- CN202310185057.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2024-08-27
AI Technical Summary
The existing CAN bus physical layer consistency test is not efficient. Testers need to manually control the oscilloscope and manually organize the data, which takes a long time.
By connecting the computer and the oscilloscope, starting the application software, obtaining the user interface, sending test instructions to the oscilloscope, controlling it to complete the CAN bus physical layer consistency test, and receiving and analyzing the test data to generate a test report, the test process is simplified.
It improves the efficiency and accuracy of CAN bus physical layer consistency testing and data processing analysis, and reduces the tediousness of manual operations.
Smart Images

Figure CN118555232A
Abstract
Description
Technical Field
[0001] The invention belongs to the field of electronic information technology, and in particular relates to a CAN bus physical layer consistency test method and a device thereof. Background Art
[0002] The Controller Area Network (CAN) was developed by BOSCH, a German company known for its R&D and production of automotive electronic products, and eventually became an international standard. It is one of the most widely used fieldbuses in the world. In North America and Western Europe, the CAN bus protocol has become the standard bus for automotive computer control systems and embedded industrial control local area networks, and has a J1939 protocol designed for large trucks and heavy machinery vehicles with CAN as the underlying protocol. The CAN bus can be divided into the physical layer, data link layer, network layer, transport layer, session layer, presentation layer and application layer, and the physical layer of the CAN bus defines the relevant media and interfaces connecting the various controllers in the car.
[0003] At present, the operation and data processing method for the CAN bus physical layer consistency test is mainly to manually operate the oscilloscope for testing, and then copy and organize the test data into a table, which causes the test personnel to spend more time on oscilloscope operation and data recording. Summary of the invention
[0004] The invention provides a CAN bus physical layer consistency test method and device thereof, so as to solve the problem that the existing CAN bus physical layer consistency test efficiency is low.
[0005] In order to solve the above technical problems, the present invention proposes a CAN bus physical layer consistency test method, comprising: connecting a computer and an oscilloscope, starting application software installed on the computer, and obtaining the user interface of the software; starting the test, outputting a test instruction to the oscilloscope through the computer, and controlling the oscilloscope to complete the test operation of the CAN bus physical layer consistency of the chip to be measured; receiving the test data transmitted by the oscilloscope, and organizing and analyzing the data to generate a CAN bus physical layer consistency test report.
[0006] Optionally, connecting a computer and an oscilloscope, starting application software installed on the computer, and obtaining a user interface of the software includes: connecting the computer and a LAN interface of the oscilloscope via a network cable; connecting the oscilloscope and a test point of the device under test via a probe; and starting the application software in the computer and opening the user interface.
[0007] Optionally, the startup test, outputting a test instruction to the oscilloscope through the computer, controls the oscilloscope to complete a test operation of the physical layer consistency of the CAN bus, including: receiving a startup test instruction input by a user through a start test button in the user interface; sending a test instruction to the oscilloscope, and controlling the oscilloscope to perform a test operation according to the test instruction.
[0008] Optionally, sending a test instruction to the oscilloscope and controlling the oscilloscope to perform a test operation according to the test instruction includes: the computer sends an instruction to start initialization of the oscilloscope and controls the oscilloscope to complete the initialization operation; the computer sends an instruction to set the scale value and controls the oscilloscope to complete the operation of adjusting the range; the computer sends instructions for various test items and controls the oscilloscope to perform data recording operations; the computer sends an instruction to start measurement and controls the oscilloscope to measure the consistency of the physical layer of the CAN bus.
[0009] Optionally, the receiving of the test data transmitted by the oscilloscope includes: the computer sending a return measurement data instruction to the oscilloscope; and after the oscilloscope responds to the return measurement data instruction, recording various test data generated by measuring the consistency of the physical layer of the CAN bus.
[0010] Optionally, the receiving of the test data transmitted by the oscilloscope and the sorting and analysis to generate a CAN bus physical layer consistency test report includes: obtaining and storing the measurement data of various CAN bus physical layer consistency of the oscilloscope; analyzing and processing the measurement data of various CAN bus physical layer consistency; and summarizing and generating a CAN bus physical layer consistency test report.
[0011] Optionally, the analysis and processing of the measurement data of the physical layer consistency of each CAN bus includes: comparing the test data of the physical layer consistency of each CAN bus with its standard data to determine whether the requirements are met: if the requirements are met, the data is filled in the specified position of the document and a qualified judgment is given; if the requirements are not met, the data is filled in the specified position of the document and an unqualified judgment is given; the application software analyzes and processes the data in the document according to the comparison results.
[0012] Based on the same inventive concept, the present invention also proposes a CAN bus physical layer consistency test device, which includes: a test preparation unit, which is used to connect a computer and an oscilloscope, start the application software installed on the computer, and obtain the user interface of the software; a test unit, which is used to start the test, output the test instructions to the oscilloscope through the computer, and control the oscilloscope to complete the test operation of the CAN bus physical layer consistency; a report generation unit, which is used to receive the test data transmitted by the oscilloscope, and organize and analyze the test data to generate a CAN bus physical layer consistency test report.
[0013] The present invention also proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the electronic device is characterized in that when the processor executes the program, any one of the methods described above is implemented.
[0014] The present invention also proposes a computer storage medium, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to execute any one of the methods described above.
[0015] From the above description, it can be seen that the beneficial effect of the technical solution provided by the present invention is: the CAN bus physical layer consistency test method includes: connecting a computer and an oscilloscope, starting the application software installed on the computer, and obtaining the user interface of the software; starting the test, outputting a test instruction to the oscilloscope through the computer, and controlling the oscilloscope to complete the test operation of the CAN bus physical layer consistency of the chip to be measured; receiving the test data transmitted by the oscilloscope, and collating and analyzing it to generate a CAN bus physical layer consistency test report, which can improve the efficiency and accuracy of the CAN bus physical layer consistency test and related data processing and analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 A schematic diagram of a flow chart of a CAN bus physical layer consistency test method in an embodiment of the present invention;
[0018] Figure 2 A schematic diagram of hardware device connection of a CAN bus physical layer consistency test method in an embodiment of the present invention;
[0019] Figure 3 for Figure 1 A schematic flow chart of step S12 in FIG.
[0020] Figure 4 for Figure 1 A schematic diagram of the process of step S13 in FIG.
[0021] Figure 5 A schematic diagram of the structure of a CAN bus physical layer consistency test device in an embodiment of the present invention;
[0022] Figure 6The figure is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0024] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present invention should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present invention do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0025] The embodiment of the present invention provides a CAN bus physical layer consistency test method, such as Figure 1 As shown, the CAN bus physical layer consistency test method process includes:
[0026] Step S11: connecting a computer and an oscilloscope, starting application software installed on the computer, and obtaining a user interface of the software.
[0027] Optionally, in step S11, first connect the computer to the LAN interface of the oscilloscope via a network cable. Specifically, first connect the hardware devices, connect the computer to the LAN interface of the oscilloscope via a network cable, and then observe whether the indicator light at the interface end of the network cable is normal. If it is abnormal, check the quality of the interface and the network cable. Then connect the oscilloscope to the test point of the device under test through a probe, that is, connect one end of the probe to the oscilloscope, and connect the other end of the probe to the test point of the device under test. Finally, start the application software in the computer and open the user interface. Install the application software in the computer, open the executable file of the software to enter the user interface of the software. The device connection in the embodiment of the present invention is as follows Figure 2 As shown, the hardware devices include a computer, an oscilloscope, a network cable, a probe and a device under test. The computer is connected to the oscilloscope through a network cable. The oscilloscope tests the device under test through the probe and transmits the measured data back to the computer.
[0028] The CAN bus physical layer consistency test process of the embodiment of the present invention uses a development environment built by python to write a console application program. It is a CAN bus physical layer consistency test used in single-board hardware white box testing. The VISA library in the standard I / O function library is used to establish a session between the computer and the oscilloscope to achieve communication between the computer and the oscilloscope. The VISA library is a standard I / O function library. The database provides a unified device resource management, operation and use mechanism, is independent of hardware devices, interfaces, operating systems and programming languages, has the characteristics of being independent of hardware structure, and is applicable to any bus mode. Therefore, it has good applicability.
[0029] Step S12: start the test, output the test instruction to the oscilloscope through the computer, and control the oscilloscope to complete the test operation of the CAN bus physical layer consistency of the chip to be measured.
[0030] After the communication between the computer and the oscilloscope is successfully established, the computer sends the completed control instruction program to the oscilloscope to control the oscilloscope to perform a series of automated tests.
[0031] like Figure 3 As shown, step S12 includes the following steps:
[0032] Step S121: receiving a test start instruction input by a user through a start test button in the user interface.
[0033] The user selects the corresponding test function in the user interface: clicks the corresponding start test button in the user interface, so that the computer can send specific test instructions to the oscilloscope through the LAN interface.
[0034] Step S122: Sending a test instruction to the oscilloscope, and controlling the oscilloscope to perform a test operation according to the test instruction.
[0035] The oscilloscope identifies the various test instructions received from the computer and automatically executes the operations represented by the instructions. Optionally, the computer sends an instruction to start the initialization of the oscilloscope, and controls the oscilloscope to complete the initialization operation. The computer sends an instruction for the scale calibration value to control the oscilloscope to complete the operation of adjusting the range, wherein the scale calibration value includes a vertical scale calibration value and a horizontal scale calibration value, so that the oscilloscope can process a reasonable range. The computer sends instructions for various test items to control the oscilloscope to perform data recording operations. The computer sends an instruction to start measurement to control the oscilloscope to measure the consistency of the physical layer of the CAN bus.
[0036] After the test operation is completed, the oscilloscope returns the measured data information to the computer.
[0037] Step S13: receiving the test data transmitted by the oscilloscope, and collating and analyzing the test data to generate a CAN bus physical layer consistency test report.
[0038] Optionally, the receiving of the test data transmitted by the oscilloscope includes: the computer sending a return measurement data instruction to the oscilloscope; and after the oscilloscope responds to the return measurement data instruction, recording various test data generated by measuring the consistency of the physical layer of the CAN bus.
[0039] like Figure 4 As shown, step S13 includes the following steps:
[0040] Step S131: obtaining and storing measurement data of various CAN bus physical layer consistency from an oscilloscope.
[0041] After the test is completed, the computer obtains various test data sent back by the oscilloscope. The measurement data of the CAN bus physical layer consistency include the CAN bus differential recessive voltage, the CAN bus differential dominant voltage, the CAN_diff (CAN_H-CAN_L) value, the maximum voltage value of CAN_H and VCAN_L, the minimum voltage value of CAN_H and VCAN_L, the recessive output voltage VCAN_H, the recessive output voltage VCAN_L, the dominant output voltage VCAN_H, the dominant output voltage VCAN_L and other data.
[0042] Step S132: Analyze and process the measurement data of the physical layer consistency of each CAN bus.
[0043] The computer organizes and analyzes the returned CAN bus physical layer consistency test data to determine whether the data meets the requirements. The computer analyzes the data to determine whether it meets the requirements and imports the data and judgment results into the corresponding record table.
[0044] Optionally, the analyzing and processing of the measurement data of the physical layer consistency of each CAN bus includes:
[0045] Compare the test data of each CAN bus physical layer consistency with its standard data to determine whether it meets the requirements:
[0046] If the requirements are met, the data is filled into the specified location of the document and a qualified judgment is given;
[0047] If the requirements are not met, fill in the data in the designated location of the document and give a judgment of unqualified;
[0048] The application software analyzes and processes the data in the document based on the comparison results.
[0049] Step S133: Summarize and generate a CAN bus physical layer consistency test report.
[0050] The computer generates a CAN bus physical layer consistency test report based on the result of the measurement data analysis of each CAN bus physical layer consistency in step S132, combined with the standard values of each test and the actual situation.
[0051] The CAN bus physical layer consistency test method in the embodiment of the present invention connects a computer and an oscilloscope, starts the application software installed on the computer, and obtains the user interface of the software; starts the test, outputs the test instructions to the oscilloscope through the computer, and controls the oscilloscope to complete the test operation of the CAN bus physical layer consistency of the chip to be measured; receives the test data transmitted by the oscilloscope, and organizes and analyzes it to generate a CAN bus physical layer consistency test report. It can establish communication between the computer and the oscilloscope, and control the computer to send corresponding control instructions to the oscilloscope to control the oscilloscope to automatically test the quality of digital signals, obtain test data, and transmit the test data back. The computer then analyzes and processes the data, which simplifies the cumbersome operation required for manual testing in traditional methods.
[0052] Based on the same inventive concept, the embodiment of the present invention also provides a CAN bus physical layer consistency test device, such as Figure 5 As shown, the device includes: a test preparation unit, which is used to connect a computer and an oscilloscope, start the application software installed on the computer, and obtain the user interface of the software; a test unit, which is used to start the test, output the test instructions to the oscilloscope through the computer, and control the oscilloscope to complete the test operation of the CAN bus physical layer consistency; a report generation unit, which is used to receive the test data transmitted by the oscilloscope, and perform sorting and analysis to generate a CAN bus physical layer consistency test report. The CAN bus physical layer consistency test device can determine whether the CAN bus physical layer data meets the requirements, and import the data and the judgment results into the corresponding record table, which improves the efficiency of testing and data analysis and sorting.
[0053] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any one of the above embodiments when executing the program.
[0054] Figure 6 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 601, a memory 602, an input / output interface 603, a communication interface 604, and a bus 605. The processor 601, the memory 602, the input / output interface 603, and the communication interface 604 are connected to each other in communication within the device through the bus 605.
[0055] The processor 601 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present invention.
[0056] The memory 602 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 602 may store an operating system and other application programs. When the technical solution provided by the embodiment of the present invention is implemented by software or firmware, the relevant program code is stored in the memory 602 and is called and executed by the processor 601.
[0057] The input / output interface 603 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.
[0058] The communication interface 604 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0059] The bus 605 includes a path for transmitting information between various components of the device (eg, the processor 601 , the memory 602 , the input / output interface 603 , and the communication interface 604 ).
[0060] It should be noted that, although the above device only shows the processor 601, the memory 602, the input / output interface 603, the communication interface 604 and the bus 605, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present invention, and does not necessarily include all the components shown in the figure.
[0061] Based on the same inventive concept, an embodiment of the present invention further provides a computer storage medium, in which at least one executable instruction is stored, and the executable instruction enables a processor to execute the method described in any of the above embodiments.
[0062] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present invention as described above, which are not provided in detail for the sake of simplicity.
[0063] The embodiments of the present invention are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the scope of protection of this disclosure.
Claims
1. A CAN bus physical layer consistency test method, characterized in that: The CAN bus physical layer consistency test method comprises: Connecting a computer to an oscilloscope, starting application software installed on the computer, and obtaining a user interface of the software; Start the test, output the test instruction to the oscilloscope through the computer, and control the oscilloscope to complete the test operation of the CAN bus physical layer consistency of the chip to be measured; Receive the test data transmitted by the oscilloscope, organize and analyze it to generate a CAN bus physical layer consistency test report.
2. The CAN bus physical layer consistency test method as claimed in claim 1, characterized in that: The step of connecting a computer to an oscilloscope, starting application software installed on the computer, and obtaining a user interface of the software includes: Connect the computer to the LAN interface of the oscilloscope via a network cable; Connect the oscilloscope to the test point of the device under test through the probe; Start the application software in the computer and open the user interface.
3. The CAN bus physical layer consistency test method as claimed in claim 1, characterized in that: The startup test, outputting a test instruction to the oscilloscope through the computer, and controlling the oscilloscope to complete a test operation of the physical layer consistency of the CAN bus, includes: Receive a start test instruction input by a user through a start test button in the user interface; Send a test instruction to the oscilloscope, and control the oscilloscope to perform a test operation according to the test instruction.
4. The CAN bus physical layer consistency test method as claimed in claim 3, characterized in that: The step of sending a test instruction to the oscilloscope and controlling the oscilloscope to perform a test operation according to the test instruction includes: The computer sends an instruction to start initialization of the oscilloscope, and controls the oscilloscope to complete the initialization operation; The computer sends a scale calibration value instruction to control the oscilloscope to complete the range adjustment operation; The computer sends instructions for various test items to control the oscilloscope to perform data recording operations; The computer sends an instruction to start measuring, and controls the oscilloscope to measure the consistency of the physical layer of the CAN bus.
5. The CAN bus physical layer consistency test method as claimed in claim 1, characterized in that: The receiving of the test data transmitted by the oscilloscope comprises: The computer sends a measurement data transmission instruction to the oscilloscope; After the receiving oscilloscope responds to the return measurement data instruction, it records various test data generated by measuring the consistency of the physical layer of the CAN bus.
6. The CAN bus physical layer consistency test method as claimed in claim 1, characterized in that: The receiving of the test data transmitted by the oscilloscope and the sorting and analysis to generate a CAN bus physical layer consistency test report includes: Obtain and store the measurement data of various CAN bus physical layer consistency of the oscilloscope; Analyze and process the measurement data of the physical layer consistency of each CAN bus; Summarize and generate CAN bus physical layer consistency test report.
7. The CAN bus physical layer consistency test method as claimed in claim 6, characterized in that: The analysis and processing of the measurement data of the physical layer consistency of each CAN bus includes: Compare the test data of each CAN bus physical layer consistency with its standard data to determine whether it meets the requirements: If the requirements are met, the data is filled into the specified location of the document and a qualified judgment is given; If the requirements are not met, fill in the data in the designated location of the document and give a judgment of unqualified; The application software analyzes and processes the data in the document based on the comparison results.
8. A CAN bus physical layer consistency test device, characterized in that: The device comprises: A test preparation unit, used to connect a computer and an oscilloscope, start application software installed on the computer, and obtain a user interface of the software; A test unit, used to start the test, output a test instruction to the oscilloscope through the computer, and control the oscilloscope to complete the test operation of the physical layer consistency of the CAN bus; The report generating unit is used to receive the test data transmitted by the oscilloscope, and to organize and analyze the test data to generate a CAN bus physical layer consistency test report.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
10. A computer storage medium, characterized in that: The storage medium stores at least one executable instruction, and the executable instruction enables the processor to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
CAN bus physical layer automatic test system and method
CN120416081A
