Oscilloscope single board testing method based on socket connection

The oscilloscope single board testing method based on socket connection solves the problems of low traditional testing efficiency, high cost and difficult traceability of results, achieves an efficient, accurate and automated testing process, reduces costs and expands automation functions.

CN119311599AInactive Publication Date: 2025-01-14成都玖锦科技有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411858333.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-01-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional oscilloscope single boards have low testing efficiency, high cost, difficult to trace results, limited coverage, inconsistent environment and limited automation expansion.

Method used

The oscilloscope single board test method based on socket connection is adopted, the test task is configured through the Jenkins server, the python test program is used to establish a socket communication connection with the oscilloscope, real-time data collection and processing is performed, and the test results are transferred to the oscilloscope in the form of files.

Benefits of technology

It improves testing efficiency and accuracy, reduces labor costs and resource consumption, realizes traceability and automated expansion of test results, and makes up for the shortcomings of visa connection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311599A_ABST
    Figure CN119311599A_ABST
Patent Text Reader

Abstract

The invention relates to an oscilloscope single board testing method based on socket connection, which belongs to the field of digital communication automatic testing, and comprises the following steps: configuring a testing task in a jenkins server, and automatically executing a testing program by an upper computer according to the configured testing task; a test program in the upper computer establishes a socket communication connection with the tested oscilloscope, controls the oscilloscope single board to issue an scpi instruction to perform real-time data acquisition, performs data processing on the acquired data, judges whether the processed data accords with expectation or not, and marks successfully if the processed data accords with the expectation; and transmitting a test result conforming to the expectation to the tested oscilloscope, and writing the file into the single-board memory after the tested oscilloscope receives the file. According to the invention, connection between the test host and the tested oscilloscope is realized in a socket mode, instruction control and big data and file transmission can be realized, test result data can be conveniently transmitted to the tested oscilloscope, and the function of automatic test is greatly expanded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of digital communication automation testing, and in particular to an oscilloscope single board testing method based on socket connection. Background Art

[0002] In the field of electronic test instruments, oscilloscopes are a basic and key test equipment, widely used in signal analysis, fault diagnosis, R&D verification and other links; the oscilloscope board is its core component, and its performance stability and reliability directly affect the function and quality of the entire oscilloscope; however, in the traditional oscilloscope board test process, there are generally the following significant problems: 1. Low test efficiency: The frequency of oscilloscope board testing is relatively large, and the traditional test method relies on manual operation. Testers need to manually set test parameters, execute test steps and record test results. This process is time-consuming and laborious, and it is easy to cause test or recording errors due to human factors. With the increasing bandwidth of oscilloscopes and the continuous improvement of test complexity, the efficiency bottleneck of traditional test methods is becoming increasingly prominent. 2. High test cost: Manual testing not only requires a lot of human resources, but also requires professional test equipment and environment. In addition, since the test process may involve multiple repeated tests or troubleshooting, the test cost is further increased. 3. Test results are difficult to trace; traditional test methods usually lack a systematic recording and management mechanism, and test results are often stored in the form of paper reports or electronic documents, which are difficult to query and trace efficiently. This limitation is particularly evident in the process of tracing or improving product quality issues. 4. Limited test coverage: Due to the limitations of manual operation, traditional test methods often find it difficult to cover all test functions and test scenarios of oscilloscope boards, which may cause some potential problems to be missed, thus affecting the overall quality and performance of the product. 5. Inconsistent test environment: There may be inconsistencies in the test environment between different testers or different test frequencies, such as test temperature, humidity, power supply stability, parameter settings, test techniques, etc. These inconsistencies may cause deviations in test results and affect the accuracy and reliability of test results. 6. The previous oscilloscope interface automation method used the visa library to connect, send instructions, and obtain return data. There will be some unavoidable problems: ① When the returned data is large, all data cannot be obtained; ② The host executing the automated test and the oscilloscope under test cannot transfer files at the same time, resulting in limited subsequent automation expansion. Summary of the invention

