Method for improving test efficiency of 5GRedCap cellular communication module
By establishing a command set library and using pyserial module for automated detection, the problem of low detection efficiency of 5G cellular communication modules is solved, and more efficient detection processes and more accurate results are achieved.
Patent Information
- Application Number
- CN202411766641.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The existing 5G cellular communication module detection solutions require manual design and testing, resulting in inefficient detection. Especially after the complexity of 5GRedCap chips increases, efficiency and stability considerations are more prominent.
By establishing a command set library, encoding test cases, and using the pyserial module to communicate with the test pieces, automatically confirm the test cases, bypassing manual detection and design steps, and improving detection efficiency.
It greatly improves the efficiency of communication module detection, reduces the time overhead of manual processing, and improves the degree of automation and accuracy of detection.
Smart Images

Figure CN119254352A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication module testing, and in particular to a method for improving the testing efficiency of a 5G RedCap cellular communication module. Background Art
[0002] With the continuous development of communication technology, various solutions for communication module detection have been widely implemented. With the development of 5G, various related industries have begun to emerge. However, due to the current technological limitations, the production cost of 5G chips is high. In order to reduce costs, lightweight technology for 5G has begun to develop, namely 5GRedCap.
[0003] With the continuous development of these chips, the detection schemes for the chip communication modules are becoming more and more complicated and bloated. The development of 5GredCap has also led to more consideration of efficiency, performance and stability when detecting communication modules. The existing communication module detection schemes usually require manual processing, that is, manual design of communication module schemes and testing and design of various detection commands for communication modules. In particular, the classification and information organization of communication modules require a lot of time. This method greatly reduces the detection efficiency of communication modules. In order to avoid this problem. Summary of the invention
[0004] The present invention aims at the deficiencies in the prior art and provides the following technical solutions: The method for improving the test efficiency of 5GRedCap cellular communication module comprises the following steps: S10: Establish a command set library, wherein the command set library includes test cases for several different types of cellular communication modules, each test case includes at least one command, parameters for executing the command, and a functional description, each command, parameters for executing the command, and a functional description are stored in the test case in a coded form, and each test case is stored in the command set library in a coded form.
[0005] S20: Obtain information of the input test file through the data reading module, compare it with the command set library, and determine the test case of the test piece.
[0006] S30: Call the pyserial module to communicate with the test piece, and perform tests through the test module according to the incoming test cases, and save the test results separately.
[0007] As an improvement of the above technical solution, the test case encoding method includes the following steps: S11: Determine the command type and specific characters of the command, and encode them as the first type.
[0008] S12: Determine the incoming parameter of the command and encode it as the second type.
[0009] S13: Determine a specific functional statement of the command and encode it as the third type.
[0010] S14: Determine the function number of the command and encode it as the fourth type.
[0011] S15: Combining the first type, the second type, the third type and the fourth type to obtain the code of the command.
[0012] As an improvement of the above technical solution, step S10 includes the following steps: S101: Map all test cases to a network topology diagram, and encode all test cases with topology tags in the network topology diagram.
[0013] S102: When a new test case is input, the topology block mark of the network topology diagram is retrieved and traversed to obtain the code composed of the topology block marks. If a new command appears, a new topology block is added, the topology block is marked, and the topology block is pointed to the command.
[0014] As an improvement of the above technical solution, step S20 includes the following steps: S21: Call the pandas module to read the input test file and detect whether there is coding information of the test case in the test file. If so, directly determine the test case based on the coding information. If there is no coding information, or if there is coding information but the information is incorrect, execute step S22.
[0015] S22: Send several commands to the test piece through the pyserial module, and determine the actual function of the command according to the return data of the pyserial module response, until the actual functions of all commands are determined, and determine the test case according to the several commands sent, wherein the several commands are the commands containing the largest number of functions.
[0016] As an improvement of the above technical solution, step S22 includes the following steps: S221: Read the function overview information in the encoding information of all commands in the command set library through the data reading module.
[0017] S222: Create a function table according to the number of functions recorded in the function overview, and arrange the commands in the function table in descending order according to the number of functions.
[0018] S223: Filter several commands from the command with the largest number of functions in the function table downward until the test case can be determined in step S22.
[0019] As an improvement of the above technical solution, step S223 includes the following steps: S2231: Perform communication tests from the command with the largest number of functions downward in the function table until the first command that passes the test is located, and locate the topology block corresponding to the command in the network topology diagram.
[0020] S2232: Traverse downward with the located topology block to obtain all connected topology blocks.
[0021] S2233: Execute steps S2231 and S2232 in a loop until the topology chain forms a closed loop or there are no connected topology blocks after traversing the topology blocks downward, output the code formed by connecting all the located topology blocks, and determine the test case based on the code.
[0022] As an improvement of the above technical solution, the test module includes a functional test module, a stress test module and a stability test module. The functional test module is used to check whether the main functions of the test piece can be used normally. The stress test module is used to perform stress testing on the test piece under certain characteristic conditions. The stability test module performs at least the following tests on the test piece: power on and off test, soft restart test, Key sleep test, Uart sleep test, CFUN switch test, random power on and off test, and TCP test.
[0023] As an improvement of the above technical solution, the soft restart test, Uart sleep test, CFUN switch test and TCP test send AT commands or TCP commands and monitor data through the pyserial module, and the power on and off test, random power on and off test and Key sleep test realize the power on and off control of the relay or development board by calling the DTR function.
[0024] Beneficial effects of the present invention: By establishing an independent command set library, commands and related information are re-encoded, and test cases are automatically confirmed based on this information combined with the information of the input test file. This bypasses the steps related to manual detection, design, and data collation, greatly enhancing the efficiency of the entire test plan process. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A network topology diagram formed by connecting topology blocks in the present invention, wherein the topology blocks are marked with Arabic numerals, and the marks point to a single command code; Figure 2 This is a test result display diagram that is output by calling a data analysis script when outputting HTML. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0027] With the continuous development of these chips, the detection schemes for the chip communication modules are becoming more and more complicated and bloated. The development of 5GredCap has also led to more consideration of efficiency, performance and stability when detecting communication modules. The existing detection schemes for communication modules usually require manual processing, that is, manual design of communication module schemes and testing and design of various detection commands for communication modules. In particular, the classification and information organization of communication modules require a lot of time. This method greatly reduces the detection efficiency of communication modules.
[0028] In order to solve the above problems, the following embodiments are provided: S10: Establish a command set library, wherein the command set library includes test cases for several different types of cellular communication modules, each test case includes at least one command, parameters for executing the command, and a functional description, each command, parameters for executing the command, and a functional description are stored in the test case in a coded form, and each test case is stored in the command set library in a coded form.
[0029] The test case encoding method comprises the following steps: S11: Determine the command type and specific characters of the command, and encode them as the first type.
[0030] S12: Determine the incoming parameter of the command and encode it as the second type.
[0031] S13: Determine a specific functional statement of the command and encode it as the third type.
[0032] S14: Determine the function number of the command and encode it as the fourth type.
[0033] S15: Combining the first type, the second type, the third type and the fourth type to obtain the code of the command.
[0034] For example, in the AT command set of the EC20 module, the "AT+CSCS" command indicates the character set selection, which can be expressed as follows when encoding: AT+CSCS-UCS2-choose_charset-0001 Different types of codes are separated by the symbol "-". When obtaining information from the code, the information that can be read is that AT+CSCS is the AT command, and the specific command character is "CSCS". Due to the characteristics of the AT command, the actual characters entered when executing a specific command are "AT+CSCS", and UCS2 is the specific parameter for executing the command. The actual command converted is: AT+CSCS="UCS2", that is, the selection type is "UCS2 character set", choose_charset is the function, and the last digital code 0001 means that the first entered function of "AT+CSCS" is to select the character set. The purpose here is to distinguish the functions, because different manufacturers may use the same command symbols when producing communication modules, but the actual functions are different, that is, the same command may have multiple functions.
[0035] In addition, some commands may have only one function. For example, "AT+GMI" means obtaining manufacturer information. It has only one function and does not require writing parameters. If the function represented in different devices is also unique, it can be represented as follows when encoding: AT+GMI-none-get_producers-0001 The parameter written in the parameter column is "none", that is, the parameter is empty, and the number at the end can be numbered in the normal order. If it only has a single function, it only has a unique number 0001.
[0036] After integrating the test commands of different modules, the command set obtained is combined with the specific parameters of the command to form a complete test case for a module. The same module can have different test cases, and the same test case can also be used on different test modules. Therefore, the test cases can be encoded separately. In this way, the information of the incoming test file only needs to contain the code of the test case to obtain all the test-related information of the test piece, which greatly speeds up the scheduling of the plan.
[0037] In the above scheme, only an exemplary case of the AT command set is given, but it should be noted that the present invention is not limited to the content recorded in this embodiment, so the use of other types of commands for encoding is also within the protection scope of this embodiment.
[0038] The coding of test cases does not require an overly complicated scheme, you only need to ensure that the number of each test case is unique.
[0039] In addition, to facilitate the subsequent tracing and troubleshooting of test cases, you can also perform the following steps: S101: Map all test cases to a network topology diagram, and encode all test cases with topology tags in the network topology diagram.
[0040] S102: When a new test case is input, the topology block mark of the network topology diagram is retrieved and traversed to obtain the code composed of the topology block marks. If a new command appears, a new topology block is added, the topology block is marked, and the topology block is pointed to the command.
[0041] Since the network topology diagram is too large, this embodiment only uses a simple topology diagram for explanation. Figure 1 As shown, for the string of numbers 163245, it is mapped to Figure 1 In the topological diagram shown in Figure 1 The bold part in the figure is as follows: the order is to execute the commands AT+GMI, AT+GGATT, AT+CMGF, AT+CSCS, AT+CMGF, AT+CSQ in sequence, thus obtaining a test case with execution order, commands, command parameters and functions. Figure 1 The content is for explanation only and is not an actual solution for the test cases used in actual testing.
[0042] The scheme of mapping test cases into network topology diagrams can greatly reduce the amount of test case data storage, accelerate the detection speed of test cases, and improve the overall efficiency.
[0043] S20: Obtain information of the input test file through the data reading module, compare it with the command set library, and determine the test case of the test piece.
[0044] The test file generally contains the information of the test piece itself, such as serial port type, baud rate, data bit, stop bit, parity, flow control, and read timeout time. According to different types of test schemes and tests on different serial ports, this information needs to be initialized before testing to ensure the accuracy of the test information and avoid communication failures.
[0045] To initialize the serial port, you usually need to call the pyserial module: ser=serial.Serial(), which can be used to directly configure various information of the serial port.
[0046] Based on the above content, specifically, step S20 also includes the following steps: S21: Call the pandas module to read the input test file and detect whether there is coding information of the test case in the test file. If so, directly determine the test case based on the coding information. If there is no coding information, or if there is coding information but the information is incorrect, execute step S22.
[0047] The Pandas module needs to select different methods to read test files according to the different formats of the test files. For example, when the test file is an Excel file, the method to be called for reading the test file is: pd.read_excel(file_path); and when the test file is a CSV file, the method to be called is: pd.read_csv(file_path). Usually, in order to facilitate the readability and backtracking of subsequent files, it is better to use Excel files. When using Pandas to read and write Excel files, the openpyxl library is also required to assist, which is executed through the Pandas module, and the openpyxl library is used as an engine to handle the writing operation of Excel files.
[0048] For example: import pandas as pd data={ 'Column1':[1,2,3], 'Column2':['A','B','C'] } df = pd.DataFrame(data) df.to_excel('output.xlsx',index=False,engine='openpyxl') The function of the above code is to save the data into an Excel file named output.xlsx, where each column corresponds to the column of the DataFrame and each row corresponds to the row of the DataFrame. The encoding information only needs to be saved in the rows of the DataFrame, and each row represents one encoding information.
[0049] When reading a test file, if there is coding information of a test case, due to the uniqueness of the coding information, the specific content of the corresponding test case can be directly found, and the specific information of the command under the test case, such as command information, parameters, and specific functions, can be further read.
[0050] However, in some cases, the type of the test piece itself may be uncertain or no data may be entered. In this case, it is impossible to directly determine the specific test plan and the actual function corresponding to the command for communicating with the test piece. In this case, if there is erroneous coding information, the coding information will be marked (for the convenience of subsequent reviewers) and step S22 will be executed. If there is no coding information, step S22 will be executed directly.
[0051] S22: Send several commands to the test piece through the pyserial module, and determine the actual function of the command according to the return data of the pyserial module response, until the actual functions of all commands are determined, and determine the test case according to the several commands sent, wherein the several commands are the commands containing the largest number of functions.
[0052] Although the function of the command cannot be known, the commands supported by the test piece and the specific functions of the commands can be determined by randomly sending commands and the data returned after the response. Since the number of test commands is limited, continuously sending data to the test piece can gradually narrow the scope of confirming the specific type of the test piece. Therefore, according to the different data returned by the command, the scope of the actual information of the test piece can be gradually narrowed. When the input commands reach a certain level, the commands and functions supported by the test piece can be determined. After the commands actually supported by the test piece are determined, they can be compared with the commands in the test case based on the supported commands. If the command part and the function overview are the same, the information of the test case can be determined, and then the parameter information in the test case can be extracted to reversely infer the test case of the unknown test piece.
[0053] In the above scheme, the number of commands to be sent may be large, and the overall response time is long. In order to reduce resource occupation, the following steps may be performed before executing step S22: S221: Read the function overview information in the encoding information of all commands in the command set library through the data reading module.
[0054] S222: Create a function table according to the number of functions recorded in the function overview, and arrange the commands in the function table in descending order according to the number of functions.
[0055] S223: Filter several commands from the command with the largest number of functions in the function table downward until the test case can be determined in step S22.
[0056] Step S221 is to obtain the command set function overview information, and the purpose of step S222 is to confirm the sorting of commands according to complexity, so that after the more complex commands are confirmed, the range of other commands matching this command will be narrowed, and searching downward from the complex position can greatly reduce the overall search time.
[0057] When the network topology diagram recorded in step S101 is used to save the test case, since all test cases are converted into a topologically connected state, commands that do not have a connection relationship can be directly omitted, thereby further accelerating the command recognition speed. That is, when a command is sent to the test piece, if the return is the correct command and the functional overview is exactly the same, the topology block corresponding to the command can be marked in the network topology diagram, and the command with the largest number of functions can be selected from other topology blocks connected to the topology block for the next test (search and compare from the function table). This further reduces the number of commands that need to be sent during the test and further accelerates the overall retrieval speed.
[0058] The specific steps are as follows: S2231: Perform communication tests from the command with the largest number of functions downward in the function table until the first command that passes the test is located, and locate the topology block corresponding to the command in the network topology diagram.
[0059] S2232: Traverse downward with the located topology block to obtain all connected topology blocks.
[0060] S2233: Execute steps S2231 and S2232 in a loop until the topology chain forms a closed loop or there are no connected topology blocks after traversing the topology blocks downward, output the code formed by connecting all the located topology blocks, and determine the test case based on the code.
[0061] Unlike conventional coding, what needs to be checked in the coding of test cases is the sameness of the data, not the order, because the tags screened in this way are usually the same, but the tags of each topology block are different from the order of tags when they are entered. In this way, when searching, you only need to find the tags that are exactly the same. When executing the specific test cases in order, just follow the order when they were entered.
[0062] For example, Figure 1 When the test cases entered are 163245, the order that may be obtained during mapping is 523641. You only need to ensure that the tags are the same and confirm that the order of the test cases is still the order when they were entered. That is, the final test order is still: AT+GMI, AT+GGATT, AT+CMGF, AT+CSCS, AT+CMGF, AT+CSQ.
[0063] After the test case of the test piece is determined, step S30 is executed.
[0064] S30: Call the pyserial module to communicate with the test piece, and perform tests through the test module according to the incoming test cases, and save the test results separately.
[0065] The test piece is tested through a test module, which generally includes a function test module, a pressure test module and a stability test module.
[0066] Among them, the functional test module is used to check whether the main functions of the test piece can be used normally.
[0067] The stress test module is used to perform stress testing on the test piece under certain characteristic conditions. During stress testing, some parameters are usually stored in a CSV file, such as response time, throughput, resource usage, etc.
[0068] The stability test module needs to be combined with the DTR module in the pyserial module and the serial port transceiver function, usually including power on and off test, soft restart test, Key sleep test, Uart sleep test, CFUN switch test, random power on and off test, and TCP test.
[0069] Among them, the soft restart test, Uart sleep test, CFUN switch test and TCP test can directly send AT commands or TCP commands and monitor data through the pyserial module, while the power-on and power-off test, random power-on and power-off test and Key sleep test need to call the DTR function to implement.
[0070] For power-on and power-off tests of the communication module, you usually need to set the serial port number and timeout to open the serial port connection, and then set the relay signal by calling ser.setDTR(), for example: import serial import time ser=serial.Serial('COM1',9600,timeout=1) ser.setDTR(True) time.sleep(5) ser.setDTR(False) time.sleep(5) ser.close() Among them, "ser=serial.Serial('COM1',9600,timeout=1)" means creating a serial port object and connecting it to the serial port named COM1, setting the baud rate to 9600 and the timeout to 1 second. "ser.setDTR(True)" means setting the DTR signal to a high level, that is, turning on the relay. When the value is "False", it means setting the DTR signal to a low level, that is, turning off the relay. "time.sleep(5)" means maintaining for 5 seconds.
[0071] The soft restart test of the communication module needs to be combined with the sending of AT commands, for example: import serial import time ser = serial.Serial( port='COM1', baudrate=9600, timeout=1 ) restart_command = 'AT+CFUN=1,1\r' try: ser.write(restart_command.encode()) response = ser.read(100) print("Received response:", response.decode('ascii')) print("Waiting for module to restart...") time.sleep(30) ser.write(b'AT\r') response = ser.read(100) print("Test command response:", response.decode('ascii')) finally: ser.close() Among them, "ser=serial.Serial" is used to configure the serial port, and the parameters in the brackets below are the specific parameters of the serial port configuration, such as the serial port name is "COM1", the baud rate is 9600, and the timeout period is 1 second.
[0072] In this example, the AT+CFUN command is used to restart. The command can be changed according to different test cases. "ser.write" is used to send the restart command to the communication module. "time.sleep(30)" indicates the waiting time. This time needs to cover the module restart time to ensure that the module has sufficient time to restart. Finally, "ser.write(b'AT\r')" is used to check the module to determine whether the module responds to the restart command.
[0073] After completing all the tests, the data is saved through the pandas module. For the convenience of subsequent reference, the file can be saved in an Excel file. In addition, the data can also be saved in an HTML document. The data analysis script in the web page can be called to output the test data in a chart format, which can more intuitively display the results of batch testing. The specific form of expression is as follows: Figure 2 As shown, the upper left corner shows summary information such as the number of tests and test time, the upper right corner shows the sector ratio chart after batch testing, and the bottom shows the actual output information of each test.
[0074] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them.
Claims
1. A method for improving the testing efficiency of a 5GRedCap cellular communication module, characterized in that: The steps include: S10: Establishing a command set library, the command set library includes test cases of several different types of cellular communication modules, each test case includes at least one command, parameters for executing the command, and a functional description, each command, the parameters for executing the command, and the functional description are stored in the test case in a coded form, and each test case is stored in the command set library in a coded form; S20: obtaining information of the input test file through the data reading module, comparing it with the command set library, and determining the test case of the test piece; S30: Call the pyserial module to communicate with the test piece, and perform tests through the test module according to the incoming test cases, and save the test results separately.
2. The method for improving the test efficiency of the 5GRedCap cellular communication module according to claim 1, characterized in that: The test case encoding method comprises the following steps: S11: Determine a command type and specific characters of the command, and encode them as a first type; S12: Determine an incoming parameter of the command and encode it as a second type; S13: Determine the specific functional description of the command and encode it as the third type: S14: Determine the number of functions of the command and encode it as a fourth type; S15: Combining the first type, the second type, the third type and the fourth type to obtain the code of the command.
3. The method for improving the test efficiency of the 5GRedCap cellular communication module according to claim 1, characterized in that: The step S10 comprises the following steps: S101: Map all test cases to a network topology diagram, and encode all test cases with topology tags in the network topology diagram; S102: When a new test case is input, the topology block mark of the network topology diagram is retrieved and traversed to obtain the code composed of the topology block marks. If a new command appears, a new topology block is added, the topology block is marked, and the topology block is pointed to the command.
4. The method for improving the test efficiency of the 5GRedCap cellular communication module according to claim 3, characterized in that: The step S20 comprises the following steps: S21: Call the pandas module to read the input test file, and detect whether there is coding information of the test case in the test file. If so, directly determine the test case according to the coding information. If there is no coding information, or if there is coding information but the information is incorrect, execute step S22; S22: Send several commands to the test piece through the pyserial module, and determine the actual function of the command according to the return data of the pyserial module response, until the actual functions of all commands are determined, and determine the test case according to the several commands sent, wherein the several commands are the commands containing the largest number of functions.
5. The method for improving the testing efficiency of the 5GRedCap cellular communication module according to claim 4, characterized in that: The step S22 comprises the following steps: S221: Reading function overview information in the encoding information of all commands in the command set library through a data reading module; S222: creating a function table according to the number of functions recorded in the function summary, wherein the commands in the function table are arranged in descending order according to the number of functions; S223: Filter several commands from the command with the largest number of functions in the function table downward until the test case can be determined in step S22.
6. The method for improving the testing efficiency of the 5GRedCap cellular communication module according to claim 5, characterized in that: The step S223 includes the following steps: S2231: Perform communication tests from the command with the largest number of functions downward in the function table until the first command that passes the test is located, and locate the topology block corresponding to the command in the network topology diagram; S2232: Traverse downward with the located topology block to obtain all connected topology blocks; S2233: Execute steps S2231 and S2232 in a loop until the topology chain forms a closed loop or there are no connected topology blocks after traversing the topology blocks downward, output the code formed by connecting all the located topology blocks, and determine the test case based on the code.
7. The method for improving the testing efficiency of 5GRedCap cellular communication module according to claim 1, characterized in that: The test modules include a functional test module, a stress test module and a stability test module; The functional testing module is used to check whether the main functions of the test piece can be used normally; The pressure test module is used to perform pressure testing on the test piece under certain characteristic conditions; The stability test module performs at least the following tests on the test piece: power on and off test, soft restart test, Key sleep test, Uart sleep test, CFUN switch test, random power on and off test, and TCP test.
8. The method for improving the testing efficiency of the 5GRedCap cellular communication module according to claim 7, characterized in that: The soft restart test, Uart sleep test, CFUN switch test and TCP test send AT commands or TCP commands and monitor data through the pyserial module; The power on and off test, random power on and off test and Key sleep test realize the power on and off control of the relay or the development board by calling the DTR function.
Citation Information
Patent Citations
Error report analysis method and device, computer equipment and storage medium
CN114168429A
Performance test method and performance test system for dual-mode communication module
CN115833964A
Automatic testing method and system
CN115878446A
Test system of communication equipment
CN117062131A
Test module generation apparatus, test procedure generation apparatus, generation method, program, and test apparatus
US20130139004A1
