Method, system and device for automatically testing CAN network voltage and storage medium
Through the automated testing of CAN network voltage method, VN1640A and CAPL scripts are used to combine with Pico Scope to realize automated measurement and analysis of CAN network voltage, solving the shortcomings of manual measurement and manual judgment in the prior art, and improving the efficiency and accuracy of the test.
Patent Information
- Application Number
- CN202510242954.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-06-27
AI Technical Summary
In the prior art, using Pico Scope to measure CAN network voltage requires manual adjustment of the waveform to increase labor costs, and manual judgment of whether the voltage value is qualified by manual judgment, with large errors and difficult to ensure the accuracy of the test.
By connecting VN1640A with the vehicle CAN bus and configuring the channel settings of VN1640A in CANoe, the CAPL script is initialized to monitor the CAN bus traffic. When a message with the specified ID is recognized, Pico Scope is controlled to capture waveforms, analyze and calculate the voltage value, and determine whether it is qualified.
It realizes the full process automation from hardware connection, traffic monitoring, waveform capture to data analysis, reduces manual intervention, improves test efficiency and accuracy, and ensures real-time response of tests and reliability of results.
Smart Images

Figure CN120214386A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of automotive testing, and particularly relates to a method, system, device and storage medium for automatically testing the CAN network voltage. Background Art
[0002] Currently, the CAN network (Controller Area Network) is increasingly widely used in automotive communication, and the requirements for the vehicle CAN network are also becoming higher and higher. Therefore, the requirements for testing the dominant voltage and recessive voltage of the CAN network segment are also becoming more and more stringent.
[0003] In the prior art, a measurement tool of Pico Scope is used to determine the specific values of the dominant voltage and recessive voltage. Whether it meets the standard requirements is evaluated according to the measured voltage value.
[0004] The prior art has the following technical problems:
[0005] 1. Using Pico Scope for measurement requires manual adjustment of the waveform and selection of a good waveform area for measurement, increasing labor costs.
[0006] 2. Manually judging whether the voltage value is qualified has a large error and it is difficult to ensure the accuracy of the test. Summary of the Invention
[0007] The present invention provides a method, system, device and storage medium for automatically testing the CAN network voltage, aiming to solve the technical problems in the prior art that using Pico Scope for measurement requires manual adjustment of the waveform and selection of a good waveform area for measurement, increasing labor costs; and manually judging whether the voltage value is qualified has a large error and it is difficult to ensure the accuracy of the test.
[0008] The technical solution of the present invention to solve the above technical problems is as follows: A method for automatically testing the CAN network voltage includes:
[0009] Connect the VN1640A to the vehicle CAN bus and configure the channel settings of the VN1640A in CANoe;
[0010] Initialize the CAPL script, use the VN1640A to continuously monitor the traffic on the vehicle CAN bus, and listen and identify messages with a specified ID through the initialized CAPL script;
[0011] When the initialized CAPL script identifies a message with a specified ID, control Pico Scope to capture the waveform and obtain the captured data;
[0012] Analyze and calculate the captured data to obtain a test voltage value, where the test voltage value includes: the voltage values of the CAN high line, the CAN low line, and the differential voltage;
[0013] Obtain the actual voltage, match the test voltage value with the actual voltage, determine whether the test voltage is qualified, and obtain a test result.
[0014] Furthermore, the channel settings of the above VN1640A include the baud rate and the terminal resistance.
[0015] Furthermore, the above-mentioned specified ID is one or more.
[0016] Furthermore, the above-mentioned test result includes a dominant voltage test result and a recessive voltage test result.
[0017] In a second aspect, the present invention also provides an automated test CAN network voltage system to solve the above technical problems, including:
[0018] A connection module, under the condition that the VN1640A is connected to the vehicle CAN bus, is used to configure the channel settings of the VN1640A in CANoe;
[0019] A CAPL script module, used to initialize the CAPL script, continuously monitor the traffic on the vehicle CAN bus by using the VN1640A, and listen for and identify messages with a specified ID through the initialized CAPL script;
[0020] A control module, used to control the Pico Scope to perform waveform capture to obtain captured data when the initialized CAPL script identifies a message with a specified ID;
[0021] An analysis module, used to analyze and calculate the captured data to obtain a test voltage value, where the test voltage value includes: the voltage values of the CAN high line, the CAN low line, and the differential voltage;
[0022] A test module, used to obtain the actual voltage, match the test voltage value with the actual voltage, determine whether the test voltage is qualified, and obtain a test result.
[0023] Furthermore, in the above connection module, the channel settings of the VN1640A include the baud rate and the terminal resistance.
[0024] Furthermore, the above-mentioned specified ID is one or more.
[0025] Furthermore, the above-mentioned test result includes a dominant voltage test result and a recessive voltage test result.
[0026] In a third aspect, to solve the above technical problems, the present invention also provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the automated test method for CAN network voltage of the present application is implemented.
[0027] In a fourth aspect, to solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the automated test method for CAN network voltage of the present application is implemented.
[0028] Compared with the prior art, the present invention has the following advantages:
[0029] 1. The present invention realizes the full-process automation from hardware connection, traffic monitoring, waveform capture to data analysis, greatly reducing manual intervention and improving the test efficiency and accuracy. By continuously monitoring the CAN bus traffic with CAPL script and instantaneously triggering waveform capture, it ensures that the test can respond to key events in real time, avoiding delays or missing important data. Using PicoScope for high-precision waveform capture and combining with CAPL script for detailed voltage analysis, it guarantees the accuracy and reliability of the test results.
[0030] 2. The present invention allows flexible adjustment of the channel settings of VN1640A according to different CAN network configurations (such as different baud rates), is applicable to various types of CAN systems, and enhances the versatility of the test method.
[0031] 3. The present invention supports monitoring messages with one or more specified IDs, enabling the test method not to be limited to single-condition triggering and allowing for diverse tests according to the requirements of complex application scenarios, increasing the test coverage.
[0032] 4. By separately testing and analyzing the dominant and recessive voltages, the present invention can more easily detect potential problems such as electrical interference and hardware failures, enhancing the fault diagnosis ability.
[0033] Other features and advantages of the present invention will be described in the subsequent specification, and part of them will become obvious from the specification or be understood by implementing the present invention. The objectives and other advantages of the present invention can be achieved and obtained through the structures pointed out in the specification, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0035] Figure 1 The flowchart of a method for automatically testing the CAN network voltage according to an embodiment of the present invention is shown;
[0036] Figure 2 The schematic diagram of device connection according to an embodiment of the present invention is shown;
[0037] Figure 3 The schematic structural diagram of a system for automatically testing the CAN network voltage according to an embodiment of the present invention is shown;
[0038] Figure 4 The schematic structural diagram of an electronic device according to an embodiment of the present invention is shown. Detailed implementation manners
[0039] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present invention belong to the scope of protection of the present invention.
[0040] Figure 1 The flowchart of a method for automatically testing the CAN network voltage according to an embodiment of the present invention is shown. As Figure 1 shown, a method for automatically testing the CAN network voltage according to an embodiment of the present invention includes:
[0041] Connect the VN1640A to the vehicle CAN bus and configure the channel settings of the VN1640A in CANoe;
[0042] As Figure 2 shown, for the schematic diagram of device connection, in this embodiment, after the device connection is completed, start the project.
[0043] Initialize the CAPL script, use the VN1640A to continuously monitor the traffic on the vehicle CAN bus, and listen for and identify messages with a specified ID through the initialized CAPL script;
[0044] In this embodiment, in the Panl panel of Set_msg_id, specify IDs in msg_id_01 - msg_id_20. Up to 20 specified IDs can be selected for testing. After filling, in the Test Module mode of Test, select the canbittime test module and check the test cases according to the content to be tested (for example: if dominant voltage test and recessive voltage test are required, check the corresponding test cases). If there are multiple specified IDs, all test cases need to be checked; then start the test.
[0045] When the initialized CAPL script recognizes a message with a specified ID, control the Pico Scope to capture waveforms and obtain the captured data;
[0046] Analyze and calculate the captured data to obtain the test voltage values, which include the voltage values of the CAN high line, CAN low line, and differential voltage;
[0047] Obtain the actual voltage, match the test voltage values with the actual voltage, and determine whether the test voltage is qualified to obtain the test result.
[0048] Optionally, the channel settings of the VN1640A include baud rate and terminal resistance.
[0049] Optionally, the specified ID is one or more.
[0050] Optionally, the test result includes the dominant voltage test result and the recessive voltage test result.
[0051] Based on the same principle as the method shown in Figure 1 This embodiment of the present invention also provides an automated CAN network voltage testing system, as shown in Figure 3 which includes:
[0052] Connection module, under the condition that the VN1640A is connected to the vehicle CAN bus, used to configure the channel settings of the VN1640A in CANoe;
[0053] CAPL script module, used to initialize the CAPL script, continuously monitor the traffic on the vehicle CAN bus using the VN1640A, and listen for and identify messages with specified IDs through the initialized CAPL script;
[0054] Control module, used to control the Pico Scope to capture waveforms and obtain the captured data when the initialized CAPL script recognizes a message with a specified ID;
[0055] An analysis module for analyzing and calculating the captured data to obtain a test voltage value, where the test voltage value includes voltage values of the CAN high line, the CAN low line, and the differential voltage;
[0056] A test module for obtaining an actual voltage, matching the test voltage value with the actual voltage, determining whether the test voltage is qualified, and obtaining a test result.
[0057] Optionally, in the connection module, the channel settings of the VN1640A include the baud rate and the terminal resistance.
[0058] Optionally, the specified ID is one or more.
[0059] Optionally, the test result includes a dominant voltage test result and a recessive voltage test result.
[0060] The automated test CAN network voltage system according to an embodiment of the present invention can execute the automated test CAN network voltage method provided by the embodiment of the present invention, and the implementation principle is similar. The actions performed by each module and unit in the automated test CAN network voltage system in each embodiment of the present invention correspond to the steps in the automated test CAN network voltage method in each embodiment of the present invention. For the detailed function descriptions of the modules of the automated test CAN network voltage system, reference can specifically be made to the descriptions in the corresponding automated test CAN network voltage method shown above, and details are not described herein again.
[0061] Among them, the above-mentioned automated test CAN network voltage system may be a computer program (including program code) running in a computer device. For example, the automated test CAN network voltage system is an application software; this application software can be used to execute the corresponding steps in the method provided by the embodiment of the present invention.
[0062] In some embodiments, the automated test CAN network voltage system provided by the embodiments of the present invention can be implemented in a combination of software and hardware. As an example, the automated test CAN network voltage system provided by the embodiments of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the automated test CAN network voltage method provided by the embodiments of the present invention. For example, the processor in the form of a hardware decoding processor can employ one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0063] The modules involved in the embodiments of the present invention can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation to the module itself in some cases.
[0064] Based on the same principle as the method shown in the embodiments of the present invention, an electronic device is also provided in the embodiments of the present invention. The electronic device can include, but is not limited to: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the method shown in any embodiment of the present invention by calling the computer program.
[0065] In an alternative embodiment, an electronic device is provided, as Figure 4 shown, Figure 4 the electronic device shown includes: a processor and a memory. Among them, the processor and the memory are connected, such as through a bus. Optionally, the electronic device can further include a transceiver, and the transceiver can be used for data interaction between the electronic device and other electronic devices, such as data sending and / or data receiving, etc. It should be noted that in practical applications, the transceiver is not limited to one, and the structure of the electronic device does not constitute a limitation to the embodiments of the present invention.
[0066] The processor can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in connection with the disclosure of the present invention. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0067] The bus can include a path for transmitting information between the above components. The bus can be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 4 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0068] The memory can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or it can also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0069] The memory is used to store the application program code (computer program) for executing the solution of the present invention and is controlled by the processor for execution. The processor is used to execute the application program code stored in the memory to implement the content shown in the foregoing method embodiments.
[0070] Among them, the electronic device may also be a terminal device. Figure 4 The illustrated electronic device is only an example and should not impose any restrictions on the functions and usage scope of the embodiments of the present invention.
[0071] The embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored. When the computer program runs on a computer, it enables the computer to execute the corresponding content in the foregoing method embodiments.
[0072] According to another aspect of the present invention, there is also provided a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above various implementation manners of the embodiments.
[0073] Computer program code for performing the operations of the present invention can be written in one or more programming languages or combinations thereof. The above programming languages include object-oriented programming languages - such as Java, Smalltalk, C++, and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN) - or can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0074] It should be understood that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functions, and operations of the possible implementations of the methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0075] The computer-readable storage medium provided by the embodiments of the present invention may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0076] The above computer-readable storage medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to execute the methods shown in the above embodiments.
[0077] The above description is only the preferred embodiments of the present invention and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present invention is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the (but not limited to) technical features having similar functions disclosed in the present invention.
Claims
1. A method for automatically testing CAN network voltage, characterized in that: The method comprises: Connect VN1640A to the vehicle CAN bus and configure the channel settings of VN1640A in CANoe; Initialize the CAPL script, use the VN1640A to continuously monitor the traffic on the vehicle CAN bus, and monitor and identify the message with the specified ID through the initialized CAPL script; When the initialized CAPL script recognizes the message with the specified ID, it controls the Pico Scope to capture the waveform and obtain the captured data; Analyze and calculate the captured data to obtain a test voltage value, wherein the test voltage value includes: voltage values of a CAN high line, a CAN low line, and a differential voltage; The actual voltage is obtained, the test voltage value is matched with the actual voltage, whether the test voltage is qualified is determined, and a test result is obtained.
2. The method for automatically testing CAN network voltage according to claim 1, characterized in that: The channel settings of VN1640A include baud rate and terminal resistance.
3. The method for automatically testing CAN network voltage according to claim 1, characterized in that: The specified ID is one or more.
4. The method for automatically testing CAN network voltage according to claim 1, characterized in that: The test results include explicit voltage test results and implicit voltage test results.
5. An automated CAN network voltage testing system, characterized in that: include: Connection module, used to configure the channel settings of VN1640A in CANoe when VN1640A is connected to the vehicle CAN bus; A CAPL script module, used to initialize a CAPL script, continuously monitor the traffic on the vehicle CAN bus using the VN1640A, and monitor and identify messages with a specified ID through the initialized CAPL script; The control module is used to control the Pico Scope to capture waveforms and obtain captured data when the initialized CAPL script recognizes a message with a specified ID; An analysis module is used to analyze and calculate the captured data to obtain a test voltage value, wherein the test voltage value includes: a voltage value of a CAN high line, a CAN low line and a differential voltage; The test module is used to obtain the actual voltage, match the test voltage value with the actual voltage, determine whether the test voltage is qualified, and obtain a test result.
6. The automatic CAN network voltage test system according to claim 5, characterized in that: In the connection module, the channel settings of VN1640A include baud rate and terminal resistance.
7. The automatic CAN network voltage test system according to claim 5, characterized in that: The specified ID is one or more.
8. The automatic CAN network voltage testing system according to claim 5, characterized in that: The test results include explicit voltage test results and implicit voltage test results.
9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 4 when executing the computer program.
10. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.