[0003] The purpose of the present invention is to overcome the shortcomings of the prior art and provide an oscilloscope single board testing method based on socket connection, thereby solving the deficiencies of the prior art.

[0004] The purpose of the present invention is achieved by the following technical solution: a socket-connected oscilloscope single board testing method, the testing method comprising: S1. Configure the test task in the Jenkins server, and the host computer automatically executes the Python test program according to the configured test task; S2, the Python test program in the host computer establishes a socket communication connection with the oscilloscope under test, controls the oscilloscope board to issue scpi instructions for real-time data acquisition, processes the acquired data, and determines whether the processed data meets expectations. If so, it is marked as successful; S3. The test results and data that meet the expectations are delivered to the oscilloscope under test in the form of a file. After receiving the file, the oscilloscope under test writes the file into the single board memory.

[0005] The establishing of the socket communication connection includes respectively establishing the socket communication connection by pinging each other's IP address on the host computer and the oscilloscope under test, specifically including: The oscilloscope under test acts as the server: obtains the IP address to establish a socket connection with the host computer, sets a port number for establishing a socket connection session, binds the IP address and port number, creates a TCP stream, enables the socket process, and puts the server in a listening state. If the IP address and port number of the connection request received are those of the local computer, the socket connection is agreed to be established; The host computer acts as a client: it obtains the IP address and port number used to establish a socket connection on the server side, creates a TCP stream for the socket connection on the host computer, and initiates a connection request to the server side. The requested IP address is the server IP, and the port number is also the port number set on the server side.

[0006] The data communication process between the host computer and the oscilloscope under test is as follows: Sending instructions: Define the instructions to be sent as string type on the host computer, encrypt the string into binary data and send it to the server. The server receives the binary data sent by the host computer, decrypts it into a string and executes the command. Get data: After the server executes the instructions sent by the host computer, it returns the generated string format data to the host computer, encrypts it into binary data and sends it to the server. After receiving the binary data sent by the host computer, the server decrypts it into string format data, which is the obtained data result. When the data on the server is large, it is fragmented when returned. When receiving data on the host computer, it is received in a loop, starting from the first non-empty data. When the received data is judged to be empty, the transmission is completed.

[0007] The host computer and the oscilloscope under test transmit the large file including sending the large file and obtaining the large file; When the host computer actively sends a large file, it sends a message containing the SEND keyword. After obtaining the keyword, the server is ready to receive the large file. The host computer encrypts the large file into binary data and sends it. The server starts to receive the data in a loop from the first empty byte until it determines that the received data is empty. When the host computer sends a message containing the GET keyword, the server obtains this keyword and searches for a large file in the corresponding path. If the large file does not exist, a message is returned to the host computer. If it exists, the large file is encrypted into binary data and sent to the host computer. The host computer starts receiving data from the first non-empty data until the reception is completed.

[0008] The test method also includes: storing the test data, test results and log information in a database for subsequent query and analysis and tracing.

[0009] The present invention has the following advantages: 1. Automated testing reduces manual intervention. Test execution, data processing, result judgment, and data recording are all performed by scripts, which speeds up testing and directly improves testing efficiency. Jenkins' continuous integration capability allows test tasks to be executed immediately after code submission, shortening the cycle from development to testing.

[0010] 2. Avoid errors and omissions caused by human factors, improve the accuracy of test results, and ensure the consistency and repeatability of each test through preset test procedures and test conditions, thereby increasing the reliability of the test.

[0011] 3. Reduced reliance on testers, reduced labor costs, reduced test failures and retests due to human errors, and further reduced resource consumption and costs during the testing process.

[0012] 4. Jenkins provides rich task management and result feedback functions, allowing testers to easily track and manage test tasks. The test data and test results stored in the database can be used for subsequent analysis and traceability, providing strong support for the continuous improvement of product quality.

