Disclosure of Invention
The invention aims to overcome the defect of low test efficiency when a cyclic test command is manually input in the prior art, and provides a test method, a system, equipment and a medium of a wireless communication module.
The invention solves the technical problems by the following technical scheme:
the invention provides a testing method of a wireless communication module, which comprises the following steps:
acquiring a sequence number corresponding to a first AT command; the first AT command is all AT commands in a first test program for testing the wireless communication module; the serial number is used for representing the sequence of executing AT commands when the wireless communication module is tested;
acquiring a second AT command; the second AT command is an AT command required to be added to the first test program;
acquiring a position in the first test program to which the second AT command needs to be added;
determining a corresponding sequence number of the second AT command in the first test program according to the position;
judging whether the serial number of each AT command in a first test program is larger than or equal to the corresponding serial number of the second AT command in the first test program or not respectively, if so, automatically adding one to the serial number of the AT command, and if not, keeping the serial number of the AT command unchanged;
adding the second AT command to the first test program according to the corresponding serial number to generate a second test program;
and executing the second test program to test the wireless communication module.
Preferably, the test method further comprises:
acquiring a target test item;
acquiring a search keyword corresponding to the target test item;
inquiring an AT command corresponding to the search keyword from a database; the database is used for pre-storing test items and corresponding AT commands of the wireless communication module; the AT commands include the first AT command or the second AT command.
Preferably, the database comprises a function data table and a command data table; the function data table is used for recording the functions of the AT command; the command data table is used for recording AT commands; the function of the AT command corresponds to the AT command.
Preferably, after the step of executing the second test program to test the wireless communication module, the test method further includes:
when the test of the wireless communication module is completed, generating a LOG file;
acquiring prompt information generated when the AT command is executed in error from the LOG file;
determining a third AT command according to the prompt information; the third AT command characterizes the execution of the AT command by the test wireless communication module, and executes the AT command with error;
acquiring the success rate of the third AT command;
judging whether the success rate is smaller than a preset threshold value, if so, determining that the error of the third AT command is acceptable;
and/or, the test method further comprises:
receiving a restarting instruction;
stopping the test of the wireless communication module and saving the current test progress;
restarting the test of the wireless communication module, continuously executing the AT command which is not executed yet according to the current test progress, and continuously testing.
The invention also provides a test system of the wireless communication module, which comprises:
the first acquisition module is used for acquiring a sequence number corresponding to the first AT command; the first AT command is all AT commands in a first test program for testing the wireless communication module; the serial number is used for representing the sequence of executing AT commands when the wireless communication module is tested;
the second acquisition module is used for acquiring a second AT command; the second AT command is an AT command required to be added to the first test program;
a third obtaining module, configured to obtain a position where the second AT command needs to be added to the first test program;
the first determining module is used for determining a corresponding sequence number of the second AT command in the first test program according to the position;
the first judging module is used for respectively judging whether the serial number of each AT command in the first test program is larger than or equal to the corresponding serial number of the second AT command in the first test program, if so, automatically adding one to the serial number of the AT command, and if not, keeping the serial number of the AT command unchanged; the first generation module is used for adding the second AT command into the first test program according to the corresponding serial number to generate a second test program;
and the first test module is used for executing the second test program and testing the wireless communication module.
Preferably, the test system further comprises:
the fourth acquisition module is used for acquiring the target test item;
a fifth acquisition module, configured to acquire a search keyword corresponding to the target test item;
the query module is used for querying the AT command corresponding to the search keyword from the database; the database is used for pre-storing test items and corresponding AT commands of the wireless communication module; the AT commands include the first AT command or the second AT command.
Preferably, the database comprises a function data table and a command data table; the function data table is used for recording the functions of the AT command; the command data table is used for recording AT commands; the function of the AT command corresponds to the AT command.
Preferably, the test system further comprises:
the second generation module is used for generating LOG files when the wireless communication module is tested;
the third generation module is used for acquiring prompt information generated when the AT command is executed in error from the LOG file;
the second determining module is used for determining a third AT command according to the prompt information; the third AT command characterizes the execution of the AT command by the test wireless communication module, and executes the AT command with error;
a sixth obtaining module, configured to obtain a success rate of the third AT command;
a second judging module for judging whether the success rate is smaller than a preset threshold value, if yes, then
An error of the third AT command is determined to be an acceptable error.
And/or, the test system further comprises:
the receiving module is used for receiving a restarting instruction;
the storage module is used for stopping the test of the wireless communication module and storing the current test progress;
and the second test module is used for restarting the test of the wireless communication module, continuously executing the AT command which is not executed yet according to the current test progress, and continuously testing.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the testing method of the wireless communication module when executing the computer program.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of testing a wireless communication module as described above.
The invention has the positive progress effects that:
the invention automatically adjusts the sequence number of the AT command by automatic comparison and calculation, and automatically adds the AT command into the correct position, thereby improving the testing efficiency of the wireless communication module.
Detailed Description
The invention is further illustrated by means of the following examples, which are not intended to limit the scope of the invention.
Example 1
As shown in fig. 1, the present embodiment discloses a method for testing a wireless communication module, where the method includes:
step S1011, acquiring a sequence number corresponding to a first AT command; the first AT command is all AT commands in a first test program for testing the wireless communication module; the serial number is used for representing the sequence of executing AT commands when the wireless communication module is tested;
step S1012, obtaining a second AT command; the second AT command is an AT command required to be added to the first test program;
step S1013, obtaining a position in the first test procedure where the second AT command needs to be added;
step S1014, determining a sequence number corresponding to the second AT command in the first test procedure according to the position;
step S1015, respectively determining whether the sequence number of each AT command in the first test program is greater than or equal to the corresponding sequence number of the second AT command in the first test program, if yes, executing step S1016, and if no, executing step S1017;
step S1016, automatically adding one to the sequence number of the AT command; after the step is performed, step S1018 is performed;
step S1017, keeping the sequence number of the AT command unchanged;
step S1018, adding the second AT command to the first test program according to the corresponding sequence number, and generating a second test program;
step S1019, executing the second test program, and testing the wireless communication module.
In this embodiment, by acquiring the AT command to be added to the first test program, determining the position of the AT command to be added to the test program for testing the wireless communication module, determining the corresponding sequence number of the AT command to be added to the first test program in the test program, determining whether the sequence number of each AT command in the test program is greater than or equal to the corresponding sequence number of the AT command to be added to the first test program in the test program, if yes, automatically adding one to the sequence number of the AT command, if no, keeping the sequence number of the AT command unchanged, generating a new test program, executing the new test program, and testing the wireless communication module, thereby improving the test efficiency of the wireless communication module.
In an embodiment, the test method further comprises:
acquiring a target test item;
acquiring a search keyword corresponding to the target test item;
inquiring an AT command corresponding to the search keyword from a database; the database is used for pre-storing test items and corresponding AT commands of the wireless communication module; the AT commands include the first AT command or the second AT command. Specifically, the database comprises a function data table and a command data table; the function data table comprises a basic test function data table and a special testA functional test data table; the function data table is used for recording the functions of the AT command; the command data table is used for recording AT commands; the function of the AT command corresponds to the AT command; the command data table comprises AT commands respectively corresponding to the basic test function data table and the special test function test data table. Wherein, basic test functions such as: SMS, CALL, PB, TCPIP, GPRS, DSDS, etc.; specialized test functions such as: FTP, HTTP, TTS, AUDIO, RECORD, NTP, GPS, LBS, etc. The database in which one table creates a function item, such as SMS, and correspondingly another table creates a command item, such as at+cmgf=1, is combined in advance with the test tool of the wireless communication module. The configuration of the AT command in the test tool of the wireless communication module can call the corresponding AT command from the database according to the test items to perform the test procedureAT commandSpecifically, keywords can be input in a search box in a test tool to quickly match and search for an AT command, and once the configuration is completed, the AT command can be recycled when the same item is tested on a wireless communication module later.
In this embodiment, by setting the function data table and the command data table in the database, the AT command is associated with the function description, so that the AT command can be more accurately invoked from the database when the wireless communication module is tested. In addition, the function data table is divided into a basic test function data table and a special test function test data table in the database, and the corresponding command data table is set, so that the AT command is more efficiently and quickly called from the database.
In an embodiment, after the step of executing the second test program to test the wireless communication module, the test method further includes:
when the test of the wireless communication module is completed, generating a LOG file;
acquiring prompt information generated when the AT command is executed in error from the LOG file;
determining a third AT command according to the prompt information; the third AT command characterizes the execution of the AT command by the test wireless communication module, and executes the AT command with error;
acquiring the success rate of the third AT command;
and judging whether the success rate is smaller than a preset threshold value, if so, determining that the error of the third AT command is acceptable, and executing the AT command. If not, determining that the error of the third AT command is an unacceptable error, and not passing the execution of the AT command. Specifically, the success rate in the LOG file is calculated by acquiring the number of executions of the AT command in which the error occurred and the number of errors in executing the AT command. Wherein, the calculation formula is W= (1-A/B) ×100%, wherein A is the number of times of executing the AT command error, and B is the number of times of executing the AT command error.
According to the embodiment, when the wireless communication module is tested, a LOG file is generated, prompt information generated when the AT command is executed is obtained from the LOG file to determine that the AT command is executed by the tested wireless communication module, the AT command with the error is executed, whether the error is acceptable error is analyzed according to the success rate corresponding to the AT command with the error, whether the AT command is executed is determined to be passed or not, and further sufficient data is provided for the subsequent test staff to analyze the test result.
In an embodiment, the test method further comprises:
receiving a restarting instruction;
stopping the test of the wireless communication module and saving the current test progress;
restarting the test of the wireless communication module, continuously executing the AT command which is not executed yet according to the current test progress, and continuously testing.
In this embodiment, by stopping the test of the wireless communication module, saving the current test progress, restarting the test of the wireless communication module, and continuing to execute the AT command that has not been executed according to the current test progress, the test of the wireless communication module is not required to be started from the beginning, so that the test time is greatly saved, and the test efficiency is improved.
The embodiment discloses a test method of a wireless communication module, the test method includes the steps of obtaining an AT command required to be added to a first test program, judging the position of the AT command required to be added to the test program for testing the wireless communication module, determining the corresponding sequence number of the AT command required to be added to the first test program in the test program, judging whether the sequence number of each AT command in the test program is greater than or equal to the corresponding sequence number of the AT command required to be added to the first test program in the first test program, if yes, automatically adding one to the sequence number of the AT command, if no, keeping the sequence number of the AT command unchanged, generating a new test program, executing the new test program, and testing the wireless communication module, thereby improving the test efficiency of the wireless communication module. In addition, the test method also sets the function data table, the command data table, the basic test function data table and the special test function test data table in the database, so that the AT command is more efficiently and rapidly called from the database, and the test efficiency is further improved. Meanwhile, the test of the wireless communication module is restarted and stopped, the current test progress is saved, the test is restarted, and the AT command which is not executed yet is continuously executed according to the current test progress, so that the test efficiency is improved. The test method further comprises the steps of generating a LOG file when the test of the wireless communication module is completed, and determining whether the AT command is executed or not based on whether an error occurring when the AT command is executed in the LOG file is an acceptable error, so that sufficient data is provided for subsequent testers to analyze the test result.
Example 2
As shown in fig. 2, the present embodiment discloses a test system of a wireless communication module, the test system includes:
thefirst acquisition module 1 is used for acquiring a sequence number corresponding to a first AT command; the first AT command is all AT commands in a first test program for testing the wireless communication module; the serial number is used for representing the sequence of executing AT commands when the wireless communication module is tested;
a second acquiringmodule 2, configured to acquire a second AT command; the second AT command is an AT command required to be added to the first test program;
a third obtainingmodule 3, configured to obtain a position where the second AT command needs to be added to the first test program;
a first determiningmodule 4, configured to determine, according to the position, a sequence number corresponding to the second AT command in the first test program;
afirst judging module 5, configured to judge whether the sequence number of each AT command in the first test program is greater than or equal to the sequence number corresponding to the second AT command in the first test program, if yes, automatically adding one to the sequence number of the AT command, and if no, keeping the sequence number of the AT command unchanged;
afirst generating module 6, configured to add the second AT command to the first test program according to a corresponding sequence number, and generate a second test program;
and thefirst test module 7 is used for executing the second test program and testing the wireless communication module.
A fourth acquisition module 8, configured to acquire a target test item;
a fifth obtaining module 9, configured to obtain a search keyword corresponding to the target test item;
aquery module 10, configured to query, from a database, an AT command corresponding to the search keyword; the database is used for pre-storing test items and corresponding AT commands of the wireless communication module; the AT commands include the first AT command or the second AT command. Specifically, the database comprises a function data table and a command data table; the function data table comprises a basic test function data table and a special test function test data table; the function data table is used for recording the functions of the AT command; the command data table is used for recording AT commands; the function of the AT command corresponds to the AT command; the command data table comprises AT commands respectively corresponding to the basic test function data table and the special test function test data table. Wherein, basic test functions such as: SMS, CALL, PB, TCPIP, GPRS, DSDS, etc.; specialized test functions such as: FTP, HTTP, TTS, AUDIO, RECORD, NTP, GPS, LBS, etc. The database in which one table creates a function item, such as SMS, and correspondingly another table creates a command item, such as at+cmgf=1, is combined in advance with the test tool of the wireless communication module. The configuration of the AT command in the testing tool of the wireless communication module can call the corresponding AT command from the database according to the test item, the configuration of the AT command of the testing program is carried out, the keyword can be input in the searching box in the testing tool to carry out quick matching and searching of the AT command, and once the configuration is finished, the AT command can be recycled when the same item is tested on the wireless communication module later.
In this embodiment, by setting the function data table and the command data table in the database, the AT command is associated with the function description, so that the AT command can be more accurately invoked from the database when the wireless communication module is tested. In addition, the function data table is divided into a basic test function data table and a special test function test data table in the database, and the corresponding command data table is set, so that the AT command is more efficiently and quickly called from the database.
Asecond generating module 11, configured to generate a LOG file when the test on the wireless communication module is completed;
athird generating module 12, configured to obtain, from the LOG file, a hint information generated when the AT command is executed in error;
a second determiningmodule 13, configured to determine a third AT command according to the prompt information; the third AT command characterizes the execution of the AT command by the test wireless communication module, and executes the AT command with error;
a sixth obtainingmodule 14, configured to obtain a success rate of the third AT command;
and a second judgingmodule 15, configured to judge whether the success rate is smaller than a preset threshold, if yes, determine that the error of the third AT command is an acceptable error, where the AT command is executed. If not, determining that the error of the third AT command is an unacceptable error, and not passing the execution of the AT command. Specifically, the success rate in the LOG file is calculated by acquiring the number of executions of the AT command in which the error occurred and the number of errors in executing the AT command. Wherein, the calculation formula is W= (1-A/B) ×100%, wherein A is the number of times of executing the AT command error, and B is the number of times of executing the AT command error.
According to the embodiment, when the wireless communication module is tested, a LOG file is generated, prompt information generated when the AT command is executed is obtained from the LOG file to determine that the AT command is executed by the tested wireless communication module, the AT command with the error is executed, whether the error is acceptable error is analyzed according to the success rate corresponding to the AT command with the error, whether the AT command is executed is determined to be passed or not, and further sufficient data is provided for the subsequent test staff to analyze the test result.
A receivingmodule 16, configured to receive a restart instruction;
a savingmodule 17, configured to stop the test of the wireless communication module and save the current test progress;
and thesecond test module 18 is configured to restart the test of the wireless communication module, continue executing the AT command that has not been executed according to the current test progress, and continue the test.
In this embodiment, by stopping the test of the wireless communication module, saving the current test progress, restarting the test of the wireless communication module, and continuing to execute the AT command that has not been executed according to the current test progress, the test of the wireless communication module is not required to be started from the beginning, so that the test time is greatly saved, and the test efficiency is improved.
The embodiment discloses a test system of a wireless communication module, the test system obtains an AT command required to be added to the first test program, judges the position of the AT command required to be added to the test program of the wireless communication module, determines the corresponding sequence number of the AT command required to be added to the first test program in the test program, judges whether the sequence number of each AT command in the test program is greater than or equal to the corresponding sequence number of the AT command required to be added to the first test program in the first test program, if yes, automatically adds one to the sequence number of the AT command, if no, the sequence number of the AT command is kept unchanged, generates a new test program, executes the new test program, and tests the wireless communication module, thereby improving the test efficiency of the wireless communication module. In addition, the test method also sets the function data table, the command data table, the basic test function data table and the special test function test data table in the database, so that the AT command is more efficiently and rapidly called from the database, and the test efficiency is further improved. Meanwhile, the test of the wireless communication module is restarted and stopped, the current test progress is saved, the test is restarted, and the AT command which is not executed yet is continuously executed according to the current test progress, so that the test efficiency is improved. The test method further comprises the steps of generating a LOG file when the test of the wireless communication module is completed, and determining whether the AT command is executed or not based on whether an error occurring when the AT command is executed in the LOG file is an acceptable error, so that sufficient data is provided for subsequent testers to analyze the test result.
Example 3
Fig. 3 is a schematic structural diagram of an electronic device according toembodiment 3 of the present invention. The electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, which when executed implements the method for testing a wireless communication module provided inembodiment 1. Theelectronic device 40 shown in fig. 3 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 3, theelectronic device 40 may be embodied in the form of a general purpose computing device, which may be a server device, for example. Components ofelectronic device 40 may include, but are not limited to: the at least oneprocessor 41, the at least onememory 42, abus 43 connecting the different system components, including thememory 42 and theprocessor 41.
Thebus 43 includes a data bus, an address bus, and a control bus.
Memory 42 may include volatile memory such as Random Access Memory (RAM) 421 and/orcache memory 422, and may further include Read Only Memory (ROM) 423.
Memory 42 may also include a program/utility 425 having a set (at least one) ofprogram modules 424,such program modules 424 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Theprocessor 41 executes various functional applications and data processing such as the test method of the wireless communication module provided inembodiment 1 of the present invention by running a computer program stored in thememory 42.
Theelectronic device 40 may also communicate with one or more external devices 44 (e.g., keyboard, pointing device, etc.). Such communication may be through an input/output (I/O)interface 45. Also, model-generatingdevice 40 may also communicate with one or more networks, such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet, vianetwork adapter 46. As shown, thenetwork adapter 46 communicates with the other modules of the model-generatingdevice 40 via thebus 43. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in connection with the model-generatingdevice 40, including, but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, data backup storage systems, and the like.
It should be noted that although several units/modules or sub-units/modules of an electronic device are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more units/modules described above may be embodied in one unit/module in accordance with embodiments of the present invention. Conversely, the features and functions of one unit/module described above may be further divided into ones that are embodied by a plurality of units/modules.
Example 4
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of testing a wireless communication module provided byembodiment 1.
More specifically, among others, readable storage media may be employed including, but not limited to: portable disk, hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible embodiment, the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the test method for implementing the wireless communication module provided inembodiment 1, when said program product is run on the terminal device.
Wherein the program code for carrying out the invention may be written in any combination of one or more programming languages, which program code may execute entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on the remote device or entirely on the remote device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the principles and spirit of the invention, but such changes and modifications fall within the scope of the invention.