Method, system, electronic device and storage for vehicle fault code simulation test
Through the ECU fault simulation client generating and converting simulated fault codes, combining the processing of the test microcontroller and testing of the equipment to be tested, the problems of low efficiency and difficulty of intelligent vehicle diagnostic testing in the existing technology are solved, and efficient and accurate fault code simulation testing are achieved.
Patent Information
- Application Number
- CN202210704104.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-21
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2042-06-21
AI Technical Summary
During the intelligent vehicle diagnostic testing process, it is difficult for the prior art to efficiently simulate the ECU sending fault code information, resulting in low testing efficiency and prone to errors. Especially when a large amount of fault information is defined within the ECU, the test data is large and the test is difficult.
The ECU fault simulation client generates an analog fault code, and converts it through USB to DB9 and then sends it to the test microcontroller. The test microcontroller processes it according to the specifications of the simulated fault code, and sends the processed simulated fault code to the equipment to be tested to realize fault testing.
This method improves the testing efficiency of the ECU, reduces the possibility of test errors, and simplifies the testing process, especially when processing a large amount of fault information, which significantly reduces the testing difficulty.
Smart Images

Figure CN115097808B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of vehicle testing, and particularly relates to a method, a system, an electronic device, and a storage medium for simulating vehicle fault codes for testing. Background Art
[0002] During the intelligent vehicle diagnosis and testing process, it is necessary to simulate the fault code information sent by the ECU (Electronic Control Unit) to test the fault display function of the in-vehicle display system (such as instrument, multifunctional display screen, etc.). According to the provisions of the J1939 protocol, the current fault codes are sent through DM1 messages. When the number of faults is less than 1, the single-frame protocol is used to send the fault information. When the number of faults is greater than 1, the multi-frame transmission protocol is required to transmit the fault information.
[0003] In the actual process of simulating and evaluating fault codes, when using the method of manually inputting fault information for fault code testing, it is easy to make mistakes, with low efficiency. Moreover, if a large number of fault information is defined inside the ECU, during testing, according to the test requirements, multiple fault codes need to be arbitrarily combined, resulting in a large amount of test data and high test difficulty. Summary of the Invention
[0004] The main purpose of the embodiments of the present invention is to provide a method, a system, an electronic device, and a storage medium for simulating vehicle fault codes for testing, such that only simulated fault codes are generated inside the ECU, and the test single-chip microcomputer performs recombination, forwarding, etc. of the simulated fault codes, ensuring the test efficiency of the ECU.
[0005] In a first aspect, a method for simulating vehicle fault codes for testing is provided. The method includes:
[0006] The ECU fault simulation client generates simulated fault codes, and sends the simulated fault codes to the test single-chip microcomputer after being converted by USB to DB9.
[0007] The test single-chip microcomputer performs corresponding processing according to the specifications of the simulated fault codes, and sends the processed simulated fault codes to the device to be tested.
[0008] The device to be tested performs fault testing according to the processed simulated fault codes.
[0009] In a possible implementation, the device to be tested performing fault testing according to the processed simulated fault codes includes:
[0010] The device to be tested displays the name of the simulated fault code, displays the description of the simulated fault code, and displays the status of the fault light.
[0011] In another possible implementation, the test single-chip microcomputer performs corresponding processing according to the specifications of the analog fault code, including:
[0012] If the specification is for one analog fault code, the test single-chip microcomputer converts the analog fault code into the format of the DM1 message specified in the J1939 protocol; or,
[0013] If the specification is for multiple analog fault codes, the test single-chip microcomputer performs packet processing on the multiple analog fault codes according to the multi-pin transmission protocol in the J1939 protocol.
[0014] In another possible implementation, the test single-chip microcomputer is a Freescale single-chip microcomputer.
[0015] In a second aspect, a system for simulating and testing vehicle fault codes is provided. The system includes:
[0016] An ECU fault simulation client, configured to generate an analog fault code and send the analog fault code to the test single-chip microcomputer after conversion through a USB to DB9 conversion;
[0017] A test single-chip microcomputer, configured to perform corresponding processing according to the specifications of the analog fault code and send the processed analog fault code to the device to be tested;
[0018] A device to be tested, configured to perform a fault test according to the processed analog fault code.
[0019] In a possible implementation, the device to be tested performs a fault test according to the processed analog fault code, including:
[0020] The device to be tested displays the name of the analog fault code, displays a description of the analog fault code, and displays the status of the fault light.
[0021] In another possible implementation, the test single-chip microcomputer performs corresponding processing according to the specifications of the analog fault code, including:
[0022] If the specification is for one analog fault code, the test single-chip microcomputer converts the analog fault code into the format of the DM1 message specified in the J1939 protocol; or,
[0023] If the specification is for multiple analog fault codes, the test single-chip microcomputer performs packet processing on the multiple analog fault codes according to the multi-pin transmission protocol in the J1939 protocol.
[0024] In another possible implementation, the test single-chip microcomputer is a Freescale single-chip microcomputer.
[0025] In a third aspect, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the method for simulating vehicle fault codes provided in the first aspect is implemented.
[0026] In a fourth aspect, a non-transitory computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for simulating vehicle fault codes provided in the first aspect is implemented. Description of the Drawings
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for describing the embodiments of the present application will be briefly introduced below.
[0028] Figure 1 It is a flowchart of the method for simulating vehicle fault codes provided by an embodiment of the present invention;
[0029] Figure 2 It is a structural diagram of the system for simulating vehicle fault codes provided by an embodiment of the present invention;
[0030] Figure 3 It is a schematic diagram of the physical structure of an electronic device according to the present invention;
[0031] Figure 4 It is a schematic diagram of the vehicle fault code simulation test device provided by the present invention;
[0032] Figure 5 It is a schematic diagram of the interface of the ECU fault simulation client provided by the present invention;
[0033] Figure 6 It is a schematic diagram of the process for simulating vehicle fault codes provided by the present invention. Detailed Embodiments
[0034] The embodiments of the present application will be described in detail below. The examples of the embodiments are shown in the drawings, where the same or similar reference numerals denote the same or similar modules or modules with the same or similar functions from beginning to end. The embodiments described below by referring to the drawings are exemplary and are only used to explain the present application, and cannot be construed as a limitation of the present invention.
[0035] Those skilled in the art of the present technology can understand that, unless specifically stated otherwise, the singular forms "a", "an", "the", and "said" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present application means the presence of the described features, integers, steps, operations, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, modules, components, and / or their groups. It should be understood that when we say a module is "connected" or "coupled" to another module, it can be directly connected or coupled to other modules, or there may also be intermediate modules. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any one of the one or more related listed items and all combinations.
[0036] To make the objectives, technical solutions, and advantages of the present application clearer, the implementation manners of the present application will be further described in detail below with reference to the accompanying drawings.
[0037] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific embodiments. These several specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0038] As Figure 1 shown is a flowchart of a method for vehicle fault code simulation test provided by an embodiment of the present invention. The method includes:
[0039] Step 101, an ECU fault simulation client generates a simulated fault code, and sends the simulated fault code to a test single-chip microcomputer after being converted by a USB to DB9 converter;
[0040] Step 102, the test single-chip microcomputer performs corresponding processing according to the specification of the simulated fault code, and sends the processed simulated fault code to the device to be tested;
[0041] Step 103, the device to be tested performs a fault test according to the processed simulated fault code.
[0042] In the embodiment of the present invention, an ECU (Electronic Control Unit) fault simulation client installed in an upper computer can imitate a variety of different fault codes. The ECU fault simulation client generates one or more fault codes according to the needs of the simulation test, and sends the one or more fault codes to the test single-chip microcomputer after performing a USB-DB9 conversion on them.
[0043] After the test single-chip microcomputer receives the analog fault code, it decodes the analog fault code, obtains the specification of the analog fault code through decoding, performs corresponding processing according to different specifications, and sends the processed analog fault code to the device under test. It should be noted that the test single-chip microcomputer includes at least two CAN buses. One CAN bus is used to receive the analog fault code sent by the ECU simulation client, and the other CAN bus is used to send the processed analog fault code to the device under test. The test single-chip microcomputer can be selected according to actual usage needs. Preferably, the test single-chip microcomputer is a Freescale single-chip microcomputer.
[0044] The device under test receives the processed analog fault code and performs a fault test according to the processed analog fault code.
[0045] Among them, the device under test performing a fault test according to the processed analog fault code includes:
[0046] The device under test displays the name of the analog fault code, displays the description of the analog fault code, and displays the status of the fault light.
[0047] Among them, the test single-chip microcomputer performing corresponding processing according to the specification of the analog fault code includes:
[0048] If the specification is one analog fault code, the test single-chip microcomputer converts the analog fault code into the format of the DM1 message specified in the J1939 protocol; or,
[0049] If the specification is multiple analog fault codes, the test single-chip microcomputer performs packet processing on the multiple analog fault codes according to the multi-pin transmission protocol in the J1939 protocol.
[0050] In the embodiment of the present invention, the ECU fault simulation client generates an analog fault code, and sends the analog fault code to the test single-chip microcomputer after conversion through USB to DB9; the test single-chip microcomputer performs corresponding processing according to the specification of the analog fault code, and sends the processed analog fault code to the device under test; the device under test performs a fault test according to the processed analog fault code. This ensures that only analog fault codes are generated inside the ECU, and the test single-chip microcomputer performs recombination, forwarding, etc. of the analog fault codes, guaranteeing the test efficiency of the ECU.
[0051] As Figure 2 shown is the structural diagram of a vehicle fault code simulation test system provided by an embodiment of the present invention. The system includes:
[0052] The ECU fault simulation client 201 is used to generate an analog fault code and send the analog fault code to the test single-chip microcomputer after conversion through USB to DB9;
[0053] The test single-chip microcomputer 202 is used to perform corresponding processing according to the specifications of the simulated fault codes and send the processed simulated fault codes to the device to be tested;
[0054] The device to be tested 203 is used to perform fault testing according to the processed simulated fault codes.
[0055] In the embodiment of the present invention, the ECU (Electronic Control Unit) fault simulation client installed in the upper computer can imitate a variety of different fault codes. The ECU fault simulation client generates one or more fault codes according to the needs of the simulation test, and after performing usb-db9 conversion on the one or more fault codes, sends them to the test single-chip microcomputer.
[0056] After receiving the simulated fault codes, the test single-chip microcomputer decodes the simulated fault codes, obtains the specifications of the simulated fault codes through decoding, performs corresponding processing according to different specifications, and sends the processed simulated fault codes to the device to be tested. It should be noted that the test single-chip microcomputer includes at least two CAN buses. One CAN bus is used to receive the simulated fault codes sent by the ECU simulation client, and the other CAN bus is used to send the processed simulated fault codes to the device to be tested. The test single-chip microcomputer can be selected according to the actual usage needs. Preferably, the test single-chip microcomputer is a Freescale single-chip microcomputer.
[0057] The device to be tested receives the processed simulated fault codes and performs fault testing according to the processed simulated fault codes.
[0058] Among them, the device to be tested performs fault testing according to the processed simulated fault codes, including:
[0059] The device to be tested displays the name of the simulated fault code, displays the description of the simulated fault code, and displays the status of the fault light.
[0060] Among them, the test single-chip microcomputer performs corresponding processing according to the specifications of the simulated fault codes, including:
[0061] If the specification is a single simulated fault code, the test single-chip microcomputer converts the simulated fault code into the format of the DM1 message specified in the J1939 protocol; or,
[0062] If the specification is multiple simulated fault codes, the test single-chip microcomputer performs packet processing on the multiple simulated fault codes according to the multi-pin transmission protocol in the J1939 protocol.
[0063] In an embodiment of the present invention, the ECU fault simulation client generates simulated fault codes and sends the simulated fault codes to the test single-chip microcomputer after conversion through a USB to DB9 converter; the test single-chip microcomputer performs corresponding processing according to the specifications of the simulated fault codes and sends the processed simulated fault codes to the device to be tested; the device to be tested performs fault testing according to the processed simulated fault codes. This ensures that only simulated fault codes are generated inside the ECU, and the test single-chip microcomputer performs operations such as recombination and forwarding of the simulated fault codes, guaranteeing the test efficiency of the ECU.
[0064] Figure 3 An example of the physical structure diagram of an electronic device is shown as Figure 3 As shown, the electronic device may include: a processor 301, a communications interface 302, a memory 303, and a communication bus 304. Among them, the processor, the communications interface, and the memory communicate with each other through the communication bus. The processor can call the logical instructions in the memory to execute the method for simulating vehicle fault codes, which includes: the ECU fault simulation client generates simulated fault codes and sends the simulated fault codes to the test single-chip microcomputer after conversion through a USB to DB9 converter; the test single-chip microcomputer performs corresponding processing according to the specifications of the simulated fault codes and sends the processed simulated fault codes to the device to be tested; the device to be tested performs fault testing according to the processed simulated fault codes.
[0065] In addition, when the logical instructions in the above-mentioned memory are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0066] On the other hand, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the method for vehicle fault code simulation test provided by each of the above method embodiments. The method includes: an ECU fault simulation client generates a simulated fault code, and sends the simulated fault code to a test single-chip microcomputer after conversion through a USB to DB9 conversion; the test single-chip microcomputer performs corresponding processing according to the specifications of the simulated fault code, and sends the processed simulated fault code to a device to be tested; the device to be tested performs a fault test according to the processed simulated fault code.
[0067] On another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the method for vehicle fault code simulation test provided by each of the above embodiments. The method includes: an ECU fault simulation client generates a simulated fault code, and sends the simulated fault code to a test single-chip microcomputer after conversion through a USB to DB9 conversion; the test single-chip microcomputer performs corresponding processing according to the specifications of the simulated fault code, and sends the processed simulated fault code to a device to be tested; the device to be tested performs a fault test according to the processed simulated fault code.
[0068] As Figure 4 shown is a schematic diagram of a vehicle fault code simulation test device provided by the present invention.
[0069] As Figure 5 shown is a schematic diagram of the interface of an ECU fault simulation client provided by the present invention.
[0070] As Figure 6 shown is a schematic diagram of the process of vehicle fault code simulation test provided by the present invention.
[0071] It should be understood that although the steps in the flowchart of the accompanying drawings are sequentially shown according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same moment, but can be executed at different moments. Their execution order is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0072] The above are only some implementation manners of the present invention. It should be noted that for those of ordinary skill in the art, several improvements and refinements can be made without departing from the principle of the present invention, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A method for simulating and testing vehicle fault codes, characterized in that, the method includes: The ECU fault simulation client generates simulated fault codes, and sends the simulated fault codes to the test single-chip microcomputer after conversion through USB to DB9; The test single-chip microcomputer performs corresponding processing according to the specifications of the simulated fault codes, and sends the processed simulated fault codes to the device to be tested; The device to be tested performs fault testing according to the processed simulated fault codes; the test single-chip microcomputer performs corresponding processing according to the specifications of the simulated fault codes, including: if the specification is one simulated fault code, the test single-chip microcomputer converts the simulated fault code into the format of the DM1 message specified in the J1939 protocol; or, if the specification is multiple simulated fault codes, the test single-chip microcomputer performs packet processing on the multiple simulated fault codes according to the multi-pin transmission protocol in the J1939 protocol.
2. The method according to claim 1, characterized in that, the device to be tested performs fault testing according to the processed simulated fault codes, including: The device to be tested displays the name of the simulated fault code, displays the description of the simulated fault code, and displays the status of the fault light.
3. The method according to claim 1, characterized in that, the test single-chip microcomputer is a Freescale single-chip microcomputer.
4. A system for implementing the method for simulating and testing vehicle fault codes according to any one of claims 1-3, characterized in that, the system includes: An ECU fault simulation client, configured to generate simulated fault codes, and send the simulated fault codes to the test single-chip microcomputer after conversion through USB to DB9; A test single-chip microcomputer, configured to perform corresponding processing according to the specifications of the simulated fault codes, and send the processed simulated fault codes to the device to be tested; A device to be tested, configured to perform fault testing according to the processed simulated fault codes.
5. The system according to claim 4, characterized in that, the device to be tested performs fault testing according to the processed simulated fault codes, including: The device to be tested displays the name of the simulated fault code, displays the description of the simulated fault code, and displays the status of the fault light.
6. The system according to claim 4, characterized in that, the test single-chip microcomputer performs corresponding processing according to the specifications of the simulated fault codes, including: If the specification is one simulated fault code, the test single-chip microcomputer converts the simulated fault code into the format of the DM1 message specified in the J1939 protocol; or, if the specification is multiple simulated fault codes, the test single-chip microcomputer performs packet processing on the multiple simulated fault codes according to the multi-pin transmission protocol in the J1939 protocol.
7. The system according to claim 4, characterized in that, the test single-chip microcomputer is a Freescale single-chip microcomputer.
8. An electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, when the processor executes the program, it implements the method for simulating and testing vehicle fault codes according to any one of claims 1-3.
9. A non-transitory computer-readable storage medium, on which a computer program is stored, It is characterized in that when the computer program is executed by a processor, it implements the method for simulating and testing vehicle fault codes described in any one of claims 1-3.
Citation Information
Patent Citations
Automobile ECU measurement system based on hardware-in-loop simulation
CN104076814A
Hardware-in-loop automatic test method and system of CAN bus controller, and storage medium
CN113189970A