[0013] 5. The connection based on socekt can make up for the shortcomings of visa connection. When the data returned by the oscilloscope under test is large, the visa connection method cannot obtain all the data. Using socket can determine whether the data is received by judging whether the transmitted data is empty; and through the socket connection, the test data and results can be transmitted to the oscilloscope under test in the form of files, which is also a function that the visa library does not have. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

[0015] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme 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 a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of the present application provided below in conjunction with the drawings is not intended to limit the scope of protection of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application. The present invention is further described below in conjunction with the drawings.

[0016] The present invention specifically relates to an oscilloscope single board testing method based on socket connection. The connection between a test host and an oscilloscope under test is realized by means of socket, which can not only realize instruction control but also realize big data and file transmission, and conveniently transmit test result data to the oscilloscope under test, greatly expanding the function of automated testing. The Python language and the Jenkins automated testing tool are used to realize automated testing of various functions and performances of the oscilloscope single board.

[0017] like Figure 1 As shown, specifically including the following: Task configuration: configure the test task in the Jenkins server, including the test program path, test parameters, etc.; Program execution: The Jenkins server in the host computer automatically executes the Python test program according to the configuration; the Python test program includes: creating test directories and files, writing test cases using pytest decorators and assertions, organizing test cases into test files for easy management and execution, and adding a pytest.ini file to the project to configure the behavior of pytest, such as adding @mark, rerunning rules, etc. Data acquisition: The Python test program in the host computer is connected to the oscilloscope through socket communication, controls the oscilloscope board, and issues scpi commands for real-time data acquisition; Result feedback: The test program analyzes and processes the collected data, and determines whether the processed data meets expectations. If it does not meet expectations, it will be marked as failed, and if it meets expectations, it will be marked as successful. Data storage: Store test data, test results, logs and other information into the database for subsequent query, analysis and tracing; Data transmission: After the test is completed, the expected test results and data will be transferred to the oscilloscope under test in the form of a file. After the oscilloscope under test receives the file, it will write it into the single board memory.

[0018] Further, establishing a socket communication connection includes respectively pinging each other's IP addresses on the host computer and the oscilloscope under test to establish a socket communication connection, specifically including: The oscilloscope under test acts as the server: obtains the IP address to establish a socket connection with the host computer, sets a port number for establishing a socket connection session, binds the IP address and port number, creates a TCP stream, enables the socket process, and puts the server in a listening state. If the IP address and port number of the connection request received are those of the local computer, the socket connection is agreed to be established; The host computer acts as a client: it obtains the IP address and port number used to establish a socket connection on the server side, creates a TCP stream for the socket connection on the host computer, and initiates a connection request to the server side. The requested IP address is the server IP, and the port number is also the port number set on the server side.

[0019] Furthermore, the data communication process between the host computer and the oscilloscope under test is as follows: Sending instructions: Define the instructions to be sent as string type on the host computer, encrypt the string into binary data and send it to the server. The server receives the binary data sent by the host computer, decrypts it into a string and executes the command. Get data: After the server executes the instructions sent by the host computer, it returns the generated string format data to the host computer, encrypts it into binary data and sends it to the server. After receiving the binary data sent by the host computer, the server decrypts it into string format data, which is the obtained data result. When the data on the server is large, it is fragmented when returned. When receiving data on the host computer, it is received in a loop, starting from the first non-empty data. When the received data is judged to be empty, the transmission is completed.

[0020] Among them, the host computer and the oscilloscope under test include sending the large file and obtaining the large file when transmitting the large file; The host PC takes the initiative to send a large file. When sending a large file, the host PC will first send a message containing the SEND keyword. After obtaining this keyword, the server will know that the host PC is going to send a large file. At this time, the server is ready to receive the large file. The host PC encrypts the file into binary data and sends it. The server starts receiving from the first non-empty byte and receives it in a loop until it determines that the received data is empty.

