A test system, a test method, a test device and a storage medium
Patent Information
- Application Number
- CN202311308248.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-10
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2043-10-10
AI Technical Summary
[0002]目前,基于I2C(Inter-Integrated Circuit)总线的应用场景越来越多,对于设备厂商而言,虽然均按照I2C总线的标准来生产主设备以及从设备,但是在实际应用时仍然可能出现主设备与从设备不适配的问题,此时可能是主设备存在异常,也可能是从设备存在异常
[0032]本申请实施例中,若从测试日志中提取出的测试返回值表征待测从设备输入/输出错误,从波形数据中提取出的电平数据表征待测从设备向待测主设备发送否认信号,且从波形数据中提取出的时序数据与标准时序数据相符,此时可以较为准确地判断出是待测主设备出现异常,且待测主设备的异常类型为通信地址发送错误。
Smart Images

Figure CN117331769B_ABST
Abstract
Description
[Technical Field]
[0001] This application relates to the field of testing technology, and in particular to a testing system, testing method, testing equipment, and storage medium. [Background Technology]
[0002] Currently, applications based on the I2C (Inter-Integrated Circuit) bus are becoming increasingly common. While equipment manufacturers produce master and slave devices according to the I2C bus standard, incompatibility issues may still arise in practical applications. This could be due to a malfunction in either the master or slave device. Therefore, testing the manufactured master and slave devices before they leave the factory is essential. [Summary of the Invention]
[0003] This application provides a testing system, testing method, testing equipment, and storage medium that can accurately test master and slave devices based on I2C protocol communication, thereby determining the communication status between the master and slave devices.
[0004] In a first aspect, embodiments of this application provide a testing system, the testing system including a testing device, a master device under test (DUT), an oscilloscope, and a slave device under test (DUT). The testing device is electrically connected to the DUT and the oscilloscope, the DUT is electrically connected to the slave device under test, and the oscilloscope is electrically connected to both the DUT and the slave device under test.
[0005] The testing equipment is used to send test instructions to the main device under test, and the test instructions carry target test cases.
[0006] The master device under test is used to respond to the test command and test the communication between the master device under test and the slave device under test based on the target test case.
[0007] The test equipment is also used to acquire waveform data from the oscilloscope during communication between the master device under test and the slave device under test after a set time interval following the sending of the test command, and to acquire test log data during communication between the master device under test and the slave device under test from the master device under test.
[0008] The testing equipment is also used to determine and output test results based on the waveform data and the test log data.
[0009] In this embodiment, the testing equipment can send target test cases to the master device under test (DUT) according to actual testing needs. After receiving the target test cases, the DUT can communicate with the slave device under test (DUT) based on them. After a set interval, the communication between the DUT and DUT can be considered complete. The testing equipment can then acquire waveform data generated during the communication between the DUT and DUT from an oscilloscope, and test logs generated during the communication between the DUT and DUT from the DUT itself. Combining the waveform data and test logs, the testing results are determined and output. In other words, this testing system can accurately test master and slave devices communicating based on the I2C protocol. For master device manufacturers, it allows for advance testing to ensure compatibility with mainstream slave devices; for slave device manufacturers, it allows for advance testing to ensure compatibility with mainstream master devices, avoiding large-scale recalls after shipment.
[0010] Optionally, the testing equipment is specifically used for:
[0011] The test equipment extracts the level data and timing data of the communication between the master device under test and the slave device under test from the waveform data;
[0012] The testing equipment extracts the test return value from the test log;
[0013] The testing equipment determines and outputs the test result based on the test return value, the level data, and the timing data.
[0014] In this embodiment of the application, the test device can extract level data and timing data from waveform data, and at the same time, the test device can extract test return values from the test log. Then, by combining the above-mentioned level data, timing data and test return values, the test result can be accurately determined.
[0015] Optionally, the test result indicates that the master device under test or the slave device under test is malfunctioning, and the test equipment is further used for:
[0016] Based on the correspondence between test results and anomaly resolution measures, determine and output the anomaly resolution measures corresponding to the anomaly of the master device under test, or the anomaly resolution measures corresponding to the anomaly of the slave device under test.
[0017] In this embodiment of the application, when the master device or slave device under test is abnormal, the test device can output targeted abnormality resolution measures, so that subsequent R&D personnel can solve the abnormality according to the above abnormality resolution measures, thereby improving the efficiency of abnormality resolution.
[0018] Optionally, the testing equipment is specifically used for:
[0019] In response to the test return value indicating that the device under test is in a busy state, the level data indicating that the device under test sends a denial signal to the master device under test during the test, and the timing data including part of the timing data in the standard timing data, the test device determines that the device under test is abnormal and outputs that the abnormality type of the device under test is a communication process connection abnormality.
[0020] In this embodiment of the application, if the test return value extracted from the test log indicates that the device under test is in a busy state, the level data extracted from the waveform data indicates that the device under test sends a denial signal to the master device under test, and the timing data extracted from the waveform data only includes a part of the standard timing data, that is, the timing data extracted from the waveform data is incomplete, then it can be determined more accurately that the device under test is abnormal, and the abnormality type of the device under test is a connection abnormality in the middle of the communication process.
[0021] Optionally, the testing equipment is specifically used for:
[0022] Based on the correspondence between test results and anomaly resolution measures, the anomaly type is determined and output as follows: when the communication process of the slave device under test is abnormal, the corresponding anomaly resolution measure is to replace the slave device under test.
[0023] In this embodiment of the application, the abnormality that occurs in the device under test can be considered to occur suddenly during the communication process. Therefore, it can be considered that the device under test suddenly becomes damaged. Thus, the solution provided by the test equipment can be to replace the device under test, so that the communication between the master device under test and the device under test can be restored as soon as possible.
[0024] Optionally, the testing equipment is specifically used for:
[0025] In response to the test return value indicating that the slave device under test does not exist, and both the timing data and the level data are empty, the test device determines that the slave device under test is abnormal and outputs that the abnormality type of the slave device under test is not connected.
[0026] In this embodiment of the application, if the test return value extracted from the test log indicates that the slave device under test does not exist, and the level data and timing data extracted from the waveform data are both empty, it can be determined more accurately that the slave device under test is abnormal, and the abnormality type of the slave device under test is that it is not connected to the master device under test.
[0027] Optionally, the testing equipment is specifically used for:
[0028] Based on the correspondence between test results and anomaly resolution measures, the anomaly type is determined and output as follows: when the slave device under test is not connected, the corresponding anomaly resolution measure is to reconnect the slave device under test.
[0029] In this embodiment of the application, the anomaly that occurs in the slave device under test can be considered to exist before the start of communication. Therefore, the solution provided by the test device can be to reconnect the slave device under test, so as to restore normal communication between the master device under test and the slave device under test as soon as possible.
[0030] Optionally, the testing equipment is specifically used for:
[0031] In response to the test return value indicating an input / output error of the slave device under test, the timing data matching the standard timing data, and the level data indicating that the slave device under test sends a denial signal to the master device under test during the test, the test device determines that the master device under test is abnormal and outputs that the abnormality type of the master device under test is a communication address transmission error.
[0032] In this embodiment of the application, if the test return value extracted from the test log indicates an input / output error of the device under test, the level data extracted from the waveform data indicates that the device under test sends a denial signal to the master device under test, and the timing data extracted from the waveform data matches the standard timing data, then it can be determined more accurately that the master device under test is malfunctioning, and the malfunction type of the master device under test is a communication address transmission error.
[0033] Optionally, the testing equipment is specifically used for:
[0034] Based on the correspondence between test results and anomaly resolution measures, the anomaly type is determined and output as follows: when the communication address of the master device under test is sent incorrectly, the corresponding anomaly resolution measure is to modify the communication address.
[0035] In this embodiment of the application, since the anomaly of the master device under test is an incorrect communication address sent to the slave device under test, the solution provided by the test device can be to modify the communication address, so as to restore normal communication between the master device under test and the slave device under test as soon as possible.
[0036] Secondly, embodiments of this application provide a testing method applied to the testing system described in any one of the first aspects, the method comprising:
[0037] The testing equipment sends a test instruction to the master device under test, the test instruction carrying a target test case, the target test case being used to test the communication between the master device under test and the slave device under test;
[0038] After sending the test command, the test device acquires waveform data from the oscilloscope during communication between the master device under test and the slave device under test after a set time interval, and acquires test log data from the master device under test during communication between the master device under test and the slave device under test.
[0039] The testing equipment determines and outputs the test results based on the waveform data and the test log data.
[0040] Optionally, the testing equipment determines and outputs the test results based on the waveform data and the test log data, including:
[0041] The test equipment extracts the level data and timing data of the communication between the master device under test and the slave device under test from the waveform data;
[0042] The testing equipment extracts the test return value from the test log;
[0043] The testing equipment determines and outputs the test result based on the test return value, the level data, and the timing data.
[0044] Optionally, if the test result indicates that the master device under test or the slave device under test is malfunctioning, the method further includes:
[0045] Based on the correspondence between test results and anomaly resolution measures, determine and output the anomaly resolution measures corresponding to the anomaly of the master device under test, or the anomaly resolution measures corresponding to the anomaly of the slave device under test.
[0046] Optionally, the testing equipment determines and outputs the test result based on the test return value, the level data, and the timing data, including:
[0047] In response to the test return value indicating that the device under test is in a busy state, the level data indicating that the device under test sends a denial signal to the master device under test during the test, and the timing data including part of the timing data in the standard timing data, the test device determines that the device under test is abnormal and outputs that the abnormality type of the device under test is a communication process connection abnormality.
[0048] Optionally, based on the correspondence between test results and anomaly resolution measures, determine and output the anomaly resolution measures corresponding to the anomaly of the slave device under test, including:
[0049] Based on the correspondence between test results and anomaly resolution measures, the anomaly type is determined and output as follows: when the communication process of the slave device under test is abnormal, the corresponding anomaly resolution measure is to replace the slave device under test.
[0050] Optionally, the testing equipment determines and outputs the test result based on the test return value, the level data, and the timing data, including:
[0051] In response to the test return value indicating that the slave device under test does not exist, and both the timing data and the level data are empty, the test device determines that the slave device under test is abnormal and outputs that the abnormality type of the slave device under test is not connected.
[0052] Optionally, based on the correspondence between test results and anomaly resolution measures, determine and output the anomaly resolution measures corresponding to the anomaly of the slave device under test, including:
[0053] Based on the correspondence between test results and anomaly resolution measures, the anomaly type is determined and output as follows: when the slave device under test is not connected, the corresponding anomaly resolution measure is to reconnect the slave device under test.
[0054] Optionally, the testing equipment determines and outputs the test result based on the test return value, the level data, and the timing data, including:
[0055] In response to the test return value indicating an input / output error of the slave device under test, the timing data matching the standard timing data, and the level data indicating that the slave device under test sends a denial signal to the master device under test during the test, the test device determines that the master device under test is abnormal and outputs that the abnormality type of the master device under test is a communication address transmission error.
[0056] Optionally, based on the correspondence between test results and anomaly resolution measures, determine and output the anomaly resolution measures corresponding to the anomaly of the slave device under test, including:
[0057] Based on the correspondence between test results and anomaly resolution measures, the anomaly type is determined and output as follows: when the communication address of the master device under test is sent incorrectly, the corresponding anomaly resolution measure is to modify the communication address.
[0058] Thirdly, embodiments of this application provide a testing device, the testing device including a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the testing device is triggered to perform the steps of the method as described in any embodiment of the second aspect.
[0059] Fourthly, embodiments of this application provide a computer-readable storage medium for storing computer instructions that, when the computer is run, cause the computer to perform the steps of the method as described in any embodiment of the second aspect.
[0060] It should be understood that the second to fourth aspects of the embodiments of this application are consistent with the technical solutions of the first aspect of the embodiments of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be described again. [Attached Image Description]
[0061] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0062] Figure 1 An architecture diagram of a testing system provided in an embodiment of this application;
[0063] Figure 2 A timing diagram of I2C signals under normal communication conditions is provided for embodiments of this application;
[0064] Figure 3 A flowchart illustrating a testing method provided in an embodiment of this application;
[0065] Figure 4 A flowchart illustrating a method for determining test results provided in an embodiment of this application;
[0066] Figure 5 A flowchart illustrating a method for resolving output anomalies provided in an embodiment of this application;
[0067] Figure 6 An architecture diagram of another testing system provided in this application embodiment;
[0068] Figure 7 This is a schematic diagram of the structure of a testing device provided in an embodiment of this application;
[0069] Figure 8 This is a schematic diagram of the structure of a testing device provided in an embodiment of this application.
Detailed Implementation Methods
[0070] To better understand the technical solutions in this specification, the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0071] It should be understood that the described embodiments are merely some, not all, of the embodiments in this specification. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without inventive effort are within the scope of protection of this specification.
[0072] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0073] The communication principle based on the I2C bus will be explained below.
[0074] The I2C bus is a commonly used serial communication protocol with a serial data line (SDA) and a serial clock line (SCL). SDA is used for data transmission, and SCL is used to control the timing of data transmission. The following is an explanation of the communication principle of the I2C bus:
[0075] Start condition: When an I2C communication begins, the master device (such as a microcontroller) sends a start condition to the bus, which is to pull SDA from high level to low level while keeping SCL high.
[0076] Sending Address and Read / Write Flag: The master device sends a 7-bit slave device address code and a read / write control flag to the bus, indicating whether the slave device to be accessed is for a read or write operation. The address code needs to be specified by each device; some devices use external hard-wired settings, while others require programming settings.
[0077] Slave Acknowledgment: Upon receiving the address and read / write control flags, the slave device sends an acknowledgment signal (ACK) to inform the master device that it is willing to respond to the operation. If the slave device cannot respond, it sends a denial signal (NACK), and the master device decides whether to try again.
[0078] Data transmission: The master device begins transmitting data. After transmitting each byte, it waits for an ACK signal from the slave device, indicating that the correct data has been received, before the master device can continue transmitting the next byte. If the slave device cannot receive the data, it will send a NACK signal and terminate the transmission.
[0079] Stop condition: After completing data transmission, the master device sends a stop condition, which involves pulling SCL from low to high while keeping SDA high. This indicates that the I2C communication is complete.
[0080] Currently, there are more and more application scenarios based on I2C (Inter-Integrated Circuit) bus. For example, it is used in embedded systems for communication between microcontrollers and various sensors (temperature sensors, humidity sensors, gravity sensors, barometric pressure sensors, etc.), communication between microcontrollers and camera chips, or communication between microcontrollers and touch screen chips.
[0081] For equipment manufacturers, although they all produce master devices (such as microcontrollers) and slave devices (such as sensors, camera chips, touch screen chips, etc.) according to the I2C bus standard, incompatibility issues between master and slave devices may still occur in practical applications. This could be due to a malfunction in either the master or the slave device. Therefore, it is essential to test the master and slave devices produced before they leave the factory.
[0082] In view of this, this application provides a testing system in which the testing equipment can send target test cases to the master device under test (DUT) according to actual testing needs. After receiving the target test cases, the DUT can communicate with the slave device under test (DUT) according to the target test cases. After a set interval, the communication between the DUT and the DUT can be considered to have ended. Then, the testing equipment can acquire waveform data generated during the communication between the DUT and the DUT from an oscilloscope, and acquire test logs generated during the communication between the DUT and the DUT from the DUT. Combining the waveform data and test logs, the testing results are determined and output. In other words, this testing system can accurately perform bidirectional testing on master and slave devices communicating based on the I2C protocol. For master device manufacturers, it allows them to test in advance whether their produced master devices are compatible with mainstream slave devices; for slave device manufacturers, it allows them to test in advance whether their produced slave devices are compatible with mainstream master devices, avoiding large-scale recalls after the devices are shipped.
[0083] Please see Figure 1 This is an architecture diagram of a testing system provided in an embodiment of this application. Figure 1 As shown, the test system includes a test device 101, a master device under test (DUT) 102, an oscilloscope 103, and a slave device under test (DUT) 104. The master device under test 102 and the slave device under test 104 are electrically connected. The oscilloscope 103 is electrically connected to both the master device under test 102 and the slave device under test 104. The test device 101 is electrically connected to both the master device under test 102 and the oscilloscope 103. The master device under test 102 and the slave device under test 104 can communicate via an I2C bus, and the communication process is recorded in a test log. It is particularly noteworthy that the test return values in the test log will change depending on the specific circumstances of the communication process (normal or different types of anomalies). The oscilloscope 103 is used to detect the waveform data generated during communication between the master device under test 102 and the slave device under test 104. Please refer to... Figure 2 This is a timing diagram of I2C signals under normal communication conditions provided in an embodiment of this application. Figure 2As shown, the waveform data reflects timing data (the specific meaning of the timing data is shown in Table 1 below) and level data (high level 1 represents the NACK signal, and low level 0 represents the ACK signal). The test equipment 101 is equipped with intelligent analysis software, which can be used to analyze the communication process between the master device under test 102 and the slave device under test 104 based on the I2C bus, thereby determining the test results.
[0084] Table 1
[0085]
[0086]
[0087] The technical solutions provided in the embodiments of this application will now be described in conjunction with the accompanying drawings.
[0088] Please see Figure 3 This is a flowchart illustrating a testing method provided in an embodiment of this application, as shown below. Figure 1 The test system shown is described in the following flowchart:
[0089] Step 201: The test equipment sends a test command to the device under test.
[0090] In this embodiment, the tester can edit target test cases in the test device. These target test cases include at least the address, register address, operation type (read or write operation), and operation parameters (parameters for read and write operations). The specific content of the target test cases is not particularly limited here. After the target test cases are written, the test device can send test instructions to the master device under test, which contain the target test cases. It should be understood that the target test cases are used to perform at least one test.
[0091] Step 202: The master device under test responds to the test command and tests the communication between the master device under test and the slave device under test based on the target test case.
[0092] In this embodiment of the application, after the master device under test receives the target test case from the test device, it can perform communication tests with the slave device under test based on the test content defined in the target test case.
[0093] For example, the test item defined in the target test case is: the master device under test writes a value to the slave device under test, which includes the following process:
[0094] 1. The device under test initiates START;
[0095] 2. The master device under test sends a 7-bit slave device address (I2C addr) and a 1-bit w operation 0, and waits for the ACK signal;
[0096] 3. The device under test sends an ACK signal;
[0097] 4. The master device under test sends an 8-bit register address (reg addr) and waits for the ACK signal;
[0098] 5. The device under test sends an ACK signal;
[0099] 6. The device under test sends 8 bits of data, which is the data to be written into the register, and waits for ACK;
[0100] 7. The device under test sends an ACK signal;
[0101] 8. Steps 6 and 7 can be repeated multiple times, i.e., writing to multiple registers sequentially;
[0102] 9. The device under test initiates a STOP.
[0103] It should be understood that writing a single byte involves the process of 1 / 2 / 3 / 4 / 5 / 6 / 7 / 9, and this process needs to be fully monitored. Here, 1 corresponds to t. HD:STA ;2 corresponds to t SU:DAT , t HD:DAT ; 3 corresponds to the ACK bit; 4 corresponds to the t bit. SU:DAT , t HD:DAT ; 5 corresponds to the ACK bit; 6 corresponds to the t bit. SU:DAT , t HD:DAT 7 corresponds to the ACK bit; 9 corresponds to the measurement t. SU:STO .
[0104] Step 203: After sending the test command, the test device acquires waveform data from the oscilloscope at a set interval.
[0105] Step 204: The test device obtains test log data from the master device under test (DUT) during communication between the master device under test and the slave device under test (SUT).
[0106] In this embodiment, when the master device under test (DUT) communicates with the slave device under test (DUT) based on the target test case, the communication may be normal or abnormal. Under normal communication conditions, the test can usually be completed automatically within a short time. However, under abnormal communication conditions, the slave device under test may not respond to the master device under test for a considerable period, causing the test process to fail to terminate automatically for an extended period. Therefore, if the master device under test determines that the test duration exceeds a set threshold, it will forcibly terminate the current test. After the communication test between the master device under test and the slave device under test is completed, the waveform data in the oscilloscope and the test log in the master device under test can be considered to include complete data from the start to the end of the test. The test device can then acquire waveform data from the oscilloscope and test log data from the master device under test after a set interval between sending test commands, in order to prepare for subsequent analysis of the test results. It should be understood that the aforementioned set interval should not be less than the set threshold corresponding to when the master device under test forcibly stops the test.
[0107] Step 205: The test equipment determines and outputs the test results based on the waveform data and test log data.
[0108] In this embodiment, after acquiring waveform data and test log data respectively, the testing device can analyze the test results by combining the test log data and waveform data. The test results are then output, and the output format includes, but is not limited to, voice, text, or video. No particular limitation is made here.
[0109] It should be understood that in the above embodiments, neither the master device under test nor the slave device under test needs to be a mature device. The test results can be that both the master device under test and the slave device under test are normal, only the master device under test is abnormal, or only the slave device under test is abnormal.
[0110] In some embodiments, the waveform data acquired by the oscilloscope typically includes timing data and level data, and the test log data typically includes the test return value of the system running by the device under test. Therefore, in this embodiment, the timing data, level data, and test return value can be combined to jointly analyze the test and results.
[0111] Please see Figure 4 This is a flowchart illustrating a method for determining test results provided in an embodiment of this application. Step 205 can be specifically implemented by executing sub-steps 2051 to 2053:
[0112] Step 2051: The test equipment extracts the level data and timing data of the communication between the master device under test and the slave device under test from the waveform data.
[0113] In this embodiment, with the oscilloscope's clock frequency pre-set (e.g., 100kHz or 400kHz), the period of the resulting waveform data can be known in advance. Therefore, by detecting the start point of the waveform data and inserting a measurement point at the position corresponding to the set time, the timing parameters can be obtained by measuring the time difference between the measurement points. Simultaneously, by determining whether the interval to the right of the measurement point is a rising edge or a falling edge, the level data in the waveform data can be determined.
[0114] Step 2052: The test equipment extracts the test return value from the test log data.
[0115] In this embodiment of the application, after the testing device obtains the test log data, it can extract the test return value from the test log data according to preset keywords.
[0116] For example, when the device under test is running a Linux system, the test return values that may be extracted from the test log data of the device under test are as follows:
[0117]
[0118] Step 2053: The test equipment determines and outputs the test results based on the test return value, level data, and timing data.
[0119] In this embodiment of the application, the test equipment can initially determine whether there is an abnormality based on the test return value. If there is an abnormality, it is necessary to further determine whether the abnormality is due to the abnormality of the master device under test or the abnormality of the slave device under test based on the level timing and timing data, so as to accurately determine the specific abnormality type.
[0120] The following is a detailed explanation of how testing equipment can identify common anomalies.
[0121] Anomaly type 1: Communication process connection failure.
[0122] In this embodiment of the application, if the test device determines that the test return value indicates that the slave device under test is in a busy state, that is, the test return value is "-16", the level data indicates that the slave device under test sends a denial signal (NACK) to the master device under test during the test, and the timing data includes part of the timing data in the standard timing data, that is, the timing data is incomplete, then the test device can more accurately determine that the slave device under test is abnormal and output the abnormality type of the slave device under test as communication process connection abnormality.
[0123] Error type 2: Not connected.
[0124] In this embodiment of the application, if the test device determines that the test return value indicates that the slave device under test does not exist, that is, the test return value is "-19" and the timing data and level data are both empty, the test device can more accurately determine that the slave device under test is abnormal and output the abnormality type of the slave device under test as not connected.
[0125] Error type 3: Communication address sent incorrectly.
[0126] In this embodiment of the application, if the test device determines that the test return value indicates an input / output error of the slave device under test, that is, the test return value is "-5", the timing data is consistent with the standard timing data, and the level data indicates that the slave device under test sends a denial signal to the master device under test during the test, the test device can more accurately determine the abnormality of the master device under test and output the abnormality type of the master device under test as communication address transmission error.
[0127] In some embodiments, after outputting a specific anomaly type, the testing equipment can also output a targeted solution based on the specific type, so as to improve the efficiency of R&D personnel in solving anomalies.
[0128] Please see Figure 5 This is a flowchart illustrating a method for resolving output anomalies provided in an embodiment of this application. After executing step 205, step 206 can be executed further:
[0129] Step 206: Based on the correspondence between test results and anomaly resolution measures, determine and output the anomaly resolution measures corresponding to the anomalies of the master device under test, or the anomalies of the slave device under test.
[0130] In this embodiment of the application, when the master device or slave device under test is abnormal, the test device can output targeted abnormality resolution measures, so that subsequent R&D personnel can solve the abnormality according to the above abnormality resolution measures, thereby improving the efficiency of abnormality resolution.
[0131] It should be understood that anomaly resolution measures can be presented in text, voice, or video format so that R&D personnel can grasp the correct anomaly resolution measures in a short time. For example, for simpler anomaly resolution measures, text or voice can be used to output the measures, thereby improving the output efficiency; for more complex anomaly resolution measures, video can be used to output the measures, thereby improving the efficiency of R&D personnel in mastering the measures.
[0132] The following section provides a detailed explanation of the solutions for the aforementioned common anomalies.
[0133] Troubleshooting measure 1: Replace the device under test.
[0134] In this embodiment of the application, when the anomaly type is an anomaly in the communication process between the master device under test and the slave device under test, the anomaly resolution measure is determined and output as replacing the slave device under test based on the correspondence between the test results and the anomaly resolution measures.
[0135] Troubleshooting measure 2: Reconnect the device to be tested.
[0136] In this embodiment of the application, when the exception type is that the slave device under test is not connected, the exception resolution measure is determined and output as reconnecting the slave device under test based on the correspondence between the test results and the exception resolution measures.
[0137] Solution 3 for troubleshooting: Modify the communication address.
[0138] In this embodiment of the application, when the exception type is an error in the communication address sent by the master device under test, the exception resolution measure is determined and output as modifying the communication address sent by the master device under test based on the correspondence between the test results and the exception resolution measures.
[0139] For further details, please see Figure 6 This is an architecture diagram of another testing system provided in an embodiment of this application. Figure 1 The difference is that the test device 101 can also obtain and output test log data from the device under test 104, so that the R&D personnel can use their own experience, combined with the test results output by the test device 101 and the corresponding anomaly resolution measures, to obtain the final test results and corresponding anomaly resolution measures.
[0140] Please see Figure 7 Based on the same inventive concept, this application also provides a testing device, which includes: an instruction sending unit 301, a data acquisition unit 302, and a data processing unit 303.
[0141] The instruction sending unit 301 is used to send a test instruction to the master device under test. The test instruction carries a target test case, which is used to test the communication between the master device under test and the slave device under test.
[0142] The data acquisition unit 302 is used to acquire waveform data from the oscilloscope when the master device under test and the slave device under test communicate, after a set time interval following the sending of the test command; and to acquire test log data from the master device under test when the master device under test and the slave device under test communicate.
[0143] The data processing unit 303 is used to determine and output the test results based on the waveform data and the test log data.
[0144] Optionally, the data processing unit 303 includes:
[0145] The data extraction subunit is used to extract the level data and timing data of the communication between the master device under test and the slave device under test from the waveform data.
[0146] The data extraction subunit is also used to extract test return values from the test log;
[0147] The data processing subunit is used to determine and output the test result based on the test return value, the level data, and the timing data.
[0148] Optionally, if the test result indicates that the master device under test or the slave device under test is malfunctioning, the device further includes:
[0149] The solution output unit is used to determine and output the solution for the anomaly of the master device under test or the anomaly of the slave device under test based on the correspondence between the test results and the anomaly solution.
[0150] Optionally, the data processing subunit is specifically used for:
[0151] In response to the test return value indicating that the device under test is in a busy state, the level data indicating that the device under test sends a denial signal to the master device under test during the test, and the timing data including part of the timing data in the standard timing data, the test device determines that the device under test is abnormal and outputs that the abnormality type of the device under test is a communication process connection abnormality.
[0152] Optionally, the solution output unit is specifically used for:
[0153] Based on the correspondence between test results and anomaly resolution measures, the anomaly type is determined and output as follows: when the communication process of the slave device under test is abnormal, the corresponding anomaly resolution measure is to replace the slave device under test.
[0154] Optionally, the data processing subunit is specifically used for:
[0155] In response to the test return value indicating that the slave device under test does not exist, and both the timing data and the level data are empty, the test device determines that the slave device under test is abnormal and outputs that the abnormality type of the slave device under test is not connected.
[0156] Optionally, the solution output unit is specifically used for:
[0157] Based on the correspondence between test results and anomaly resolution measures, the anomaly type is determined and output as follows: when the slave device under test is not connected, the corresponding anomaly resolution measure is to reconnect the slave device under test.
[0158] Optionally, the data processing subunit is specifically used for:
[0159] In response to the test return value indicating an input / output error of the slave device under test, the timing data matching the standard timing data, and the level data indicating that the slave device under test sends a denial signal to the master device under test during the test, the test device determines that the master device under test is abnormal and outputs that the abnormality type of the master device under test is a communication address transmission error.
[0160] Optionally, the solution output unit is specifically used for:
[0161] Based on the correspondence between test results and anomaly resolution measures, the anomaly type is determined and output as follows: when the communication address of the master device under test is sent incorrectly, the corresponding anomaly resolution measure is to modify the communication address.
[0162] Please see Figure 8 Based on the same inventive concept, embodiments of this application provide a testing device, which includes at least one processor 401. The processor 401 is used to execute a computer program stored in a memory to implement the test program provided in the embodiments of this application. Figure 3-5 The steps of the test method shown are as follows.
[0163] Optionally, the processor 401 may be a central processing unit, a specific ASIC, or one or more integrated circuits used to control program execution.
[0164] Optionally, the test apparatus may further include a memory 402 connected to at least one processor 401. The memory 402 may include ROM, RAM, and disk storage. The memory 402 stores data required for the processor 401 to run, i.e., it stores instructions that can be executed by at least one processor 401. The at least one processor 401 executes instructions stored in the memory 402 to perform tasks such as... Figure 3-5 The method is shown. The number of memories 402 is one or more.
[0165] The physical devices corresponding to the instruction sending unit 301, the data acquisition unit 302, and the data processing unit 303 can all be the aforementioned processor 401. This test device can be used to execute... Figure 3-5 The method provided in the illustrated embodiment. Therefore, regarding the functions that each functional module in this test equipment can achieve, please refer to... Figure 3-5 The corresponding descriptions in the illustrated embodiments will not be repeated here.
[0166] This application embodiment also provides a computer storage medium, wherein the computer storage medium stores computer instructions, which, when executed on a computer, cause the computer to perform actions such as... Figure 3-5 The method described.
[0167] The above description is merely a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.
Claims
1. A testing system, characterized in that, The testing system includes a testing device, a master device under test (DUT), an oscilloscope, and a slave device under test (DUT). The testing device is electrically connected to both the master device under test and the oscilloscope. The master device under test is electrically connected to the slave device under test (DUT). The oscilloscope is electrically connected to both the master device under test and the slave device under test (DUT). The testing equipment is used to send test instructions to the main device under test, and the test instructions carry target test cases. The master device under test is used to respond to the test command and test the communication between the master device under test and the slave device under test based on the target test case. The test equipment is also used to acquire waveform data from the oscilloscope during communication between the master device under test and the slave device under test after a set time interval following the sending of the test command, and to acquire test log data during communication between the master device under test and the slave device under test from the master device under test. The testing equipment is also used to determine and output test results based on the waveform data and the test log data; The testing equipment is specifically used for: The waveform data extracts the level data and timing data of the communication between the master device under test and the slave device under test. The level data is used to characterize the response signal or denial signal sent by the slave device under test to the master device under test during the test. The timing data is used to characterize the protocol timing of the communication between the master device under test and the slave device under test during the test. The test return value is extracted from the test log data. The test return value is used to characterize the system-level status information returned by the system of the master device under test when the master device under test communicates with the slave device under test. The test result is determined and output based on the test return value, the level data, and the timing data. The test result indicates that both the master device under test and the slave device under test are normal, or that the master device under test is abnormal, or that the slave device under test is abnormal.
2. The testing system according to claim 1, characterized in that, The testing equipment is also used for: Based on the correspondence between test results and anomaly resolution measures, determine and output the anomaly resolution measures corresponding to the anomaly of the master device under test, or the anomaly resolution measures corresponding to the anomaly of the slave device under test.
3. A testing method, characterized in that, The method, applicable to the test system according to any one of claims 1-2, comprises: The testing equipment sends a test instruction to the master device under test, the test instruction carrying a target test case, the target test case being used to test the communication between the master device under test and the slave device under test; After sending the test command, the test device acquires waveform data from the oscilloscope during communication between the master device under test and the slave device under test after a set time interval, and acquires test log data from the master device under test during communication between the master device under test and the slave device under test. The testing equipment determines and outputs the test results based on the waveform data and the test log data; The testing equipment determines and outputs test results based on the waveform data and the test log data, including: The test equipment extracts the level data and timing data of the communication between the master device under test and the slave device under test from the waveform data. The level data is used to characterize the response signal or denial signal sent by the slave device under test to the master device under test during the test. The timing data is used to characterize the protocol timing of the communication between the master device under test and the slave device under test during the test. The test device extracts the test return value from the test log. The test return value is used to characterize the system-level status information returned by the system of the master device under test when the master device under test communicates with the slave device under test. The test equipment determines and outputs the test result based on the test return value, the level data, and the timing data. The test result indicates that both the master device under test and the slave device under test are normal, or that the master device under test is abnormal, or that the slave device under test is abnormal.
4. The method according to claim 3, characterized in that, The method further includes: Based on the correspondence between test results and anomaly resolution measures, determine and output the anomaly resolution measures corresponding to the anomaly of the master device under test, or the anomaly resolution measures corresponding to the anomaly of the slave device under test.
5. The method according to claim 4, characterized in that, The testing equipment determines and outputs the test result based on the test return value, the level data, and the timing data, including: In response to the test return value indicating that the device under test is in a busy state, the level data indicating that the device under test sends a denial signal to the master device under test during the test, and the timing data including part of the timing data in the standard timing data, the test device determines that the device under test is abnormal and outputs that the abnormality type of the device under test is a communication process connection abnormality.
6. The method according to claim 5, characterized in that, Based on the correspondence between test results and anomaly resolution measures, the anomaly resolution measures corresponding to the anomalies of the slave device under test are determined and output, including: Based on the correspondence between test results and anomaly resolution measures, the anomaly type is determined and output as follows: when the communication process of the slave device under test is abnormal, the corresponding anomaly resolution measure is to replace the slave device under test.
7. The method according to claim 4, characterized in that, The testing equipment determines and outputs the test result based on the test return value, the level data, and the timing data, including: In response to the test return value indicating that the slave device under test does not exist, and both the timing data and the level data are empty, the test device determines that the slave device under test is abnormal and outputs that the abnormality type of the slave device under test is not connected.
8. The method according to claim 7, characterized in that, Based on the correspondence between test results and anomaly resolution measures, the anomaly resolution measures corresponding to the anomalies of the slave device under test are determined and output, including: Based on the correspondence between test results and anomaly resolution measures, the anomaly type is determined and output as follows: when the slave device under test is not connected, the corresponding anomaly resolution measure is to reconnect the slave device under test.
9. The method according to claim 4, characterized in that, The testing equipment determines and outputs the test result based on the test return value, the level data, and the timing data, including: In response to the test return value indicating an input / output error of the slave device under test, the timing data matching the standard timing data, and the level data indicating that the slave device under test sends a denial signal to the master device under test during the test, the test device determines that the master device under test is abnormal and outputs that the abnormality type of the master device under test is a communication address transmission error.
10. The method according to claim 9, characterized in that, Based on the correspondence between test results and anomaly resolution measures, the anomaly resolution measures corresponding to the anomalies of the slave device under test are determined and output, including: Based on the correspondence between test results and anomaly resolution measures, the anomaly type is determined and output as follows: when the communication address of the master device under test is sent incorrectly, the corresponding anomaly resolution measure is to modify the communication address.
11. A testing device, characterized in that, The test device includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the test device is triggered to perform the steps of the method as described in any one of claims 3-10.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store computer instructions that, when executed in a computer, cause the computer to perform the steps of the method as described in any one of claims 3-10.
Citation Information
Patent Citations
Method, system, device and equipment for testing integrity of I2C (Inter-Integrated Circuit) signal
CN114281624A
Upper computer test system and method, CANoe upper computer and storage medium
CN115712533A