Electronic controller testing device and method, electronic equipment and readable storage medium
By integrating the bus communication module, storage module and state switching module on the main control board, the problem of high cost and inconvenient portability of electronic controller test equipment is solved, efficient testing and data processing are achieved, the wiring process is simplified, and the cost is reduced Cost of use.
Patent Information
- Application Number
- CN202410790393.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-06
AI Technical Summary
Existing electronic controller testing equipment is costly and inconvenient to carry, and the wiring between the equipment is complicated.
An electronic controller testing device is designed, including a main control board, bus communication module, storage module and state switching module. By integrating on the main control board, the testing, data calculation, communication and state switching functions of the electronic controller are realized. No external wiring is required, reducing costs and easy to carry.
It realizes efficient testing and data processing of electronic controllers, simplifies equipment wiring, reduces manufacturing and use costs, and is easy to carry and use.
Smart Images

Figure CN118605451A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of equipment testing, and in particular to an electronic controller testing device, method, electronic equipment and readable storage medium. Background Art
[0002] In the prior art, a wide variety of equipment is required for ECU (Electronic Control Unit) testing; for example, a PC host, an oscilloscope, a programmable voltage-stabilized power supply, a bus simulation acquisition tool, a relay board, and a voltage-stabilized power supply are required in the test; the wiring between the various devices is complicated; the manufacturing and use costs are high, and the device is not easy to carry. Summary of the invention
[0003] The main purpose of the present invention is to provide an electronic controller testing device, method, electronic device and readable storage medium, aiming to solve the problem that the equipment for testing electronic controllers in the prior art is high in cost and not easy to carry.
[0004] To achieve the above-mentioned object, the present invention provides an electronic controller test device, which includes a main control board and a main control chip, a bus communication module, a storage module, and a state switching module arranged on the main control board; the main control chip is respectively connected to the control end of the state switching module, the storage module, and the bus communication module, the bus communication module is connected to the bus interface of the electronic controller, and the state switching module is connected to the wake-up end of the electronic controller; wherein:
[0005] The bus communication module is used to communicate with the electronic controller based on the bus to obtain communication data;
[0006] The storage module is used to store test cases;
[0007] The state switching module is used to control the wake-up terminal voltage of the electronic controller to switch the operating state of the electronic controller;
[0008] The main control chip is used to test the electronic controller under different operating states of the electronic controller based on the test case and the communication data to obtain a test report.
[0009] Optionally, the bus communication module includes a plurality of bus controllers, each of which is respectively connected to a group of bus interfaces of the electronic controller.
[0010] Optionally, the state switching module includes a relay switch and a voltage-stabilized power supply; wherein:
[0011] The control end of the relay switch is connected to the main control chip, the first contact of the relay switch is connected to the voltage-stabilized power supply, and the second contact of the relay switch is connected to the wake-up end of the electronic controller.
[0012] To achieve the above object, the present invention further provides an electronic controller testing method, which is applied to the electronic controller testing device as described above, and comprises:
[0013] If a test case is triggered, the electronic controller is switched to the running state of the test case, wherein the running state is switched by sending a switch signal to a state switching module, or by sending a state signal through a bus communication module;
[0014] Obtaining communication data received by the bus communication module;
[0015] Under different operating states of the electronic controller, the electronic controller is tested according to the test case and the communication data to obtain a test report.
[0016] Optionally, after the state switching module is closed and triggers the electronic controller to wake up, the electronic controller is tested according to the test case and the communication data in different operating states of the electronic controller;
[0017] Outputting the test report through the output module includes:
[0018] determining a current operating state of the electronic controller, and determining a target communication parameter corresponding to the current operating state in the test case;
[0019] The electronic controller is tested according to the target communication parameters and the communication data.
[0020] Optionally, the testing the electronic controller according to the target communication parameter and the communication data includes:
[0021] Determining a status flag in the communication data and a target flag in the target communication parameter;
[0022] Determining whether the state flag bit is the same as the target flag bit;
[0023] If the state flag bit is different from the target flag bit, it is determined that the test fails.
[0024] Optionally, the testing the electronic controller according to the target communication parameter and the communication data includes:
[0025] Obtaining a time difference between two consecutive data frames in the communication data;
[0026] Determine a target sending interval in the target communication parameter, and determine whether the time difference matches the target sending interval;
[0027] If the time difference does not match the target sending interval, it is determined that the test has failed.
[0028] Optionally, before the electronic controller is switched to the running state of the test case if the test case is triggered, the method includes:
[0029] After the electronic controller disconnects the power supply, a closing signal is sent to the relay switch in the state switching module, and a voltage difference between the two ends of the relay switch is collected;
[0030] Determine whether the voltage difference between the two ends is less than a preset voltage difference;
[0031] If the voltage difference between the two ends is less than the preset voltage difference, the self-test passes.
[0032] Optionally, before the electronic controller is switched to the running state of the test case if the test case is triggered, the method includes:
[0033] Setting the communication mode of the bus communication module to a loopback mode, and controlling the bus communication module to send test data;
[0034] Acquire the test loopback data received by the bus communication module, and determine whether the test loopback data is consistent with the test data;
[0035] If the test loop data is consistent with the test data, the self-test passes.
[0036] To achieve the above objectives, the present invention also 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 computer program implements the steps of the electronic controller testing method as described above when executed by the processor.
[0037] To achieve the above object, 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 steps of the electronic controller testing method described above are implemented.
[0038] The present invention proposes an electronic controller testing device, method, electronic device and readable storage medium, wherein the electronic controller testing device comprises a main control board and a main control chip, a bus communication module, a storage module and a state switching module arranged on the main control board; the main control chip is respectively connected to the control end of the state switching module, the storage module and the bus communication module, the bus communication module is connected to the bus interface of the electronic controller, and the state switching module is connected to the wake-up end of the electronic controller; wherein: the bus communication module is used to communicate with the electronic controller based on the bus to obtain communication data; the storage module is used to store test cases; the state switching module is used to control the wake-up end voltage of the electronic controller to switch the operating state of the electronic controller; the main control chip is used to test the electronic controller based on the test case and the communication data under different operating states of the electronic controller to obtain a test report. By arranging a main control chip, a bus communication module, a storage module, and a state switching module on the main control board, the electronic controller testing device based on the main control board can meet the functional requirements of data calculation, communication, test cases, and state switching for testing the electronic controller; since each module is integrated into the main control board, no wiring is required during use, which reduces costs and is easy to carry. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0040] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0041] Figure 1 A module structure diagram of an embodiment of an electronic controller testing device of the present invention;
[0042] Figure 2 It is a detailed structural diagram of the electronic controller testing device of the present invention;
[0043] Figure 3 It is a flow chart of a first embodiment of the electronic controller testing method of the present invention;
[0044] Figure 4 It is a schematic diagram of the overall process of the electronic controller testing method of the present invention;
[0045] Figure 5 A schematic diagram of a relay switch self-test in an electronic controller testing method of the present invention;
[0046] Figure 6 A schematic diagram of a bus controller self-test in an electronic controller testing method of the present invention;
[0047] Figure 7 A schematic diagram of a wake-up test in the electronic controller testing method of the present invention;
[0048] Figure 8 A schematic diagram of state switching in the electronic controller testing method of the present invention;
[0049] Fig. 9 It is a schematic diagram of the module structure of the electronic device of the present invention.
[0050] Description of Figure Numbers:
[0051] Label name Label name 100 Main control board 400 Storage Module 200 Main control chip 500 State switching module 300 Bus communication module 510 Regulated power supply 310 Bus Controller K1 Relay switch DETAILED DESCRIPTION
[0052] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present application.
[0053] The present invention provides an electronic controller testing device, referring to Figure 1 , Figure 1 The module structure diagram of an embodiment of the electronic controller test device of the present invention comprises a main control board 100 and a main control chip 200, a bus communication module 300, a storage module 400, and a state switching module 500 arranged on the main control board 100; the main control chip 200 is respectively connected to the control end of the state switching module 500, the storage module 400, and the bus communication module 300, the bus communication module 300 is connected to the bus interface of the electronic controller, and the state switching module 500 is connected to the wake-up end of the electronic controller; wherein:
[0054] The bus communication module 300 is used to communicate with the electronic controller based on the bus to obtain communication data;
[0055] The storage module 400 is used to store test cases;
[0056] The state switching module 500 is used to control the wake-up terminal voltage of the electronic controller to switch the operating state of the electronic controller;
[0057] The main control chip 200 is used to test the electronic controller under different operating states of the electronic controller based on the test case and the communication data to obtain a test report.
[0058] The main control chip 200 serves as a processing and control center of the electronic controller test device; the specific type of the main control chip 200 can be set based on actual needs, such as MCU (Microcontroller Unit).
[0059] The bus communication unit communicates with the electronic controller based on a specific bus type; the specific bus type may be determined based on the settings of the electronic controller, and the CAN bus is used as an example for explanation in this embodiment and subsequent embodiments.
[0060] The state switching module 500 is used to control the operating state of the electronic controller; specifically, when the wake-up terminal pin of the electronic controller receives a wake-up voltage, the electronic controller will wake up from the sleep state, thereby realizing the state switching of the electronic controller.
[0061] The storage module 400 stores relevant data in the electronic controller test device, such as test cases; the test cases are used to indicate specific test content, including but not limited to test data, test procedures, test functions, and test qualification conditions; the test cases can be set based on the actual needs of the electronic controller; for example, the network management test cases of the electronic controller can be obtained in advance, and the test cases can be written according to the network management test cases. The main control chip 200 in this embodiment adopts MCU, so the test cases can be directly written in C language, which is convenient for developers to write without having to learn a new scripting language, thereby reducing the development cycle and improving development efficiency.
[0062] After the test is completed, the main control chip 200 outputs a test report based on the test results.
[0063] An output module may also be provided in the electronic controller test device, and the output module is used to connect to an external device and output a test report to the external device; the output module may be specifically provided based on actual needs, such as a USB or wireless communication device.
[0064] Specific test cases can be set in the storage module 400. After the electronic controller test device is connected to the electronic controller and is ready, the main control chip 200 automatically calls the test cases to test the electronic controller.
[0065] A variety of test cases can also be set in the storage module 400, and the user can select the test case to be executed based on the actual test needs. In order to realize the selection of the test case, a related interactive module can be set. For example, the test case can be selected through an external device connected to the output module. Interactive devices such as display screens or buttons can also be set on the main control board 100, and the user can select the required test case through the display screen, buttons, etc.
[0066] The main control board 100 serves as the main part of the electronic controller testing device, and the main control chip 200, bus communication module 300, storage module 400, state switching module 500, and output module are all integrated on the main control board 100; the electronic controller testing device includes relevant functional devices required by the electronic controller, and the electronic controller testing device can be used to independently complete the test of the electronic controller.
[0067] In this embodiment, a main control chip 200, a bus communication module 300, a storage module 400, and a state switching module 500 are arranged on the main control board 100, so that the electronic controller testing device based on the main control board 100 can meet the functional requirements of data calculation, communication, test cases, and state switching for testing the electronic controller; because each module is integrated into the main control board 100, no wiring is required during use, which reduces costs and is easy to carry.
[0068] Further, see Figure 2 The bus communication module 300 includes a plurality of bus controllers 310, and each of the bus controllers 310 is respectively connected to a group of bus interfaces of the electronic controller.
[0069] In actual applications, the electronic controller may be provided with multiple groups of bus interfaces. Therefore, when testing the electronic controller, it is necessary to test all the groups of bus interfaces. In this embodiment, multiple bus controllers 310 are provided, and each bus controller 310 is connected to a group of bus interfaces. When testing, the communication data of the connected bus interfaces is received by the bus controller 310, and the group of bus interfaces is tested based on the communication data.
[0070] It can be understood that the number of bus interfaces is specifically set based on the bus type. For example, for the CAN bus, it includes two bus interfaces, the CAN high line and the CAN low line. Therefore, when setting the bus controller 310, one bus controller 310 is connected to a group of two bus interfaces corresponding to the CAN high line and the CAN low line.
[0071] Furthermore, the state switching module 500 includes a relay switch K1 and a voltage-stabilized power supply 510; wherein:
[0072] The control end of the relay switch K1 is connected to the main control chip 200 , the first contact of the relay switch K1 is connected to the voltage-stabilized power supply 510 , and the second contact of the relay switch K1 is connected to the wake-up end of the electronic controller.
[0073] The two contacts of the relay switch K1 are respectively connected to the voltage-stabilized power supply 510 and the wake-up end of the electronic controller. Under the control of the main control chip 200, the first contact and the second contact switch between closed and open states; when the first contact and the second contact are closed, the voltage of the voltage-stabilized power supply 510 reaches the wake-up end of the electronic controller through the first contact and the second contact; when the first contact and the second contact are disconnected, the voltage of the voltage-stabilized power supply 510 cannot reach the wake-up end of the electronic controller through the first contact and the second contact.
[0074] When the voltage of the voltage-stabilized power supply 510 reaches the awakening terminal of the electronic controller through the first contact and the second contact, the electronic controller is awakened from the sleep state.
[0075] The wake-up end of the electronic controller may be determined based on a specific model of the electronic controller. Generally, the wake-up end of the electronic controller is the KL15 pin.
[0076] It should be noted that, in addition to waking up the electronic controller, the voltage-stabilized power supply 510 can also supply power to electrical devices in the electronic controller testing device.
[0077] The present invention provides an electronic controller testing method, referring to Figure 3 , Figure 3 This is a flow chart of a first embodiment of an electronic controller testing method of the present invention. The electronic controller testing method is applied to the electronic controller testing device as described above. The method comprises the following steps:
[0078] Step S10, if the test case is triggered, the electronic controller is switched to the running state of the test case, wherein the running state is switched by sending a switch signal to a state switching module, or by sending a state signal through a bus communication module;
[0079] Test cases are used to indicate specific test content, including but not limited to test data, test processes, test functions, and test qualification conditions; test cases can be set based on the actual needs of the electronic controller; for example, the network management test case of the electronic controller can be obtained in advance, and the test case can be written according to the network management test case; test cases can be triggered automatically or manually, such as specific test cases can be set in the storage module, and after the electronic controller test device is connected to the electronic controller and is ready, the main control chip automatically calls the test case to test the electronic controller; multiple test cases can also be set in the storage module, and the user can select the test case to be executed based on the actual test needs; in realizing the selection of test cases, relevant interactive modules can be set; such as selecting test cases through external devices connected to the output module, and interactive devices such as display screens or buttons can also be set on the main control board, and the user can select the required test cases through the display screen, buttons, etc.
[0080] Different test cases may have different operating states for the electronic controller. Therefore, the operating state of the electronic controller should be switched to correspond to the test case, and then the electronic controller should be tested in the corresponding operating state. The operating state of the electronic controller can be switched in a variety of ways; for example, the electronic controller can be awakened from the sleep state by the state switching module acting on the wake-up end of the electronic controller, or by sending a state signal to the electronic controller, and the electronic controller switches the operating state based on the received state information.
[0081] Step S20, acquiring communication data received by the bus communication module;
[0082] The communication data is the relevant data sent by the electronic controller through the bus interface and received by the bus communication module. It is understandable that the communication data output by the electronic controller is related to its operating state, and the communication data sent under different operating states are different.
[0083] It is understandable that under some conditions, the electronic controller will trigger the sending of communication data, such as when the state is switched, the default setting under a specific operating state, or a reply based on the data sent by the bus controller. Therefore, when the communication data should be received, the bus controller is monitored. If the communication data sent by the electronic controller is not received within a certain period of time, the test is considered to have failed; if the communication data sent by the electronic controller is received within a certain period of time, subsequent operations are performed based on the communication data.
[0084] Step S30, testing the electronic controller according to the test case and the communication data in different operating states of the electronic controller to obtain a test report.
[0085] The test case includes the test pass conditions; therefore, after obtaining the communication data under a certain operating state, it is possible to determine whether the electronic controller has passed the test based on the test case and generate a specific test report; the test report may include test results, communication data, test logs, etc.
[0086] After the test report is obtained, the test report can be stored in a storage module, displayed on a display screen, or output to an external device through an output module.
[0087] This embodiment arranges a main control chip, a bus communication module, a storage module, and a state switching module on the main control board, so that the electronic controller testing device based on the main control board can meet the functional requirements of data calculation, communication, test cases, and state switching for testing the electronic controller; because each module is integrated into the main control board, no wiring is required during use, which reduces costs and is easy to carry.
[0088] Further, in a second embodiment of the electronic controller testing method of the present invention proposed based on the first embodiment of the present invention, after the state switching module is closed and triggers the electronic controller to wake up, the step S30 includes the following steps:
[0089] Step S31, determining the current operating state of the electronic controller, and determining the target communication parameters corresponding to the current operating state in the test case;
[0090] Step S32: testing the electronic controller according to the target communication parameters and the communication data.
[0091] The electronic controller has different corresponding communication parameters under different operating states. The communication parameters are used to indicate the transmission characteristics of the communication data. The communication parameters include but are not limited to the status flag and the sending cycle.
[0092] The operation state of the electronic controller can be set based on actual needs; for example, the operation state can include a dormant state DSM, an active wake-up state RMS, a normal transmission state NORMAL, a ready bus dormant state RSS, and a ready bus dormant state PDSM;
[0093] The active awakening state also includes two stages: fast and slow.
[0094] In the sleep state, the electronic controller does not send communication data; when switching to the bus sleep state or preparing for the bus sleep state, the electronic controller can send status information; in the fast sending stage, the slow sending stage and the normal sending state, there are differences in the communication parameters for sending communication data, such as in the fast sending stage, the sending cycle is 20ms, and the communication data is sent 10 times; in the slow sending stage, the sending cycle is 1ms, and the communication data is sent 1 time.
[0095] After the electronic controller is awakened from the sleep state, it first enters the fast sending stage, sends 10 times with a sending period of 20ms, and then switches to the slow sending stage. After sending once with a sending period of 1ms, it waits for 3-5s and then switches to the normal sending state. The above specific values are for example only. In actual applications, they can be set based on actual needs.
[0096] In the normal sending state, if no data is received within a certain period of time, or there is no voltage input to the KL15 pin, the normal sending state is switched to the ready bus sleep state; in the ready bus sleep state, if data is received within a certain period of time, or there is voltage input to the KL15 pin, it is switched to the normal sending state again. If no data is received within a certain period of time and there is no voltage input to the KL15 pin, it is switched from the ready bus sleep state to the sleep state.
[0097] It can be seen that the switching of different operating states of the electronic controller is based on certain rules, and the corresponding communication parameters are different in different states; therefore, the corresponding communication parameters in different operating states can be set in the test case in advance based on the specific settings of the electronic controller to constitute the target communication parameters; in the specific test, the corresponding target communication parameters in the operating state are used as the evaluation criteria to judge the communication data, thereby realizing the test of the electronic controller.
[0098] Furthermore, the step S32 includes the steps of:
[0099] Step S321, determining the state flag in the communication data and the target flag in the target communication parameter;
[0100] Step S322, determining whether the state flag is the same as the target flag;
[0101] Step S323: If the status flag is different from the target flag, it is determined that the test has failed.
[0102] If the status flag is the same as the target flag, the flag test passes.
[0103] The communication data sent by the electronic controller under different operating states will have corresponding status flags set based on the current operating state; that is, when in the fast sending stage, the status flag corresponding to the fast sending stage is set in the communication data sent, and when in the slow sending stage, the status flag corresponding to the slow sending stage is set in the communication data sent, and when in the normal sending state, the status flag corresponding to the normal sending state is set in the communication data sent; and so on.
[0104] The target communication parameters are pre-set with flags corresponding to different operating states, namely, target flags. After receiving the communication data, the status flag in the communication data is determined. When the status flag is the same as the target flag, it is considered that the status flag of the electronic controller is correct, so the flag test passes; when the status flag is different from the target flag, it is considered that the status flag of the electronic controller is wrong and the test fails.
[0105] Furthermore, the step S32 includes the steps of:
[0106] Step S321, obtaining a time difference between two consecutive frames of data in the communication data;
[0107] Step S322, determining a target sending interval in the target communication parameter, and judging whether the time difference matches the target sending interval;
[0108] Step S323: If the time difference does not match the target sending interval, it is determined that the test has failed.
[0109] From the above description, it can be seen that the communication data sending cycle of the electronic controller is different in different operating states. For example, in the fast sending stage, the sending cycle is 20ms, and the communication data is sent 10 times; in the slow sending stage, the sending cycle is 1ms, and the communication data is sent 1 time.
[0110] Taking the fast sending stage as an example, its sending cycle is 20ms, and the corresponding target sending interval is 20ms; therefore, the time difference between two consecutive data frames is 20ms; it should be noted that when the electronic controller sends a data frame, it will set a sending timestamp in the data frame. Therefore, after receiving the data frame, the sending time of the data frame is determined according to the timestamp in the data frame, and the time difference is determined according to the difference between the sending times of two consecutive data frames.
[0111] When the time difference matches the target sending interval, it is considered that the electronic controller sends communication data based on the correct sending cycle, and the confirmation time parameter test passes; when the time difference does not match the target sending interval, it is considered that the electronic controller sends communication data based on the wrong sending cycle, and the confirmation time parameter test fails.
[0112] Further, in a third embodiment of the electronic controller testing method of the present invention proposed based on the first embodiment of the present invention, the step before step S10 includes the following steps:
[0113] Step S40, after the electronic controller disconnects the power supply, sending a closing signal to the relay switch in the state switching module, and collecting the voltage difference between the two ends of the relay switch;
[0114] Step S50, determining whether the voltage difference between the two ends is less than a preset voltage difference;
[0115] Step S60: If the voltage difference between the two ends is less than the preset voltage difference, the self-test passes.
[0116] It is understandable that the electronic controller test device, as a test execution device, should perform its functions accurately; therefore, before testing the electronic controller, it is necessary to perform a self-test on the electronic controller test device.
[0117] The relay switch is used to transmit the voltage output by the voltage-stabilized power supply to the wake-up end of the electronic controller; if the relay switch has high loss during transmission, it will affect the wake-up of the electronic controller, so it is necessary to perform self-inspection on the voltage loss of the relay; specifically, the two ends of the relay switch are connected to the voltage-stabilized power supply and the wake-up end of the electronic controller respectively, so the voltage difference between the two ends of the relay switch is the voltage input from the voltage-stabilized power supply to the relay switch minus the voltage output from the relay switch to the electronic controller, when there is no voltage loss in the relay switch, the voltage difference between the two ends of the relay switch is 0, and the voltage input to the relay switch is equal to the voltage output to the wake-up end of the electronic controller; in actual applications, due to reasons such as detection accuracy and line resistance, it may not be possible to achieve zero voltage loss, so when the voltage loss of the relay switch is within the allowable range, it is considered that the relay switch self-inspection has passed.
[0118] The voltage difference between the two ends essentially reflects the voltage loss of the relay switch. Therefore, by setting the preset voltage difference, the allowable voltage loss of the relay switch is limited. When the voltage difference between the two ends is less than the preset voltage difference, it is considered that the voltage loss of the relay switch is within the allowable range and the relay switch self-test passes; when the voltage difference between the two ends is greater than the preset voltage difference, it is considered that the voltage loss of the relay switch is too large and the relay switch self-test fails. The specific value of the preset voltage difference can be set based on actual needs.
[0119] In other embodiments, it is also possible to directly determine whether the voltages at both ends of the relay switch are consistent. If they are consistent, the self-test passes.
[0120] Furthermore, the step before step S10 includes the following steps:
[0121] Step S70, setting the communication mode of the bus communication module to a loopback mode, and controlling the bus communication module to send test data;
[0122] Step S80, obtaining the test loopback data received by the bus communication module, and determining whether the test loopback data is consistent with the test data;
[0123] Step S90: If the test loop data is consistent with the test data, the self-check passes.
[0124] The bus communication module is used to communicate with the electronic controller. Therefore, the communication function of the bus communication module itself should be normal, and the bus communication module needs to be self-checked. Specifically, each bus controller in the bus communication module needs to be self-checked respectively; specifically, the function of the bus controller relies on the sending and receiving of data; in the loopback mode, the data sent to the bus by the bus controller will be returned to the bus controller. Therefore, in this embodiment, the sending and receiving functions of the bus controller are tested in the loopback mode.
[0125] The bus controller is controlled to send test data to the bus. If the test data is not received within the preset loopback time, it means that there is a problem with the sending or receiving function and the self-test fails. If the test data, i.e., the test loopback data, is received within the preset loopback time, the sent test data is compared with the test loopback data. If the test data is consistent with the test loopback data, it is considered that the sending and receiving functions of the bus controller are normal and the self-test passes. If the test data is inconsistent with the test loopback data, it is considered that the sending and receiving functions of the bus controller are abnormal and the self-test fails.
[0126] The following is based on Figures 4 to 8 The overall implementation process of the present invention is described as follows:
[0127] 1. Connect the power supply terminal BAT and ground terminal GND of the voltage regulator to the power supply terminal BAT and ground terminal GND of the main control board and the ECU under test respectively, then connect the KL15 pin of the ECU under test to the second contact of the relay switch of the main control board, and finally connect the CAN interface of the ECU under test to be tested to the CAN bus controller of the main control board;
[0128] 2. According to the network management test case of the ECU under test, use the code editing tool to code and design the test case, power on the main control board, and burn the test case into the storage module of the main control board;
[0129] 3. The user logs in to the system through the main control panel display screen. If the account and password are successfully verified, proceed to the next step. If not, return to step 3;
[0130] 4. Disconnect the power supply of the ECU under test and the main control board will perform self-test;
[0131] 4.1. Control the relay switch to close, collect the voltage at both ends of the relay switch, and determine whether the voltages at both ends are consistent. If they are inconsistent, the display screen will show self-test failure and the program will exit. If they are consistent, the self-test passes;
[0132] 4.2. The program sets the bus controller to loopback mode and sends test data of a specified size. If no data is received within 5 seconds, the display shows self-test failure and the program exits. If the program receives data, it will compare it with the sent test data one by one. If they are inconsistent, the display shows self-test failure and the program exits. If they are consistent, the self-test passes.
[0133] 5. If the self-test passes, set the bus controller (CAN1~CANn) that the main control board needs to use through the display screen, set its baud rate, bus protocol type, and whether to enable the terminal resistance, and turn on the power supply of the ECU under test;
[0134] 6. Select the test case to be executed. All current test cases are displayed on the screen. All are checked by default. The user selects the test case to be executed;
[0135] 7. Execute test cases and display test progress. After the test is completed, display test results and output test reports, and export test data;
[0136] 7.1. Control the relay to close and set the CAN controller to normal transmission mode, and start logging to record bus message data;
[0137] 7.2. Add the test cases selected by the user to the task list and wait for the system call to execute;
[0138] 7.3. Determine whether there is any message received and any error frame generated on the corresponding CAN bus in the wake-up test. If no message is received or an error frame is generated, the test is judged to have failed. The display screen shows the result as fail, and the timestamp of the wake-up is output to the test report;
[0139] 7.4. Determine whether the corresponding time parameters and status bits during the wake-up test and state switching process are correct. If not, the test result is judged to be failed, and the display screen displays the result as fail, and outputs each time parameter and status bit to the test report;
[0140] 7.5 Determine whether the system status changes normally during the status jump process. If not, the test result is judged to be a failure, the display screen displays the result as fail, and the system status is output to the test report;
[0141] 7.6. When the test case is finished, the display screen shows the overall test results and the program stops logging;
[0142] 7.7. Users can connect the main control board via USB as needed to export test reports and test data for statistical analysis of results;
[0143] 8. If you need to perform the test again, repeat steps 6 to 7;
[0144] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0146] The main control chip in the electronic controller testing device is used to implement the above electronic controller testing method, and the main control chip includes:
[0147] A first switching module, used for switching the electronic controller to the running state of the test case if the test case is triggered, wherein the running state is switched by sending a switch signal to the state switching module or sending a state signal through the bus communication module;
[0148] A first acquisition module, used for acquiring communication data received by the bus communication module;
[0149] The first test module is used to test the electronic controller according to the test case and the communication data under different operating states of the electronic controller to obtain a test report.
[0150] The main control chip, bus communication module, storage module and state switching module are arranged on the main control board, so that the electronic controller test device based on the main control board can meet the functional requirements of data calculation, communication, test cases and state switching for testing the electronic controller; because each module is integrated into the main control board, no wiring is required during use, which reduces the cost and is easy to carry.
[0151] It should be noted that the first switching module in this embodiment can be used to execute step S10 in the embodiment of the present application, the first acquisition module in this embodiment can be used to execute step S20 in the embodiment of the present application, and the first testing module in this embodiment can be used to execute step S30 in the embodiment of the present application.
[0152] Further, after the state switching module is closed and triggers the electronic controller to wake up, the first test module includes:
[0153] a first determining unit, configured to determine a current operating state of the electronic controller and determine a target communication parameter corresponding to the current operating state in the test case;
[0154] The first testing unit is used to test the electronic controller according to the target communication parameters and the communication data.
[0155] Furthermore, the first test unit includes:
[0156] A first determining subunit, used to determine a state flag in the communication data and a target flag in the target communication parameter;
[0157] A first judging subunit, used to judge whether the state flag is the same as the target flag;
[0158] The second determining subunit is used to determine that the test fails if the state flag bit is different from the target flag bit.
[0159] Furthermore, the first test unit includes:
[0160] A first acquisition subunit is used to acquire a time difference between two consecutive data frames in the communication data;
[0161] A third determining subunit, configured to determine a target sending interval in the target communication parameter, and determine whether the time difference matches the target sending interval;
[0162] The fourth determining subunit is configured to determine that the test fails if the time difference does not match the target sending interval.
[0163] Furthermore, the main control chip also includes:
[0164] A first sending module, used for sending a closing signal to the relay switch in the state switching module after the electronic controller is disconnected from the power supply, and collecting the voltage difference between the two ends of the relay switch;
[0165] A first judging module, used for judging whether the voltage difference between the two ends is less than a preset voltage difference;
[0166] The first execution module is used for judging that the self-test is passed if the voltage difference between the two ends is less than the preset voltage difference.
[0167] Furthermore, the main control chip also includes:
[0168] A first setting module, used to set the communication mode of the bus communication module to a loopback mode, and control the bus communication module to send test data;
[0169] A second acquisition module, used for acquiring the test loopback data received by the bus communication module, and determining whether the test loopback data is consistent with the test data;
[0170] The second execution module is used to determine that the self-check is passed if the test loop data is consistent with the test data.
[0171] Reference Fig. 9 In terms of hardware structure, the electronic device may include components such as a communication module 10, a memory 20, and a processor 30. In the electronic device, the processor 30 is connected to the memory 20 and the communication module 10 respectively, and a computer program is stored in the memory 20. The computer program is executed by the processor 30 at the same time, and the steps of the above method embodiment are implemented when the computer program is executed.
[0172] The communication module 10 can be connected to an external communication device through a network. The communication module 10 can receive requests from an external communication device, and can also send requests, instructions and information to the external communication device, which can be other electronic devices, servers or Internet of Things devices, such as televisions, etc.
[0173] The memory 20 can be used to store software programs and various data. The memory 20 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as switching the electronic controller to the running state of the test case), etc.; the data storage area can include a database, and the data storage area can store data or information created according to the use of the system, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0174] The processor 30 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 20, and calling data stored in the memory 20, so as to monitor the electronic device as a whole. The processor 30 may include one or more processing units; optionally, the processor 30 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 30.
[0175] although Fig. 9 Although not shown, the electronic device may further include a circuit control module, which is used to connect to a power source to ensure the normal operation of other components. Fig. 9 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0176] The present invention also provides a computer-readable storage medium on which a computer program is stored. The computer-readable storage medium may be Fig. 9 The memory 20 in the electronic device may also be at least one of a ROM (Read-Only Memory) / RAM (Random Access Memory), a magnetic disk, and an optical disk. The computer-readable storage medium includes a number of instructions for enabling a terminal device with a processor (which may be a television, a car, a mobile phone, a computer, a server, a terminal, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0177] In the present invention, the terms "first", "second", "third", "fourth" and "fifth" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0178] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0179] Although the embodiments of the present invention have been shown and described above, the scope of protection of the present invention is not limited thereto. It is understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art can change, modify and replace the above embodiments within the scope of the present invention, and these changes, modifications and replacements should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. An electronic controller testing device, It is characterized in that The electronic controller test device comprises a main control board and a main control chip, a bus communication module, a storage module, and a state switching module arranged on the main control board; the main control chip is respectively connected to the control end of the state switching module, the storage module, and the bus communication module, the bus communication module is connected to the bus interface of the electronic controller, and the state switching module is connected to the wake-up end of the electronic controller; wherein: The bus communication module is used to communicate with the electronic controller based on the bus to obtain communication data; The storage module is used to store test cases; The state switching module is used to control the wake-up terminal voltage of the electronic controller to switch the operating state of the electronic controller; The main control chip is used to test the electronic controller under different operating states of the electronic controller based on the test case and the communication data to obtain a test report.
2. The electronic controller testing device according to claim 1, It is characterized in that The bus communication module includes a plurality of bus controllers, each of which is respectively connected to a group of bus interfaces of the electronic controller.
3. The electronic controller testing device according to claim 1, It is characterized in that The state switching module includes a relay switch and a voltage-stabilized power supply; wherein: The control end of the relay switch is connected to the main control chip, the first contact of the relay switch is connected to the voltage-stabilized power supply, and the second contact of the relay switch is connected to the wake-up end of the electronic controller.
4. A method for testing an electronic controller, It is characterized in that The electronic controller testing method is applied to the electronic controller testing device according to any one of claims 1 to 3, and the electronic controller testing method comprises: If a test case is triggered, the electronic controller is switched to the running state of the test case, wherein the running state is switched by sending a switch signal to a state switching module, or by sending a state signal through a bus communication module; Obtaining communication data received by the bus communication module; Under different operating states of the electronic controller, the electronic controller is tested according to the test case and the communication data to obtain a test report.
5. The electronic controller testing method as claimed in claim 4, It is characterized in that After the state switching module is closed and triggers the electronic controller to wake up, the electronic controller is tested according to the test case and the communication data under different operating states of the electronic controller; Outputting the test report through the output module includes: determining a current operating state of the electronic controller, and determining a target communication parameter corresponding to the current operating state in the test case; The electronic controller is tested according to the target communication parameters and the communication data.
6. The electronic controller testing method as claimed in claim 5, It is characterized in that The testing of the electronic controller according to the target communication parameter and the communication data comprises: Determining a status flag in the communication data and a target flag in the target communication parameter; Determining whether the state flag bit is the same as the target flag bit; If the state flag bit is different from the target flag bit, it is determined that the test fails.
7. The electronic controller testing method as claimed in claim 5, It is characterized in that The testing of the electronic controller according to the target communication parameter and the communication data comprises: Obtaining a time difference between two consecutive data frames in the communication data; Determine a target sending interval in the target communication parameter, and determine whether the time difference matches the target sending interval; If the time difference does not match the target sending interval, it is determined that the test has failed.
8. The electronic controller testing method as claimed in claim 4, It is characterized in that Before the electronic controller is switched to the running state of the test case if the test case is triggered, the method includes: After the electronic controller disconnects the power supply, a closing signal is sent to the relay switch in the state switching module, and a voltage difference between the two ends of the relay switch is collected; Determine whether the voltage difference between the two ends is less than a preset voltage difference; If the voltage difference between the two ends is less than the preset voltage difference, the self-test passes.
9. The electronic controller testing method as claimed in claim 4, It is characterized in that Before the electronic controller is switched to the running state of the test case if the test case is triggered, the method includes: Setting the communication mode of the bus communication module to a loopback mode, and controlling the bus communication module to send test data; Acquire the test loopback data received by the bus communication module, and determine whether the test loopback data is consistent with the test data; If the test loop data is consistent with the test data, the self-test passes.
10. An electronic device, It is characterized in that The electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the electronic controller testing method as claimed in any one of claims 3 to 9 when executed by the processor.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the electronic controller testing method according to any one of claims 3 to 9 are implemented.
Citation Information
Cited By
Function test method and device of electronic control unit, vehicle and storage medium
CN119556670A
Phased-array antenna chip self-checking method and device, phased-array antenna system and storage medium
CN121261812A
