Electric automobile instrument function test message generation method and device and storage medium
The test message generation method designed through EXCEL tables solves the problems of cumbersome and inefficient automobile instrument testing in the existing technology, realizes fast and accurate instrument function testing, and is suitable for a variety of vehicle models.
Patent Information
- Application Number
- CN202510769569.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-09-23
AI Technical Summary
Existing automotive instrument testing methods are cumbersome, requiring redesign of DBC files or manual calculation of messages when design changes occur, resulting in low testing efficiency and prone to errors.
A test message generation method designed using an EXCEL spreadsheet is proposed. By confirming the functional signal of the automobile instrument, converting it into binary code, a 64-bit zero-value binary code is generated, and the binary values at the corresponding positions are replaced according to the starting position. Finally, the codes are merged into a hexadecimal message, and the test message is generated using an Excel template and a host computer.
It achieves fast, flexible and accurate instrument function testing, is applicable to a variety of vehicle models, avoids manual calculation errors, and significantly shortens the test cycle.
Smart Images

Figure CN120692194A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electric vehicle instrument testing, and in particular to a method, a device and a storage medium for generating a function test message for an electric vehicle instrument. Background Art
[0002] Electric vehicle instrument clusters are crucial electronic devices within vehicles, responsible for communicating information between the vehicle and the driver. Therefore, during the instrument development process, multiple rounds of functional testing and verification are required to ensure the accuracy of the instrument's indications. Existing instrument test devices often rely on a database for CAN (DBC) messages from different vehicle models to enable comprehensive instrument function testing and accurate fault message analysis.
[0003] However, design changes are common in the automotive instrument design process. Once the instrument function changes, it is necessary to redesign the DBC file or manually calculate the message to verify the function based on the new functional signal. This method is cumbersome and has low testing efficiency. Redesigning the DBC file requires a certain software foundation, and manual calculation of the message is prone to errors, which in turn prolongs the testing cycle of the instrument design change. Summary of the Invention
[0004] The present invention aims to overcome the shortcomings of the prior art by providing a method and device for generating functional test messages for electric vehicle instrument clusters. Designed through an Excel spreadsheet, the method is applicable to different signals from a variety of vehicle models. In particular, when functional signals change due to design changes, the method can quickly and flexibly generate test messages, thereby improving testing efficiency when functional changes are made to electric vehicle combination instrument clusters.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is: a method for generating a function test message of an electric vehicle instrument, comprising the following steps:
[0006] (1) Confirm the vehicle instrument function signal according to the CAN communication matrix file;
[0007] (2) Convert the value of the required test function into binary code;
[0008] (3) Generate 64-bit zero-value binary code for standby use;
[0009] (4) According to Lsbpos and BitSize, in the default Motorola format, find the sequence number of the high byte position of the signal binary code as the starting position in the 64-bit zero-value binary code;
[0010] (5) According to the starting position obtained in step (4), the binary code converted in step (2) replaces the binary value of the corresponding position in the 64-bit zero-value binary code;
[0011] (6) The 64-bit binary code reconstructed in step (5) is divided into 8 groups in sequence, converted into hexadecimal respectively, and then combined to obtain the required functional test message.
[0012] In step (1), it is confirmed that the automobile instrument function signal includes the signal low byte starting position Lsbpos, the signal word length BitSize and the signal value Value information.
[0013] In step (2), the Value of the required test function is converted into binary code and its length is consistent with the BitSize length.
[0014] Create a template in an Excel spreadsheet, divide the template into multiple areas, use Excel programming or functions to obtain the data in the template and follow steps (1)-(6) to generate corresponding intermediate data information and test messages and fill them in the corresponding areas in the template.
[0015] Divide the Excel template into four areas: basic information area, variable area, automatic calculation area and test message output area;
[0016] The basic information area is used to record the functional items of the required automotive instrument under test; the variable area is used to input the values of Lsbpos, BitSize and Value of the test signal;
[0017] The automatic calculation area is used to fill in the intermediate variable information calculated according to the basic information area and the variable area information;
[0018] The test message output area is used to display the test message corresponding to the function item.
[0019] The Excel template is divided into four areas: initialization area, signal conversion area, automatic calculation area and test message calculation output area;
[0020] The initialization area is used to find the starting position of the binary signal in the 64-bit zero-value binary code according to the Lsbpos and BitSize values of the numerical display function signal, and generate the 64-bit zero-value binary code and BitSize-bit zero-value binary code required for subsequent calculations; the signal conversion area is used to reversely calculate the intermediate signal value based on the conversion formula defined in the CAN communication matrix file according to the numerical value to be displayed during the automobile instrument test; the automatic calculation area is used to process the intermediate signal, convert it into binary code and rearrange it according to the binary message; the test message calculation output area is used to group the binary messages into hexadecimal, and then merge and output the required test messages.
[0021] An electric vehicle instrument function test device includes a power module, a CAN communication box, and a host computer;
[0022] The power supply module is used to supply power to the vehicle instrument under test;
[0023] The CAN communication box is connected to the electric vehicle instrument and the host computer and is used for sending and receiving CAN signals;
[0024] The host computer is used to generate the message required for instrument testing by using the message generation method according to any one of claims 1 to 6.
[0025] The host computer includes a message generation module and a CAN communication module, and provides an operating environment for the two modules; the message generation module is used to automatically generate the required test messages according to the relevant signal definitions in the CAN communication matrix file using the method as described in any one of claims 1 to 6, and the CAN communication module is used to control the CAN communication box to send and receive the required message signals.
[0026] An Excel environment is run in the host computer, and basic information is input through an Excel template and the output test message is displayed.
[0027] A computer storage medium stores a computer program, which implements the method when executed by a processor.
[0028] The advantages of the present invention lie in the following: the test device and automatic test message generation method enable rapid testing of automotive instrument functions. Firstly, the instrument function test device boasts a simple structure, is quick and flexible to set up and use, and is highly adaptable. Secondly, the automatic test message generation method, designed based on an Excel spreadsheet, is applicable to the diverse signals of various vehicle models. In particular, when functional signals change due to design changes, this method allows for rapid and flexible test message generation, effectively avoiding errors that can occur in manually calculated messages and significantly shortening the functional testing cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The following is a brief description of the contents and symbols in the drawings of the present invention:
[0030] Figure 1 This is a schematic diagram of the CAN bus electric vehicle instrument function test device proposed by the present invention;
[0031] Figure 2 This is a flow chart of the implementation of the test message automatic generation method proposed by the present invention;
[0032] Figure 3 Schematic diagram of the EXCEL template 1 constructed according to the first embodiment of the present invention;
[0033] Figure 4 It is a schematic diagram of the EXCEL template 2 constructed in the second embodiment of the present invention. DETAILED DESCRIPTION
[0034] The specific implementation of the present invention will be further explained in detail below by describing the best embodiment with reference to the accompanying drawings.
[0035] This application mainly addresses the defects of the existing technology that the test message generation is complex and requires DBC file development experience. It designs a method that can quickly and automatically generate test messages. This method can meet the needs of functional changes during the test process and achieve the purpose of quickly obtaining the test message after the change. It realizes a method for automatically generating test messages to improve the test efficiency when the electric vehicle combination instrument function is changed. At the same time, it also provides a CAN bus electric vehicle instrument function test device.
[0036] like Figure 1 As shown, a CAN bus electric vehicle instrument function test device is characterized by comprising three main modules: a power module, a CAN communication box, and a host computer.
[0037] The power supply module is used to supply power to the automotive instrument under test, and a 12V battery can be used to supply power to the instrument under test.
[0038] The CAN communication box is connected to the electric vehicle instrument and the host computer and is used to send and receive CAN signals. The CAN communication box uses the ZLG USBCAN-II box to realize signal transmission between the host computer and the instrument under test.
[0039] The host computer includes a message generation module and a CAN communication module, and provides an operating environment for the two modules. The message generation module is used to automatically generate the required test messages according to the relevant signal definitions in the CAN communication matrix file, and the CAN communication module is used to control the CAN communication box to send and receive the required message signals.
[0040] The host computer can be implemented by a computer. The operating environment of the host computer supports the operation of Excel, and also supports Excel functions or programming. By dividing the areas of different rows and columns in the Excel table, the data or messages calculated by the algorithm are filled in different areas of the Excel table for display to meet the needs of users.
[0041] In addition, the present invention also provides a method for automatically generating a test message, which constructs the message generation module based on an EXCEL table and includes the following steps:
[0042] (a) According to the CAN communication matrix file, confirm the vehicle instrument function signal, mainly including the signal low byte starting position (Lsbpos), signal word length (BitSize) and signal value (Value) information;
[0043] (b) Convert the Value of the required test function into binary code, whose length is consistent with the BitSize length;
[0044] (c) Generate a 64-bit zero-value binary code for backup, that is, a binary code with all 64 bits being 0;
[0045] (d) According to Lsbpos and BitSize, in the default Motorola format, find the sequence number of the high byte position of the signal binary code, that is, the starting position in the 64-bit zero-value binary code;
[0046] (e) according to the starting position obtained in step (d), the binary code converted in step (b) replaces the binary value of the corresponding position in the 64-bit zero-value binary code;
[0047] (f) Divide the 64-bit binary code reconstructed in step (e) into 8 groups in order, convert them into hexadecimal respectively, and then combine them to obtain the required functional test message.
[0048] The above steps (a)-(f) can realize the generation of a test message for a function. In this embodiment, a computer storage medium is provided, in which a computer program is stored, and the computer program is used to implement steps (a)-(f) to realize the generation of the test message.
[0049] In the test device of this embodiment, a corresponding message generation program is run in the host computer, and the test message is generated by the host computer, and then the test message is sent to the vehicle instrument via CAN to achieve the purpose of testing.
[0050] In the host computer, test message generation is implemented using an Excel spreadsheet. A template is created in the Excel spreadsheet, which is divided into multiple areas. Excel programming or functions are used to obtain data from the template and execute steps (a)-(f) to generate corresponding intermediate data information and test messages, which are then filled in the corresponding areas of the template. Different areas in the Excel spreadsheet are given different definitions, such as the basic information area corresponding to the vehicle function table signal, which is manually entered by the user, and the intermediate data area, which is generated by the Excel program through steps (b)-(f) to fill in the corresponding area in Excel, making it easier for users to view and use. Finally, the test message generated in step (f) can also be displayed and displayed in a specific Excel area.
[0051] Combine Figure 1 The CAN bus electric vehicle instrument function test device disclosed in the present invention mainly includes three modules: a power module, a CAN communication box and a host computer. The overall structure of the device is simple and flexible, and it can adapt to instrument testing work of different models.
[0052] The power supply module is used to supply power to the electric vehicle instrument under test. It adopts a DC power supply and supplies power through the electric vehicle instrument connector terminals to ensure its normal operation.
[0053] The CAN communication box is used for receiving and sending CAN message signals. It is connected to the electric vehicle instrument under test through the CANH and CANL led out by the electric vehicle instrument connector. At the same time, the CAN communication box leads out a USB interface to connect to the host computer to realize the transmission of message signals.
[0054] The host computer includes two submodules: a message generation module and a CAN communication module. The CAN communication module is used to control the CAN communication box to send and receive the required functional test messages; the message generation module is used to automatically generate functional test messages according to the functional signal definition, realizing the output from the definition information of the functional signal to the test message.
[0055] Further, combined Figure 2 The flowchart described above shows that the message generation module is constructed according to a test message automatic generation method disclosed in the present invention, and the specific steps are as follows:
[0056] Step 1: In the host computer, run the EXCEL environment, create a new EXCEL table, confirm the function signal low byte starting position (Lsbpos), function signal word length (BitSize) and function signal value (Value) and other information according to the CAN communication matrix file, and generate 64-bit zero-value binary code and BitSize-bit zero-value binary code;
[0057] Step 2: Convert the signal value Value into binary code and make its length consistent with the BitSize bit zero value binary code;
[0058] Step 3: Find the sequence number corresponding to the high byte position of the signal binary code in the default Motorola format according to Lsbpos and BitSize, which is also the starting position in the 64-bit zero-value binary code;
[0059] Step 4: Based on the starting position obtained in step 4, the signal binary code is replaced by the binary value of the corresponding position in the 64-bit zero-value binary code;
[0060] Step 5: Divide the 64-bit binary code obtained in step 4 into 8 groups in order, convert them into hexadecimal numbers, and then combine them to obtain the required functional test message.
[0061] The following two functional test examples of the alarm indicator light and the numerical display type are used to explain the implementation of the present invention in detail. Figure 1 The schematic diagram shows how to connect the electric vehicle instrument, power module, CAN communication box, and host computer. Specifically, the CAN communication box can be a ZLG USBCAN-II box, and the CAN communication module can use CANTset software.
[0062] Example 1
[0063] When testing the function of the warning indicator lights of electric vehicle instruments, Figure 2 The test message automatic generation method flow chart shown in FIG, constructs the EXCEL template 1, such as Figure 3 The EXCEL template 1 is mainly divided into four areas: basic information area, variable area, automatic calculation area 1 and test message output area 1.
[0064] Specifically, the basic information area is used to record the functional items of the required automotive instrument under test; the variable area is used to input the values of Lsbpos, BitSize and Value of the required test signal; the automatic calculation area is compiled according to the test message automatic generation method and is used for automatic message generation processing; the test message output area is used to display the test message corresponding to the functional item.
[0065] When testing, determine the values of Lsbpos, BitSize and Value according to the functional signal definition of the vehicle instrument under test, and input Figure 3 After the corresponding position of the variable area is set, the test message output area can automatically output the required functional test message. Subsequently, the CAN communication module controls the CAN communication box to send the corresponding test message to perform functional testing of the electric vehicle instrument.
[0066] Example 2
[0067] When performing functional tests on the numerical display of electric vehicle instruments, Figure 2 The test message automatic generation method flow chart is shown in the figure, and the EXCEL is constructed into template 2, as shown in the figure. Figure 4 The EXCEL template 2 can be divided into four areas: an initialization area, a signal conversion area, an automatic calculation area 2 and a test message output area 2.
[0068] Specifically, the initialization area is used to find the starting position of the binary signal in the 64-bit zero-value binary code according to the Lsbpos and BitSize values of the numerical display function signal, and generate the 64-bit zero-value binary code and BitSize-bit zero-value binary code required for subsequent calculations; the signal conversion area is used to reversely calculate the intermediate signal value according to the conversion formula defined in the CAN communication matrix file based on the numerical value that needs to be displayed during the automobile instrument test; the automatic calculation area is used to process the intermediate signal, convert it into binary code and rearrange it according to the binary message; the test message output area is used to convert the binary message groups into hexadecimal, and then merge and output the required test message.
[0069] This embodiment uses the vehicle speed signal as an example. The signal in the initialization area defines the Lsbpos and BitSize values of the input vehicle speed signal. Then, a conversion formula between the display signal and the intermediate signal is compiled in the signal conversion area. By modifying the instrument display value column in the signal conversion area, test messages can be quickly generated in batches. Finally, the CAN communication module controls the CAN communication box to send the corresponding test messages to test the speed-related functions of the electric vehicle instrument.
[0070] The two aforementioned embodiments demonstrate the practical application effects of the present disclosure in different scenarios: using the Excel template 1, different alarm indication test messages can be quickly calculated; using the Excel template 2, when testing numerical display test messages, a series of test messages can be quickly calculated for batch testing. This avoids the tedious manual calculations and potential errors that can occur when testing changes to vehicle instrument functions, thereby improving testing efficiency. Furthermore, the present disclosure uses the Excel template as the basis for constructing an automatic test message generation module, which is easy to operate and the conversion process is intuitive and clear. It can be applied to test message signal conversion for various vehicle models, especially when design changes to vehicle instrument functions occur, allowing for flexible testing of vehicle instrument functions.
[0071] Obviously, the specific implementation of the present invention is not limited to the above-mentioned methods. As long as various non-substantial improvements are made using the method concept and technical solution of the present invention, they are all within the scope of protection of the present invention.
Claims
1. A method for generating a function test message for an electric vehicle instrument, characterized in that: The steps include: (1) Confirm the vehicle instrument function signal according to the CAN communication matrix file; (2) Convert the value of the required test function into binary code; (3) Generate 64-bit zero-value binary code for standby use; (4) According to Lsbpos and BitSize, in the default Motorola format, find the sequence number of the high byte position of the signal binary code as the starting position in the 64-bit zero-value binary code; (5) According to the starting position obtained in step (4), the binary code converted in step (2) replaces the binary value of the corresponding position in the 64-bit zero-value binary code; (6) The 64-bit binary code reconstructed in step (5) is divided into 8 groups in sequence, converted into hexadecimal respectively, and then combined to obtain the required functional test message.
2. The method for generating a function test message for an electric vehicle instrument according to claim 1, wherein: In step (1), it is confirmed that the automobile instrument function signal includes the signal low byte starting position Lsbpos, the signal word length BitSize and the signal value Value information.
3. The method for generating a function test message for an electric vehicle instrument according to claim 1, wherein: In step (2), the Value of the required test function is converted into binary code and its length is consistent with the BitSize length.
4. The method for generating a function test message for an electric vehicle instrument according to claim 1, wherein: Create a template in an Excel spreadsheet, divide the template into multiple areas, use Excel programming or functions to obtain the data in the template and follow steps (1)-(6) to generate corresponding intermediate data information and test messages and fill them in the corresponding areas in the template.
5. The method for generating an electric vehicle instrument function test message according to any one of claims 1 to 4, characterized in that: Divide the Excel template into four areas: basic information area, variable area, automatic calculation area and test message output area; The basic information area is used to record the functional items of the required automotive instrument under test; the variable area is used to input the values of Lsbpos, BitSize and Value of the test signal; The automatic calculation area is used to fill in the intermediate variable information calculated according to the basic information area and the variable area information; The test message output area is used to display the test message corresponding to the function item.
6. A method for generating an electric vehicle instrument function test message according to any one of claims 1 to 4, characterized in that: The Excel template is divided into four areas: initialization area, signal conversion area, automatic calculation area and test message calculation output area; The initialization area is used to find the starting position of the binary signal in the 64-bit zero-value binary code according to the Lsbpos and BitSize values of the numerical display function signal, and generate the 64-bit zero-value binary code and BitSize-bit zero-value binary code required for subsequent calculations; The signal conversion area is used to reversely calculate the intermediate signal value from the numerical value that needs to be displayed during the vehicle instrument test according to the conversion formula defined in the CAN communication matrix file; the automatic calculation area is used to process the intermediate signal, convert it into binary code and rearrange it according to the binary message; the test message calculation and output area is used to group the binary messages into hexadecimal, and then merge and output the required test messages.
7. An electric vehicle instrument function test device, characterized by: Including power module, CAN communication box, and host computer; The power supply module is used to supply power to the vehicle instrument under test; The CAN communication box is connected to the electric vehicle instrument and the host computer and is used for sending and receiving CAN signals; The host computer is used to generate the message required for instrument testing by using the message generation method according to any one of claims 1 to 6.
8. The method for generating a function test message for an electric vehicle instrument according to claim 7, wherein: The host computer includes a message generation module and a CAN communication module, and provides an operating environment for the two modules; the message generation module is used to automatically generate the required test message according to the relevant signal definition in the CAN communication matrix file using the method described in any one of claims 1 to 6, and the CAN communication module is used to control the CAN communication box to send and receive the required message signals.
9. The method for generating a function test message for an electric vehicle instrument according to any one of claims 1 to 4, characterized in that: An Excel environment is run in the host computer, and basic information is input through an Excel template and the output test message is displayed.
10. A computer storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Data generation method and device based on CAN communication matrix
CN113905095A
Field comparison method and device based on Excel macro function, equipment and storage medium
CN113919309A
Database file generation method and device, computer equipment and storage medium
CN116644032A
Vehicle CAN matrix generation control method and related equipment
CN117034896A
KR20200058718A