Serial port bus ICD missing-oriented test method
By building a test network and recording equipment, recording and analyzing serial bus signals, and generating command-response pairs, the serial bus testing problem in the absence of an ICD was solved, and the status diagnosis of the product under test was achieved.
Patent Information
- Application Number
- CN202510663032.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-09-12
AI Technical Summary
In the absence of an ICD, the existing technology cannot effectively test the serial bus, resulting in the inability to perform the test.
By building a test network, using recording equipment and baud rate detection equipment, recording and analyzing serial bus signals, generating command-response pairs, and using the recording equipment as a receiver or transmitter for testing, the status of the product under test can be diagnosed.
The serial bus test is realized in the case of missing ICD, which simplifies the test process and solves the test problem of RS422, RS485 and RS232 serial bus in the case of missing ICD.
Smart Images

Figure CN120639652A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of bus testing, and in particular relates to a serial bus ICD missing testing method. Background Art
[0002] With the rapid development of electronic information systems, bus technology has been widely used. In addition to analog signals and discrete signals, a large amount of information is transmitted through bus interfaces.
[0003] In the testing field, to test such devices, it's necessary to know which bus type or types of buses the device uses, as well as the corresponding bus communication protocol, or ICD, to test the device's functional logic and performance. However, in some application scenarios, obtaining an ICD is difficult, and testing must be performed without it, making testing impossible.
[0004] RS422, RS485, and RS232 serial busses are widely used in electronic products, but the same problem exists when testing serial ports in the absence of an ICD. Summary of the Invention
[0005] The purpose of the present invention is to provide a test method for serial bus ICD missing, so as to solve the problem that the test cannot be effectively carried out when the ICD is missing.
[0006] The present invention is achieved through the following technical solutions: The test method for serial bus ICD loss includes the following steps: Step 1. Build a test network; this includes setting up a recording device and a baud rate detection device in the serial bus network. The baud rate detection device is used to obtain the baud rate of the serial bus. The signal type of the recording device is consistent with the signal type of the system bus under test, and it has at least two receiving channels for recording the transmitted signal and the received signal respectively. Step 2. Determine the serial bus parameters, including detecting the serial bus baud rate and byte structure; Step 3. Bus recording; including: starting two acquisition channels and placing the system under test in normal working mode, recording data in the transmitting direction and the receiving direction, and obtaining recorded data; Step 4. Parse the recorded data to generate command-response pairs; this includes extracting feature fields from frames in the recorded data and splitting the recorded data in the transmitting and receiving directions into separate frames based on the feature fields; building a parsing test network, extracting the split command frames and sending them to the slave receiver using the recording device as a transmitter; combining the response frames generated by the slave receiver with the corresponding command frames into command-response pairs, thereby forming a set of command-response pairs; Step 5. Diagnostic test: Use the product under test with the same signal to replace the product under test in the receiver parsing test network, extract the instructions from the instruction-response pair set, send them to the product under test in the set order, and test the status of the product under test based on the response of the product under test.
[0007] In some embodiments, in step 2, an oscilloscope or FPGA is used to detect serial bus parameters.
[0008] In some embodiments, an oscilloscope is used to detect the waveforms of the transmitted and received signals, and the baud rate of the serial bus data is determined based on the minimum time width of the waveform levels; An oscilloscope is used to traverse all possible word structure parameters, and the byte structure is determined based on the comparison between the signal level collected by the oscilloscope and the decoded data.
[0009] In some embodiments, the baud rate of the bus is determined based on FPGA automatic detection; the FPGA is used to receive a bit stream from the serial bus at a known baud rate, traverse possible word structure parameters, and perform data bit, check bit, and stop bit verification on a large number of words, and determine the byte structure based on the word parsing.
[0010] In some embodiments, the step of extracting the characteristic fields of the frames in the recorded data in step 4 and splitting the recorded data in the transmitting direction and the receiving direction into separate frames according to the characteristic fields of the frames includes: splitting the recorded data into frames, parsing the characteristic fields of the frames, and splitting the recorded data in the transmitting direction and the receiving direction into separate frames according to the frame header and frame tail.
[0011] In some embodiments, the analytical test network built for the point-to-point communication mode is as follows: the recording device is used as a receiver, and the recorded data in the receiving direction is used to stimulate the transmitter for testing; the recording device is used as a transmitter, and the recorded data in the transmitting direction is used to stimulate the receiver for testing.
[0012] In some embodiments, the analytical test network built for the multi-point communication mode is: the recorded data frames of the transmission direction are matched with the corresponding slave receivers, and a point-to-point test network consisting of a transmitter and each corresponding slave receiver is built. The recording device is used as a transmitter, and the data of the recorded transmission direction is used to stimulate and test the receiver.
[0013] In some embodiments, the step of forming a command-response pair in step 4 includes: taking out the command frames split from the data in the transmission direction and sending them one by one to the corresponding receiver or sub-receiver, and forming a command-response pair with the response frame sent by the receiver or sub-receiver and the current command frame or the current command frame and several adjacent command frames.
[0014] In some embodiments, in step 5, it is determined whether the bus communication of the product under test is normal based on the response of the product under test to the instruction in each instruction response pair; When the bus communication of the product under test is normal, whether the state of the product under test is normal is determined by comparing the consistency of the current response with the response in the command response pair.
[0015] In some embodiments, the command-response pairs are divided into time-independent command-response pairs and time-dependent command-response pairs according to whether there is a difference in the responses; When a time-independent command is sent, the status of the product under test is determined based on whether there is a difference in the response; When a time-related instruction is sent, the same instruction is sent multiple times, and the consistency of the response change pattern with the standard response change pattern is compared to determine the status of the tested product.
[0016] Compared with the prior art, the present invention has the following advantages and beneficial effects: The present invention adopts recording equipment to build a test network, records bus signals respectively and uses them as a receiver or transmitter, and tests the status of the product under test according to the response of the command, thereby realizing the test of the serial bus in the case of missing ICD. The test system and test process are simple, and the problem that the function of the product under test cannot be tested when the ICD of RS422, RS485 and RS232 serial bus is missing is well solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings in the embodiments will be briefly introduced below. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 This is a structural diagram of the serial bus point-to-point communication mode.
[0019] Figure 2 This is a structural diagram of the serial bus multi-point communication mode.
[0020] Figure 3 This is a flow chart of a method for testing ICD loss on a serial bus according to an embodiment of the present invention.
[0021] Figure 4 This is a schematic diagram of a test recording network in point-to-point communication mode according to an embodiment of the present invention.
[0022] Figure 5 Schematic diagram of a test recording network in a multipoint communication mode according to an embodiment of the present invention.
[0023] Figure 6 This is a principle block diagram of an embodiment of the present invention based on FPGA automatic detection of RS422 byte structure detection. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. It should also be noted that, for ease of description, only parts related to the present application, not all of the contents, are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0025] There are two main communication modes of the serial bus: 1) Point-to-point communication mode, that is, there is only one transmitter and one receiver in the network, such as Figure 1 shown.
[0026] Figure 1 The transmitter pointing toward the receiver is defined as the transmit direction, enabling signal transmission from the transmitter to the receiver; the receiver pointing toward the transmitter is defined as the receive direction, enabling signal transmission from the receiver to the transmitter. The line without an arrow represents the signal ground.
[0027] The arrows here are defined as ports. Some serial ports use single-ended mode, that is, one hard line transmits high and low voltages, such as RS232; while some serial ports use differential mode, that is, the port transmits high voltage through the voltage difference of two hard lines, such as RS422 and RS485.
[0028] 2) Multipoint communication mode, there is one master transmitter and multiple slave receivers in the network, such as Figure 2 The slave device must wait for the master device to query before sending a data packet to the bus. The communication process is completely managed and maintained by the master device.
[0029] The present invention is directed to a test method for an R422 / 232 / 485 serial bus ICD missing condition, comprising the following steps: Step 1. Set up a test recording network Step 2. Determine the serial bus parameters 2.1、Detect baud rate; 2.2, Detect byte structure; Step 3. Bus Recording 3.1. Set the parameter channel and start two acquisition channels; 3.2. Power on the system under test and put it into normal working mode; 3.3. Record the data of the transmitting direction and the receiving direction; Step 4. Parse the recorded data and generate command response pairs 4.1, Extract frame; 4.2. Determine command-response pairs; including: 1) Building a parsing test network; 2) Sequentially pairing command responses for each slave receiver; Step 5. Diagnostic Tests 5.1, Classification of command-response pairs; 5.2. Diagnose the status of the product under test.
[0030] The method for testing the function of a product under test when the serial bus ICD is missing according to the present invention will be described in detail below with reference to specific embodiments.
[0031] Step 1. Set up a test recording network To realize bus recording, a communication card and a baud rate detection device are added to the bus network as recording devices. The test recording network of the point-to-point communication mode is as follows: Figure 4 As shown, the test recording network in multipoint communication mode is as follows Figure 5 shown.
[0032] The baud rate detector is used to capture bus waveforms, calculate the baud rate of the bus data, and detect data bits, parity, and stop bits. In the figure, the baud rate detector collects signals in the transmitting direction (indicated by T), but it can also collect signals in the receiving direction (indicated by R).
[0033] The signal type of the recording device is consistent with the signal type of the bus of the system under test, and it has at least two receiving channels for recording the transmitted signal and the received signal respectively.
[0034] Step 2. Determine the serial bus parameters 2.1、Detect the serial bus baud rate There are two baud rate detection methods available: 1) Detection by oscilloscope The oscilloscope detects the T signal waveform and determines the serial bus data baud rate based on the minimum time width of the waveform level (high level or low level) (that is, the duration of one bit).
[0035] Assume the minimum time width of the waveform level is , then the serial bus baud rate is .
[0036] 2) Automatic detection based on FPGA The detection steps include: signal capture, clock signal generation, pulse width calculation, data processing and output, and the baud rate of the bus can also be determined.
[0037] 2.2. Detecting Byte Structure There are also two detection methods available: 1) Detection by oscilloscope Use an oscilloscope and serial port debugging software for testing.
[0038] The detection method adopted is: traversing all possible word structure parameters; The judgment principle is: only when the parameters are consistent with the actual situation, the signal level collected by the oscilloscope is consistent with the decoded data. Otherwise, inconsistencies will definitely occur when multiple data bytes are collected.
[0039] 2) Automatic detection based on FPGA Under the condition of known baud rate, FPGA is used to automatically detect the word structure on the serial bus. Figure 6 As shown, the FPGA receives a bit stream from the serial bus at a known baud rate, inputs the bit stream into the parameter check unit, traverses possible word structure parameters, and verifies the data bits, check bits, and stop bits of a large number of words. When all words can be correctly parsed, the parameters are output.
[0040] Step 3. Bus Recording An important prerequisite for bus recording is that each transmitter and receiver in the test recording network can work normally, and the recorded data is used for subsequent testing of the same product.
[0041] 3.1. Turn on the recording device, set the channel parameters, and start two acquisition channels; 3.2. Power on the system under test and put it into normal working mode; 3.3. Record the data of the transmitting direction and the receiving direction.
[0042] Step 4. Parse the recorded data and generate command response pairs 4.1, Extract frame; Split the recorded serial bus data (byte stream) into frames and parse out the main fields of the frame, such as the frame header field, length field, address field, and frame trailer field. There is no need to analyze the specific physical meaning of the data field.
[0043] After confirming the real frame header and frame tail, the recorded transmission direction and reception direction data are split into separate frames.
[0044] 4.2. Determine the command-response pair; including: 1) Build a parsing test network For point-to-point communication mode, when testing the transmitter, the recording device acts as a receiver and is stimulated by the recorded data in the receiving direction; when testing the receiver, the recording device acts as a transmitter and is stimulated by the recorded data in the transmitting direction for subsequent command response pairing.
[0045] For multi-point communication mode, when testing the slave receiver, it is necessary to match the data frame of the recorded transmission direction with the specific slave receiver to confirm which slave receiver will send a response when the frame sent by the master transmitter is sent. Therefore, it is necessary to build a point-to-point test network, in which the transmitter is replaced by the recording device, and the data of the recorded transmission direction is used for stimulation, and the receiver is used in turn. Figure 2 Replaced by slave receiver 1, slave receiver 2, etc.
[0046] For multipoint communication mode, the main transmitter cannot be tested due to the limitations of the communication mechanism.
[0047] 2) Pairing the command responses of each slave receiver; When the current slave receiver is powered on, based on step 4.1, extract the command frames separated from the transmitted data and send them one by one to the receiver or the corresponding slave receiver. If the slave receiver sends a response frame (in some cases, multiple response frames may be received because the amount of data sent back by the slave device is large and needs to be split into multiple frames), it indicates that the response frame was triggered by the current command frame or the current command frame and several immediately preceding command frames. Record all current and previous command frames and response frames to form a command-response pair.
[0048] Step 5. Diagnostic Tests 5.1. Classification of Command-Response Pairs Before diagnosing a slave receiver in a certain state, the command-response pairs need to be classified into: 1) Time-independent command-response pair: When the device under test is in normal state, no matter when it receives the same command, the response it gives remains unchanged. Such a command-response pair is a time-independent command-response pair; 2) Time-Dependent Command-Response Pairs: When the device under test is operating normally, it may respond differently to the same command. This discrepancy may be due to the presence of time information and digitized analog values (such as voltage, current, resistance, temperature, pressure, and angle) in the response. Table 1 shows the response patterns for time-dependent commands.
[0049] Table 1 Response change patterns of time-related commands
[0050] According to the characteristics of the above two command-response pairs, the two different commands in the command-response pair set can be distinguished by sending the same command multiple times.
[0051] 5.2. Diagnose the status of the tested product Based on the analytical test network built in step 4.2, the receiver is replaced by the product under test with the same model but unknown status. The commands are taken from the command-response pair sets obtained in steps 4.2 and 5.1 and sent to the product under test in the order in which they are taken.
[0052] 1) If any command fails to respond, it means that the product under test is abnormal.
[0053] 2) If the DUT responds to the commands in each command-response pair, it indicates that the bus communication of the DUT is normal. The DUT status needs to be further determined by comparing the current response with the response in the command-response pair, including: 2.1) If a time-independent command is issued, if the current response is exactly the same as the response in the command-response pair, it indicates that the status of the product under test is normal. If the current response is different from the response in the command-response pair, it indicates that the status of the product under test is abnormal.
[0054] 2.2) If the command issued is time-dependent, it is necessary to send the same command multiple times. Check the response change pattern. If the response change pattern meets the response change pattern requirements in Table 1 in step 5.1, it can be determined that the tested product is in normal status. Otherwise, the device status is abnormal.
[0055] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification or equivalent change made to the above embodiment based on the technical essence of the present invention shall fall within the scope of protection of the present invention.
Claims
1. A test method for serial bus ICD loss, characterized in that: The following steps are involved: Step 1. Build a test network; The method includes setting a recording device and a baud rate detection device in the serial bus network, wherein the baud rate detection device is used to obtain the baud rate of the serial bus, the signal type of the recording device is consistent with the signal type of the bus of the system under test, and the recording device has at least two receiving channels for recording the transmission signal and the reception signal respectively; Step 2. Determine the serial bus parameters; Including detecting the serial bus baud rate and byte structure; Step 3. Bus recording; including: starting two acquisition channels and placing the system under test in normal working mode, recording data in the transmitting direction and the receiving direction, and obtaining recorded data; Step 4. Parse the recorded data to generate command-response pairs; this includes extracting feature fields from frames in the recorded data and splitting the recorded data in the transmitting and receiving directions into separate frames based on the feature fields; building a parsing test network, extracting the split command frames and sending them to the slave receiver using the recording device as a transmitter; combining the response frames generated by the slave receiver with the corresponding command frames into command-response pairs, thereby forming a set of command-response pairs; Step 5. Diagnostic test: Use the product under test with the same signal to replace the product under test in the receiver parsing test network, extract the instructions from the instruction-response pair set, send them to the product under test in the set order, and test the status of the product under test based on the response of the product under test.
2. The method for testing the serial bus ICD missing according to claim 1, characterized in that: In step 2, an oscilloscope or FPGA is used to detect the serial bus parameters.
3. The method for testing the serial bus ICD missing according to claim 2, characterized in that: Use an oscilloscope to detect the waveforms of the transmitted and received signals, and determine the serial bus data baud rate based on the minimum time width of the waveform level; An oscilloscope is used to traverse all possible word structure parameters, and the byte structure is determined based on the comparison between the signal level collected by the oscilloscope and the decoded data.
4. The method for testing the serial bus ICD missing according to claim 2, wherein: The baud rate of the bus is determined based on FPGA automatic detection. The FPGA is used to receive the bit stream from the serial bus at a known baud rate, traverse possible word structure parameters, and proofread the data bits, check bits, and stop bits of a large number of words, and determine the byte structure based on the word parsing.
5. The method for testing the serial bus ICD missing according to claim 1, characterized in that: In step 4, the characteristic fields of the frames in the recorded data are extracted, and the steps of splitting the recorded data in the transmitting direction and the receiving direction into separate frames according to the characteristic fields of the frames include: splitting the recorded data into frames, parsing the characteristic fields of the frames, and splitting the recorded data in the transmitting direction and the receiving direction into separate frames according to the frame header and frame tail.
6. The method for testing the serial bus ICD loss according to claim 1, wherein: The analytical test network built for point-to-point communication mode is as follows: the recording device is used as a receiver, and the data in the recorded receiving direction is used to stimulate the transmitter for testing; Use the recording device as a transmitter and use the recorded transmission direction data to stimulate the receiver for testing.
7. The method for testing the serial bus ICD loss according to claim 1, characterized in that: The analytical test network built for the multi-point communication mode is as follows: the recorded data frames in the transmission direction are matched with the corresponding slave receivers, and a point-to-point test network consisting of a transmitter and each corresponding slave receiver is built. The recording device is used as a transmitter, and the data in the recorded transmission direction is used to stimulate and test the receiver.
8. The method for testing serial bus ICD loss according to claim 6 or 7, characterized in that: The step of forming a command-response pair in step 4 includes: taking out the command frames split from the data in the transmission direction and sending them one by one to the corresponding receiver or sub-receiver, and forming a command-response pair with the response frame sent by the receiver or sub-receiver and the current command frame or the current command frame and several command frames immediately preceding it.
9. The method for testing the serial bus ICD missing according to claim 1, characterized in that: In step 5, judging whether the bus communication of the product under test is normal based on the response of the product under test to the instructions in each instruction response pair; When the bus communication of the product under test is normal, whether the state of the product under test is normal is determined by comparing the consistency of the current response with the response in the command response pair.
10. The method for testing the serial bus ICD loss according to claim 9, characterized in that: The instruction-response pairs were divided into time-independent instruction-response pairs and time-dependent instruction-response pairs according to whether there was a difference in the responses. When a time-independent command is sent, the status of the product under test is determined based on whether there is a difference in the response; When a time-related instruction is sent, the same instruction is sent multiple times, and the consistency of the response change pattern with the standard response change pattern is compared to determine the status of the tested product.
Citation Information
Patent Citations
Simulation debugging method and system for serial communication equipment
CN114518980A
System and method for testing RS485 bus in DCS (Distributed Control System) of nuclear power plant
CN119520347A
1553B bus test experiment method and system
CN119652799A
Method for predicting performance of network system and device therefor and method for diagnosing fault of the same and device therefor
JP1995058760A