[0021] When the host PC sends a message containing the GET keyword, the server will know that the host PC wants to obtain a large file after obtaining this keyword. At this time, the server will search for this file in the corresponding path. If this file does not exist, it will return to the host computer "This file does not exist, stop sending". After finding this file, it will be encrypted into binary data and returned to the host computer. The host computer starts receiving from the first data that is not empty until the reception is completed.

[0022] The above is only a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used for various other combinations, modifications and improvements, and can be modified within the scope of the concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art do not deviate from the spirit and scope of the present invention, and should be within the scope of protection of the claims attached to the present invention.

Claims

1. An oscilloscope single board testing method based on socket connection, characterized in that: The test method includes: S1. Configure the test task in the Jenkins server, and the host computer automatically executes the Python test program according to the configured test task; S2, the Python test program in the host computer establishes a socket communication connection with the oscilloscope under test, controls the oscilloscope board to issue scpi instructions for real-time data acquisition, processes the acquired data, and determines whether the processed data meets expectations. If so, it is marked as successful; S3. The test results and data that meet the expectations are delivered to the oscilloscope under test in the form of a file. After receiving the file, the oscilloscope under test writes the file into the single board memory.

2. The oscilloscope single board testing method based on socket connection according to claim 1, characterized in that: The establishing of the socket communication connection includes respectively establishing the socket communication connection by pinging each other's IP address on the host computer and the oscilloscope under test, specifically including: The oscilloscope under test acts as the server: obtains the IP address to establish a socket connection with the host computer, sets a port number for establishing a socket connection session, binds the IP address and port number, creates a TCP stream, enables the socket process, and puts the server in a listening state. If the IP address and port number of the connection request received are those of the local computer, the socket connection is agreed to be established; The host computer acts as a client: it obtains the IP address and port number used to establish a socket connection on the server side, creates a TCP stream for the socket connection on the host computer, and initiates a connection request to the server side. The requested IP address is the server IP, and the port number is also the port number set on the server side.

3. The oscilloscope single board testing method based on socket connection according to claim 2, characterized in that: The data communication process between the host computer and the oscilloscope under test is as follows: Sending instructions: Define the instructions to be sent as string type on the host computer, encrypt the string into binary data and send it to the server. The server receives the binary data sent by the host computer, decrypts it into a string and executes the command. Get data: After the server executes the instructions sent by the host computer, it returns the generated string format data to the host computer, encrypts it into binary data and sends it to the server. After receiving the binary data sent by the host computer, the server decrypts it into string format data, which is the obtained data result. When the data on the server is large, it is fragmented when returned. When receiving data on the host computer, it is received in a loop, starting from the first non-empty data. When the received data is judged to be empty, the transmission is completed.

4. The oscilloscope single board testing method based on socket connection according to claim 3, characterized in that: The host computer and the oscilloscope under test transmit the large file including sending the large file and obtaining the large file; When the host computer actively sends a large file, it sends a message containing the SEND keyword. After obtaining the keyword, the server is ready to receive the large file. The host computer encrypts the large file into binary data and sends it. The server starts to receive the data in a loop from the first empty byte until it determines that the received data is empty. When the host computer sends a message containing the GET keyword, the server obtains this keyword and searches for a large file in the corresponding path. If the large file does not exist, a message is returned to the host computer. If it exists, the large file is encrypted into binary data and sent to the host computer. The host computer starts receiving data from the first non-empty data until the reception is completed.

5. The oscilloscope single board testing method based on socket connection according to any one of claims 1 to 4, characterized in that: The test method also includes: storing the test data, test results and log information in a database for subsequent query and analysis and tracing.

Citation Information

Patent Citations

  • Method and system for measuring electrical characteristics of clock signal via long-range control of oscilloscope

    CN108226681A

  • Digital signal quality auxiliary test method and system

    CN115963302A

  • Remote oscilloscope

    CN202939195U