CN115314427A - Protocol testing method, electronic equipment and chip system - Google Patents

Protocol testing method, electronic equipment and chip system Download PDF

Info

Publication number
CN115314427A
CN115314427A CN202211242967.1A CN202211242967A CN115314427A CN 115314427 A CN115314427 A CN 115314427A CN 202211242967 A CN202211242967 A CN 202211242967A CN 115314427 A CN115314427 A CN 115314427A
Authority
CN
China
Prior art keywords
instruction
protocol
tested
test
instructions
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211242967.1A
Other languages
Chinese (zh)
Other versions
CN115314427B (en
Inventor
安东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211242967.1A priority Critical patent/CN115314427B/en
Publication of CN115314427A publication Critical patent/CN115314427A/en
Application granted granted Critical
Publication of CN115314427B publication Critical patent/CN115314427B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Communication Control (AREA)

Abstract

The embodiment of the application discloses a protocol testing method, electronic equipment and a chip system, which are applicable to the technical field of communication, wherein the method comprises the following steps: at least one second instruction is randomly selected from an instruction set containing at least one first instruction. And randomly ordering all the second instructions. And performing communication connection test on the protocol to be tested in the equipment to be tested based on the second instruction after random sequencing to obtain first compatibility test data of the protocol to be tested. The embodiment of the application can improve the effectiveness of the compatibility test of the communication protocol.

Description

Protocol testing method, electronic equipment and chip system
Technical Field
The present application relates to the field of communications technologies, and in particular, to a protocol testing method, an electronic device, and a chip system.
Background
In order to meet market demands, manufacturers of electronic devices may perform secondary development on communication protocol contents supported by the electronic devices based on protocol standards, that is, perform operations such as certain adjustment or customization. For example, the protocol flow of the communication protocol may be adjusted as needed. Therefore, in practical applications, even for the same type of communication protocol, the contents of the communication protocols in different electronic devices may have a certain difference.
Taking bluetooth protocol as an example, the number of electronic devices (hereinafter referred to as bluetooth devices) supporting bluetooth protocol on the market is hundreds of millions, and the devices and functions of these bluetooth devices may have certain differences. In practical applications, after secondary development of bluetooth protocols is performed for respective bluetooth device conditions by different manufacturers, a large number of bluetooth protocols having certain differences in contents are generated.
The compatibility of the communication protocol is also called interoperability, and refers to the capability of the electronic equipment installed with the communication protocol to normally communicate with other electronic equipment installed with the same kind of communication protocol based on the communication protocol. In practical application, the secondary development conditions of different manufacturers for the communication protocol may be different, so that it is difficult for testers to effectively test the compatibility of the communication protocol, and the effectiveness of the test on the compatibility of the communication protocol is low.
Disclosure of Invention
In view of this, embodiments of the present application provide a protocol testing method, an electronic device, and a chip system, which can improve the effectiveness of a communication protocol compatibility test.
A first aspect of an embodiment of the present application provides a protocol testing method, including:
at least one second instruction is randomly selected from an instruction set including at least one first instruction. And then all the second instructions are subjected to random sequencing processing. And finally, based on the second instruction after random sequencing, performing communication connection test on the protocol to be tested in the equipment to be tested to obtain first compatibility test data of the protocol to be tested.
The first instructions in the instruction set are all instructions supported in the protocol specification of the protocol to be tested. And performing communication connection test on the protocol to be tested in the equipment to be tested based on the second instructions after random sequencing, namely performing communication connection test on the protocol to be tested by using the second instructions according to the instruction sequence after random sequencing.
In the embodiment of the present application, by means of randomly selecting an instruction and randomly ordering the instruction, two most core contents in a protocol flow can be implemented: the instructions used by the flow and the simulation of the timing of the use of these instructions. Therefore, the embodiment of the application can realize the simulation of some possible real protocol flows, thereby realizing the simulation of various possible secondary development conditions of the protocol flows by a third party. Therefore, the embodiment of the application is not limited to the secondary development condition of the communication protocol mastered by the testers, can better meet the requirement of the actual communication protocol compatibility test, and greatly improves the effectiveness of the communication protocol compatibility test.
In a first possible implementation manner of the first aspect, a parameter set is obtained, where the parameter set includes at least one third instruction, and each third instruction is associated with at least one parameter value. And the third instructions in the parameter set are all instructions supported in the protocol specification of the protocol to be tested.
In a second possible implementation manner of the first aspect, after establishing a communication connection with a device under test by performing an operation of performing a communication connection test on a protocol under test in the device under test, the method further includes: a target instruction is selected from the at least one third instruction, and a target parameter value is selected from all parameter values associated with the target instruction. And sending the target instruction and the target parameter value to the equipment to be tested. And then acquiring a processing result of the equipment to be tested on the target parameter value to obtain second compatibility test data of the protocol to be tested.
In a third possible implementation manner of the first aspect, after establishing a communication connection with a device under test by performing a communication connection test on a protocol under test in the device under test, the method further includes: and randomly selecting one associated parameter value for each third instruction to obtain target parameter values associated with the third instructions one by one. And sending the third instruction and the associated target parameter value to the equipment to be tested. And then obtaining a processing result of the equipment to be tested on the target parameter value to obtain second compatibility test data of the protocol to be tested.
In the second possible implementation manner and the third possible implementation manner, by randomly selecting the instruction parameter values, the embodiment of the present application may simulate various possible real use conditions of the user, and may also simulate and test parameter value compatibility of the protocol to be tested under various possible secondary development real conditions of the instruction parameters. The method and the device can test the compatibility condition of the protocol to be tested and different parameter value forms under the condition that the specific parameter value of the protocol to be tested is unknown. Or the compatibility between the protocol to be tested and various parameter value setting modes can be tested under the condition that the parameter value setting modes of the protocol to be tested are known. Therefore, the method and the device can greatly improve the effectiveness of parameter testing in the protocol compatibility test to be tested.
Meanwhile, the protocol flow simulation and the simulation test of the protocol parameter value enable the embodiment of the application to simulate the possible real situation more comprehensively. Therefore, various secondary development conditions can be simulated as completely and truly as possible, the effect of simulating the compatibility of the protocol to be tested is improved, and the obtained test data is more effective.
In a fourth possible implementation manner of the first aspect, at least one third instruction includes a fourth instruction, and the parameter value associated with each fourth instruction includes an abnormal value, where the abnormal value is a parameter value that exceeds a value range of a parameter to which the abnormal value belongs. By setting the abnormal value and performing random selection test, the embodiment of the application can effectively test the processing capacity of the protocol to be tested on the abnormal value in the parameter test stage. Therefore, more possible secondary development real conditions of the instruction parameters and possible user use conditions can be simulated, and the compatibility test effectiveness on the parameter value processing capacity is higher.
In a fifth possible implementation manner of the first aspect, the instruction set includes at least one configuration file, and each configuration file includes at least one first instruction. Randomly fetching at least one second instruction from an instruction set containing at least one first instruction, comprising: and randomly selecting the first instruction for each configuration file to obtain at least one selected second instruction. The method and the device for selecting the instructions in the configuration file can achieve instruction selection in the configuration file level, so that the instruction selection is relatively balanced in the dimension of the configuration file, and the condition of extreme instruction distribution possibly caused by random instruction selection is reduced. Therefore, the selected instruction is relatively more fit to the actual situation which may occur in practical application, so that the random simulation of the protocol flow test scene in the embodiment of the application is more practical, and the effectiveness of the compatibility test is improved.
In a sixth possible implementation manner of the first aspect, after performing, based on the second instruction after the random sorting processing, an operation of performing a communication connection test on a protocol to be tested in the device to be tested, the method further includes: the total number of times of executing at least one second instruction operation randomly selected from an instruction set including at least one first instruction is obtained. And when the total times is less than or equal to the time threshold, returning to execute the operation of randomly selecting at least one second instruction from the instruction set containing at least one first instruction and the subsequent operation until the total times is greater than the time threshold. The embodiment of the application can realize simulation and compatibility test of possible multiple different protocol flows so as to meet the test requirements on multiple test scenes in actual test work and improve test effectiveness.
In a seventh possible implementation manner of the first aspect, after all the second instructions are subjected to the random ordering processing, a first ordered instruction set formed by the second instructions subjected to the current random ordering processing is obtained. After the operation of randomly ordering all the second instructions, the method further comprises the following steps:
a determination is made as to whether the first ordered instruction set is contained in the historical ordered instruction set data. The history ordered instruction set data records an ordered instruction set obtained by randomly sequencing instructions randomly selected from the instruction set historically.
And when the historical ordered instruction set data does not contain the first ordered instruction set, recording the first ordered instruction set into the historical ordered instruction set data, executing a second instruction based on random ordering processing, and performing communication connection test on a protocol to be tested in the equipment to be tested.
And when the historical ordered instruction set data contains the first ordered instruction set, returning to execute the operation of randomly selecting at least one second instruction from the instruction set containing at least one first instruction.
The embodiment of the application can effectively avoid repeatedly simulating the same protocol flow, thereby enabling the simulation of the protocol flow to be more effective. The effect of the connectivity test is better.
In an eighth possible implementation manner of the first aspect, performing, based on the second instruction after the random ordering processing, a communication connection test on a protocol to be tested in the device to be tested, includes:
and performing at least two communication connection tests on the protocol to be tested in the equipment to be tested based on the second instruction after the random sequencing, and determining a communication connection test result of the protocol to be tested according to the results of the at least two communication connection tests.
According to the communication connection method and device, the communication connection with the device to be tested is tried for many times, so that the anti-interference capability of the whole communication test result is stronger. Therefore, the situation that the communication test result obtained by testing is inaccurate due to the fact that the single communication connection establishment is influenced by accidental factors can be avoided to a great extent. Therefore, the method and the device can effectively improve the reliability of the result of the connectivity test, so that the compatibility test is more effective.
In a ninth possible implementation manner of the first aspect, determining a communication connection test result of the protocol to be tested according to results of at least two communication connection tests includes: and when at least one communication connection is successfully established with the equipment to be tested in the results of the at least two communication connection tests, judging that the communication connection test result of the protocol to be tested is successful.
In a tenth possible implementation manner of the first aspect, determining a communication connection test result of the protocol to be tested according to results of at least two communication connection tests includes:
and obtaining a first probability of successfully establishing communication connection with the equipment to be tested in the results of at least two communication connection tests, and determining a communication connection test result of the protocol to be tested according to the first probability and a preset probability threshold.
And when the first probability is higher than the probability threshold, judging that the communication connection test result of the protocol to be tested is successful.
And when the first probability is lower than the probability threshold and is greater than 0, judging that the communication connection test result of the protocol to be tested is unstable.
And when the first probability is equal to 0, judging that the communication connection test result of the protocol to be tested is communication connection failure.
In the embodiment of the application, the condition of poor protocol flow compatibility can be effectively identified by setting the threshold value and judging that the communication test result is unstable in communication connection under the condition that the success rate of the communication connection is lower than the threshold value. Therefore, the result of the connection test can be more accurate and reliable.
In an eleventh possible implementation manner of the first aspect, the number of the second instructions is the same as the number of the first instructions.
In the embodiment of the application, all instructions in the instruction set can be selected as the instructions used in the current connectivity test, and at this time, simulation of various protocol flows can be realized in a random instruction sequencing mode.
A second aspect of an embodiment of the present application provides a protocol testing method, including:
and acquiring a parameter set, wherein the parameter set comprises at least one third instruction, and each third instruction is associated with at least one parameter value.
A target instruction is selected from the at least one third instruction.
One target parameter value is selected from all parameter values associated with the target instruction.
And sending the target instruction and the target parameter value to the equipment to be tested.
And acquiring a processing result of the equipment to be tested on the target parameter value to obtain second compatibility test data of the protocol to be tested.
By means of randomly selecting instruction parameter values, the method and the device for testing the protocol parameter value compatibility can simulate various possible real use conditions of a user, and can simulate and test parameter value compatibility of the protocol to be tested under various possible secondary development real conditions of the instruction parameters. The method and the device can test the compatibility condition of the protocol to be tested and different parameter value forms under the condition that the specific parameter value of the protocol to be tested is unknown. Or the compatibility between the protocol to be tested and various parameter value setting modes can be tested under the condition that the parameter value setting modes of the protocol to be tested are known. Therefore, the method and the device for testing the compatibility of the protocol to be tested can greatly improve the effectiveness of parameter testing in the compatibility testing of the protocol to be tested.
A third aspect of an embodiment of the present application provides a protocol testing method, including:
and acquiring a parameter set, wherein the parameter set comprises at least one third instruction, and each third instruction is associated with at least one parameter value.
And randomly selecting one associated parameter value for each third instruction to obtain target parameter values associated with the third instructions one by one.
And sending the third instruction and the associated target parameter value to the equipment to be tested.
And acquiring a processing result of the equipment to be tested on the target parameter value to obtain second compatibility test data of the protocol to be tested.
By means of randomly selecting instruction parameter values, the method and the device for testing the protocol parameter value compatibility can simulate various possible real use conditions of a user, and can simulate and test parameter value compatibility of the protocol to be tested under various possible secondary development real conditions of the instruction parameters. The method and the device can test the compatibility condition of the protocol to be tested and different parameter value forms under the condition that the specific parameter value of the protocol to be tested is unknown. Or the compatibility between the protocol to be tested and various parameter value setting modes can be tested under the condition that the parameter value setting modes of the protocol to be tested are known. Therefore, the method and the device for testing the compatibility of the protocol to be tested can greatly improve the effectiveness of parameter testing in the compatibility testing of the protocol to be tested.
A fourth aspect of the embodiments of the present application provides a protocol testing apparatus, including:
and the instruction selecting module is used for randomly selecting at least one second instruction from an instruction set containing at least one first instruction.
And the instruction sequencing module is used for randomly sequencing all the second instructions.
And the communication test module is used for carrying out communication connection test on the protocol to be tested in the equipment to be tested based on the second instructions after random sequencing processing so as to obtain first compatibility test data of the protocol to be tested.
In a fifth aspect, embodiments of the present application provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method according to any one of the above first aspects is implemented.
In a sixth aspect, embodiments of the present application provide a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the method according to any one of the above first aspects.
In a seventh aspect, an embodiment of the present application provides a chip system, where the chip system includes a processor, the processor is coupled with a memory, and the processor executes a computer program stored in the memory to implement the method according to any one of the foregoing first aspects. The chip system can be a single chip or a chip module consisting of a plurality of chips.
In an eighth aspect, embodiments of the present application provide a computer program product, which, when run on an electronic device, causes the electronic device to perform the method of any one of the above first aspects.
It is to be understood that, for the beneficial effects of the second aspect to the eighth aspect, reference may be made to the relevant description in the first aspect, and details are not described herein again.
Drawings
FIG. 1A is a diagram illustrating an instruction set according to an embodiment of the present disclosure;
fig. 1B is a schematic diagram of a parameter set provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a protocol testing method in a connectivity testing phase according to an embodiment of the present application;
FIG. 3 is a schematic diagram of instruction sets before and after random ordering according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a protocol testing method in a parameter testing phase according to an embodiment of the present disclosure;
fig. 5 is a schematic view of a parameter set before and after parameter value selection provided in an embodiment of the present application;
fig. 6 is a schematic diagram illustrating a result of parameter value selection provided in an embodiment of the present application;
fig. 7 is another schematic flow chart of a protocol testing method in a parameter testing phase according to an embodiment of the present application;
fig. 8 is a schematic flowchart of a compatibility test according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a protocol testing apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a mobile phone according to an embodiment of the present application;
fig. 11 is a block diagram of a software structure of an electronic device according to an embodiment of the present application;
fig. 12 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
Some concepts that may be involved in the present application are illustrated below:
the application protocol, the protocol to be tested and the equipment to be tested: in the embodiment of the present application, for a single type of communication protocol, all protocols meeting the standard of the type of communication protocol are collectively referred to as application protocols. Application protocols include, but are not limited to, various official versions of the communication protocols as officially provided by such communication protocols, as well as communication protocols post-development of official versions by third parties. Taking the bluetooth protocol as an example, all official versions (such as bluetooth 3.0, bluetooth 4.0, bluetooth 5.0, and the like provided by the official part) provided by the bluetooth protocol official, and bluetooth protocols with different contents obtained by electronic device manufacturers after secondary development based on these official versions are application protocols in the embodiments of the present application.
In the embodiment of the present application, a communication protocol that needs to be subjected to a compatibility test is referred to as a protocol to be tested, and an electronic device on which the protocol to be tested is installed is referred to as a device to be tested. For a single type of communication protocol, the protocol to be tested belongs to an application protocol. In addition, unless otherwise specified, the communication protocols described in the embodiments of the present application are all application protocols under the same type of communication protocol.
In the embodiment of the application, the protocol type of the communication protocol (including the application protocol and the protocol to be tested) is not limited too much, and can be determined according to the actual application requirement. For example, the communication protocol may be a wireless communication protocol such as bluetooth protocol, WI-FI protocol, NFC protocol, cellular communication protocol, etc., or may be a wired communication protocol such as USB protocol, serial protocol, ethernet protocol, etc.
A master device: refers to an electronic device as a compatibility test execution subject. In the embodiment of the application, the master device is responsible for performing compatibility test on the device to be tested to obtain compatibility data of the protocol to be tested.
And (3) compatibility testing: the method is used for testing the normal communication capability of the equipment to be tested and other electronic equipment, so as to obtain the compatibility data of the protocol to be tested. According to communication steps, communication contents and the like which may be involved in normal communication between electronic devices, in the example of the present application, the compatibility test may include: connectivity testing, instruction testing, and parameter testing. The communication test is a test for determining whether the communication connection between the main device and the device to be tested can be established normally. The instruction test is a capability test for instructions supported by the device to be tested. The parameter test is a test for the parameter value processing capability of the device to be tested for the instruction parameter.
It should be noted that, in the communication connection test, the instruction test, and the parameter test, test data obtained by any one or more tests may be used as part or all of the compatibility test data in the embodiments of the present application. The specific value can be selected or set according to the actual application requirement. For example, whether the device to be tested can normally establish communication connection, whether the device to be tested can normally respond to the functional instruction, and the processing condition of the parameter value can be used as result data of the compatibility test in practical application.
Testing scene: in the embodiment of the application, the test scenario is used for simulating a scenario in which a third party (such as an electronic device manufacturer) secondarily develops a communication protocol. Specifically, the embodiment of the application realizes the simulation of various possible situations corresponding to the secondary development of the communication protocol, such as the simulation of the regulated protocol flow and the instruction content, by means of randomly selecting the instruction, randomly sequencing the instruction, randomly selecting the parameter value and the like, thereby realizing the simulation of various possible real situations in practical application. Therefore, in the embodiment of the present application, a test scenario may correspond to a possible application protocol. Through setting and testing operation of the test scene, compatibility test between the protocol to be tested and various possible application protocols can be realized.
Configuration file of communication protocol (Profile): the configuration file contains the functional specification of the communication protocol, and defines the general behaviors adopted by the electronic equipment to communicate with other electronic equipment based on the communication protocol. Different profiles may describe different types of applications or use cases supported by the communication protocol. Each configuration file may include one or more protocol commands (protocol commands may also be referred to as commands, and hereinafter are referred to as commands).
Taking the bluetooth Protocol as an example, according to the bluetooth Specification, the configuration files of the bluetooth Protocol may include a Hands-free configuration file (HFP), an Audio/Video Control transfer Protocol Specification (AVCTP) configuration file, and an Audio/Video Distribution transfer Protocol (AVDTP) configuration file. Wherein HFP allows bluetooth devices to control calls, such as answer, hang up, reject, voice dialing, etc. The AVCTP can perform media control, such as audio/video playing control, volume control in the playing process, and the like. AVDTP is a streaming media transport protocol that specifies audio or video distribution.
In order to meet market demands, manufacturers of electronic devices may perform secondary development on communication protocol contents supported by the electronic devices based on protocol standards, that is, perform operations such as certain adjustment or customization. For example, the protocol flow of the communication protocol, the instruction content used, and the setting form of the instruction parameter value may be adjusted according to the requirement. Therefore, in practical applications, even for the same type of communication protocol, there may be some differences in the contents of the communication protocols in different electronic devices.
Taking bluetooth protocol as an example, currently, bluetooth devices are shipped in more than one hundred million annually, and the bluetooth devices are different in device form and device function. For example, common device forms include vehicle-mounted bluetooth, bluetooth headset, bluetooth speaker, bluetooth mouse and keyboard, bluetooth bracelet, bluetooth watch, bluetooth selfie stick, bluetooth printer, etc. There may be functional differences between products from different manufacturers for the same device configuration. For example, for a bluetooth headset, the bluetooth headset manufactured by manufacturer a may only include a function of controlling music playing, while the bluetooth headset manufactured by manufacturer B may further include a function of controlling communication and noise reduction based on the function of controlling music playing. Through the diversified device forms and the device functions, the differentiation requirements of different users can be effectively met. For the bluetooth devices with different device forms and device functions, manufacturers can perform secondary development of the bluetooth protocol according to the specific situation of the bluetooth devices produced by the manufacturers. For example, according to the function of the bluetooth device, a protocol flow is set, that is, an instruction to be checked and a checking sequence are required in the process of establishing the communication connection. Parameter ranges, display modes and the like of different functions can be set. For example, the electricity quantity of the Bluetooth device is shown in the form of electricity quantity grid number or electricity quantity percentage, and how the electricity quantity is quantized to take values. These secondary developments of bluetooth protocols for different bluetooth devices have resulted in a number of bluetooth protocols with content differences in practical applications. These twice developed bluetooth protocols, while still belonging to the broad class of bluetooth protocols, may have problems with compatibility with each other.
In order to test the compatibility of the protocol to be tested, an optional test method includes:
the testing method 1 includes purchasing a large number of electronic devices produced by different manufacturers, and performing communication testing on the electronic devices and the devices to be tested to judge which electronic devices can be compatible with the devices to be tested, so that compatibility data of protocols to be tested are obtained.
The test method 1 needs to purchase a large amount of electronic equipment, the cost is extremely high, and each electronic equipment is complex to operate in the test process, so that the actual operation difficulty is increased. While the test method 1 is limited to testing only the real devices that have been obtained.
And 2, collecting the communication protocols after secondary development of different manufacturers, and performing communication test with the equipment to be tested through equipment such as a computer and the like based on the communication protocols to obtain compatibility data of the protocols to be tested.
The test method 2 can save the cost of purchasing the electronic equipment, but is still limited to the test of the obtained communication protocol after secondary development. And the difficulty of collecting the communication protocols developed by different manufacturers for the second time is high, which leads to the difficulty in actual operation to be increased.
And 3, designing a test scene by a tester according to the known communication protocol secondary development condition, simulating the contents of the secondarily developed communication protocols, and carrying out communication test on the equipment to be tested on the basis of the simulated contents of the communication protocols to obtain the compatibility data of the protocols to be tested.
The test method 3 simulates the communication protocol after the secondary development in a test scene design mode, and can greatly reduce the cost and difficulty of actual operation. However, the test scenario designed for the secondary development situation of the known communication protocol is still limited to the information situation already mastered by the tester. In the actual operation process, the test effect is often not ideal, and some possible situations outside the known range of the testers cannot be dealt with.
As can be seen from the above analysis, the test methods 1 to 3 are limited to the secondary development of the communication protocol grasped by the tester, and therefore, the obtained test results are often difficult to deal with the situations beyond the known range of the tester. In practical application, however, on one hand, the secondary development condition of the communication protocol mastered by the tester is often limited, and on the other hand, the iterative update speed of the electronic equipment is very high, and the secondary development condition of the communication protocol is continuously updated iteratively along with the electronic equipment. Therefore, the effectiveness of the test methods is low, and the test methods cannot cope with various possible situations in practical application, and are difficult to meet the requirements of practical compatibility tests.
In order to improve the effectiveness of the compatibility test on the communication protocol, in the embodiment of the present application, a corresponding instruction set and a parameter set are first set for the protocol to be tested. The instruction set comprises a plurality of instructions supported in the protocol specification of the protocol to be tested, and the parameter set comprises different parameter values of the instructions. On one hand, when the compatibility test is started, the main device firstly randomly selects a plurality of instructions from the instruction set, and carries out-of-order processing on the selected instructions so as to randomly simulate different protocol flows. And generating a test script required by the communication connection based on the command after the out-of-order processing, and carrying out the communication connection test on the equipment to be tested based on the test script. That is, the master device runs the test script and tries to establish a communication connection with the device to be tested to determine whether the communication connection between the two devices can be established normally. On the basis of successfully establishing communication connection, the main device can also perform response test on the preset instructions one by one on the device to be tested so as to determine which instructions the device to be tested can normally respond to. On the other hand, the embodiment of the application can also randomly select the instruction and the associated parameter value in the parameter set on the basis of establishing the normal communication connection between the main device and the device to be tested, and send the instruction and the selected associated parameter value to the device to be tested. By determining whether the device to be tested can normally process the sent parameter values, the processing capability of the device to be tested on the parameters related to the instruction can be judged.
In the embodiment of the application, the random design of the protocol flow can be realized by randomly selecting the instructions and randomly sequencing the instructions, and the test scene corresponding to the protocol flow is randomly obtained. Through the test of the test scene, the unpredictable third-party secondary development protocol flow condition in the real condition can be effectively simulated. And through the random selection of the parameter values, the test scene corresponding to the parameter values is randomly obtained, so that the effective simulation of unpredictable third-party secondary development instructions or functional conditions (such as the display effect of an electric quantity display function on a circuit) in real conditions can be realized. Therefore, by the method of the embodiment of the application, a tester can realize the compatibility test of the communication protocol secondary development random condition, wherein the compatibility test comprises the simulation of the unknown secondary development condition, and the compatibility test is not limited to the communication protocol secondary development condition mastered by the tester. Therefore, the embodiment of the application can better meet the requirement of the actual communication protocol compatibility test and greatly improve the effectiveness of the communication protocol compatibility test. For example, by recording the compatibility test results of the random test scenarios, the compatibility situation of the protocol to be tested and the compatibility situation thereof can be determined at the first time when a product corresponding to the test scenario appears in the market. Such as whether a communication connection can be established normally, whether a certain command or function is supported, and the processing situation of a certain parameter.
The protocol testing method provided by the embodiment of the application can be applied to electronic equipment such as mobile phones, tablet computers and wearable equipment, the electronic equipment is an execution main body of the protocol testing method provided by the embodiment of the application, and the embodiment of the application does not limit the specific type of the electronic equipment.
In order to explain the technical solution described in the present application, the following takes an application protocol of the to-be-tested protocol belonging to the bluetooth protocol as an example, and the description is given through a specific embodiment. In the embodiment of the present application, the device under test may be a bluetooth device in any form. Meanwhile, each communication protocol described in the embodiment of the present application belongs to an application protocol under a bluetooth protocol.
In practical applications, when a third party performs secondary development of a communication protocol, any content of the communication protocol may be adjusted. Therefore, in order to more comprehensively simulate the actual situation which may occur, the embodiment of the application can perform simulation and test from three dimensions of the protocol flow, the protocol instruction and the protocol parameter value. Therefore, various secondary development conditions can be completely and truly simulated as much as possible, the effect of simulating the compatibility of the protocol to be tested is improved, and the obtained test data is more effective. However, it should be understood that in practical applications, only some of three dimensions of the protocol flow, the protocol instructions, and the protocol parameter values may be selected to be simulated and tested according to actual requirements. At this time, the corresponding operations in the embodiments of the present application may also be referred to for implementing the test, which is not limited herein.
According to the timing sequence of each operation in the compatibility test process, the compatibility test of the embodiment of the present application may include three stages, which are respectively: the pre-configuration stage, the connectivity test stage and the functionality test stage are sequentially explained as follows:
1. a pre-configuration phase.
Before the compatibility test formally starts, a tester may set a corresponding instruction set and a corresponding parameter set (also referred to as an instruction library and a parameter library) for a protocol to be tested.
Specifically, on the one hand, the tester may select some or all of the instructions from the instructions supported in the protocol specification of the protocol to be tested, and obtain an instruction set including the selected instructions. The instructions in the instruction set may also be referred to as the first instruction.
On the other hand, the tester may also select some or all of the instructions supported in the protocol specification of the protocol to be tested (the selected instruction may also be referred to as a third instruction, and the third instruction may be partially the same as, completely the same as, or different from the first instruction in the instruction set). And aiming at the instructions with parameters capable of taking different values in the selected instructions, and setting one or more associated parameter values for each instruction respectively. Resulting in a parameter set containing the fetched instructions and the parameter values associated with the instructions. For example, one or more electric quantity values can be set in association with the electric quantity-related instruction. If there are instructions without associated parameters in the parameter set, the corresponding parameter values may not be set for the instructions, and at this time, it may be considered that 0 parameter values are associated. For example, for a single state control class instruction, such as an on-hook instruction and a phone call instruction, the associated parameters may not be set. The number of parameter values associated with different instructions may be the same or different.
The embodiment of the application does not excessively limit the number of the selected instructions in the instruction set and the parameter set, and can be set by a test. As an optional embodiment of the present application, all instructions supported in the protocol specification of the protocol to be tested can be selected into the instruction set, so that the test scenarios can be richer and more diverse. As another alternative embodiment of the present application, some or all of the instructions may be selected from the instruction set as the instructions required by the parameter set.
As an embodiment of creating an instruction set in the present application, since one or more instructions may be included in a configuration file, when an instruction is selected, a dimension operation of the configuration file may be performed, and a desired instruction is selected from the instructions included in each configuration file and added to the instruction set. The specific instruction number selected in each configuration file can be the same or different.
As an optional embodiment of the present application, it is assumed that a protocol specification of a protocol to be tested includes configuration file 1, configuration file 2, configuration file 3 \8230, configuration file n includes n configuration files, and the number of instructions included in configuration file 1, configuration file 2, configuration file 3, and configuration file n is w, x, y, and z, respectively. Wherein n is any positive integer, and w, x, y and z are any natural number. And assume that all instructions are selected to build the instruction set. Fig. 1A is a schematic diagram of an instruction set according to an embodiment of the present disclosure. Based on the instruction set of fig. 1A, the master device may select any instruction within the instruction set to generate a test script required for compatibility testing. At this time, the instructions 11, 12, 13 to 1w are selected from the configuration file 1. Instruction 21, instruction 22, instruction 23 through instruction 2x are selected from within configuration file 2. Instruction 31, instruction 32, instruction 33 through instruction 3y are selected from within configuration file 3. An instruction n1, an instruction n2, an instruction n3 to an instruction nz are selected from the configuration file n.
Taking the bluetooth protocol as an example, as an optional embodiment of the present application, a part or all of the instructions may be selected from the instructions related to bluetooth call, the instructions related to bluetooth streaming media, and the instructions related to bluetooth media control as instructions in an instruction set.
For example, for the bluetooth call related instruction, any one or more types of general instructions, call control instructions, network service instructions, security instructions, phone book instructions, short message instructions, supplementary service instructions, data instructions, fax instructions, special AT instructions, and SIM card toolkit instructions in the AT instructions may be selected.
By way of example and not limitation, the following instructions may be included in the general instructions:
AT + CGMI is used for providing the identification of the manufacturer of the Bluetooth module.
AT + CGMM for acquiring a Bluetooth module band (e.g., GSM900, DCS1800 or PCS 1900).
AT + CGMR, used to obtain the software version of the Bluetooth module.
And the AT + GCAP is used for acquiring a function list supported by the electronic equipment.
AT + CRSL for setting or obtaining the sound level of an incoming telephone ring tone.
The call control command may include the following commands:
ATD, dialing instructions for setting up a call, data or fax call.
ATH, on hook instruction.
ATA, receiving the telephone command.
AT + CEER, expand the error report order, is used for giving the reason of interrupting the conversation after the last conversation sets up the failure.
ATDL, used for redialing last telephone number.
ATS0, for automatic response.
The call control command may include the following commands:
AT + COPS for service provider selection.
And the AT + CREG is used for network registration and acquiring the registration state of the electronic equipment.
AT + WOPN for reading the operator name.
AT + CPOL for prioritized operator list.
The instructions related to the bluetooth media control may include the following instructions:
AVRCP Play, which is used to Play Bluetooth music and use AVCTP AV/C format to instruct the walking control channel.
AVRCP Pause, for pausing bluetooth music and then controlling the channel using AV/C formatted instructions.
AVRCP Forward for cutting a song into the next song, the data alternating the control channel.
The AVRCP Get Element Attributes are used for acquiring song information such as singers, song titles, album names and total song time, and controlling channels by using an AV/C format instruction.
AVRCP Get Folder Items for obtaining a list of folders, such as a media player list, a file system list, etc.
As an embodiment of creating parameter sets in the present application, since one or more instructions may be included in a configuration file, when selecting an instruction, the method may operate from the dimension of the configuration file, and select an instruction required for a parameter set from the instructions included in each configuration file.
As an optional embodiment of the present application, when constructing the parameter set, a tester may select some parameter values associated with these functions to the parameter set according to the function conditions supported by the device to be tested. Because the instructions in the parameter set are all the function-related instructions supported by the equipment to be tested, the subsequent test of the instruction parameter values in the parameter set can better meet the use condition of an actual user, and the effectiveness of the parameter test is enhanced.
As a specific embodiment of the present application, it is assumed that the protocol specification of the protocol to be tested includes configuration file 1, configuration file 2, configuration file 3 \8230, where \8230, and configuration file n includes n configuration files, and 1 instruction is selected from each configuration file. Wherein, the instruction selected in each configuration file is provided with 3 parameter values. Fig. 1B is a schematic diagram of a parameter set provided in the embodiment of the present application. Based on the parameter set in fig. 1B, the master device may select any parameter value of any instruction in the parameter set to perform a parameter test in the compatibility test. At this point instruction 11 is selected from within configuration file 1 and parameter value 11, parameter value 12, and parameter value 13 are set for instruction 11. An instruction 21 is selected from within the configuration file 2 and a parameter value 21, a parameter value 22 and a parameter value 23 are set for the instruction 21. Instruction 31 is selected from within configuration file 3 and parameter value 31, parameter value 32 and parameter value 33 are set for instruction 31. An instruction n1 is selected from the configuration file n, and a parameter value n1, a parameter value n2 and a parameter value n3 are set for the instruction n 1.
2. And (5) a connection test stage.
On the basis of configuring the instruction set, the embodiment of the application can enter a connection testing stage. In this stage, the inter-connectivity between the protocol to be tested and other protocols in the compatibility of the protocol to be tested is mainly tested, that is, the capability of establishing communication connection between the device to be tested and other electronic devices is tested. Because the establishment of the communication connection is the basis of normal communication between two electronic devices, the connectivity test is an extremely important test in the compatibility test, and has an extremely important meaning for evaluating the compatibility of the device to be tested.
In the process of establishing a communication connection between two electronic devices, an electronic device (hereinafter referred to as an initiator) serving as a communication request initiator may send some instructions to another electronic device (hereinafter referred to as a receiver) according to a protocol flow in its own communication protocol to complete steps required for the communication connection. For example, assume that the originating terminal needs to perform operations such as authentication, basic data transmission (such as protocol version information), function verification, and monitoring configuration in sequence during the process of establishing communication connection according to the protocol flow setting in its own communication protocol. At this time, in the process of establishing communication connection with the receiving end, the initiator sequentially sends corresponding instructions to the receiving end along with operations such as identity authentication, basic data transmission, function verification, monitoring configuration and the like. The receiving end responds to the operations and the corresponding instructions in sequence based on the protocol flow in the self communication protocol. If the receiving end can process the instructions under the operations and establish communication connection with the initiating end, the protocol flow in the self communication protocol of the receiving end is explained and can be compatible with the protocol flow in the self communication protocol of the initiating end.
In practical applications, according to the difference of the third party in the secondary development of the protocol flow of the communication protocol, the specific protocol flows of the communication protocols in different electronic devices may also differ. When the communication connection is actually performed, the number of operations, the operation sequence, and the specific operation content that the electronic device needs to execute may be different, so that the actually used instructions and the instruction transmission sequence may be different. Therefore, in the process of performing connectivity testing, protocol flows which may appear in practical application can be simulated in a mode of randomly selecting instructions and randomly sequencing. Therefore, the unpredictable third-party secondary development protocol flow condition in the real condition can be effectively simulated.
Fig. 2 shows a flowchart of an implementation of a protocol testing method in a connectivity testing phase according to an embodiment of the present application, which is detailed as follows:
s201, the main device randomly selects one or more instructions from the instruction set.
When the connectivity test begins, the master device first randomly selects one or more instructions from the instruction set, where the selected instructions may also be referred to as second instructions. In the embodiment of the present application, the specific selected instructions and the number of instructions are all random selection operations, and therefore what instructions are selected each time and the number of specifically selected instructions need to be determined according to actual application situations. In addition, the embodiment of the application does not excessively limit the specifically used instruction number random determination method. For example, any random number generation algorithm may be adopted to randomly generate an integer from 1 to H as the required randomly selected number of instructions, where H is the total number of instructions contained in the instruction set, and H is an integer greater than or equal to 1. Meanwhile, the embodiment of the application does not excessively limit the random selection method of the specific use instruction, and the random selection method can be selected or set by a tester. For example, methods including, but not limited to: the random selection of the instruction is performed by any one of simple random sampling, systematic sampling, hierarchical sampling, and group sampling.
As an alternative embodiment of the present application, the number of randomly selected instructions may be set to be the total number H of instructions contained in the instruction set, where H is an integer greater than or equal to 1. At this time, S201 may select all instructions in the instruction set.
As an alternative embodiment of the present application, any one of the following selection schemes may be adopted to implement instruction selection:
selecting a scheme 1: all the instructions in the instruction set are directly selected randomly, so that one or more required instructions are obtained.
Selecting a scheme 2: and respectively carrying out instruction random selection on each configuration file by taking the configuration files in the instruction set as the minimum unit for instruction selection. The random selection operation of each configuration file is mutually independent, and the number of the instructions selected from each configuration file is also randomly determined, namely a plurality of instructions are respectively randomly selected from each configuration file.
In the selection scheme 2, each configuration file is an independent operation object when a random selection instruction is executed. Assuming that the nth configuration file contains kn instructions, where n is any positive integer, m instructions may be randomly selected from the nth configuration file. Wherein kn is any positive integer, and m has two selectable value ranges. The value range is 1: m is an integer greater than 0 and less than or equal to kn. The value range 2: m is an integer equal to or greater than 0 and equal to or less than kn, and at this time, the total number of the selected instructions in all the configuration files must be set to be greater than 0 at the same time, that is, m of all the configuration files cannot be 0.
By way of example, in the embodiment of the present application, based on the embodiment shown in fig. 1A, the selection scheme 2 may perform random instruction extraction on configuration file 1, configuration file 2, configuration file 3 \8230; \8230andconfiguration file n, respectively. Also assume that the number m of randomly selected instructions from within each profile is greater than 0. At this time, by selecting scheme 2, in the embodiment of the present application, a maximum w instructions may be randomly selected from instructions 11 to 1w included in configuration file 1, for example, instructions 11 and 13 may be randomly selected. A maximum of x instructions may be randomly chosen, for example, possibly randomly chosen to instruction 2x, from instructions 21 to 2x contained in configuration file 2. A maximum of y instructions may be randomly chosen from instructions 31 to 3y contained in profile 3, for example, possibly randomly chosen to instruction 32 and instruction 3y. And by analogy, all the instructions finally selected from each configuration file are one or more instructions randomly selected in the embodiment of the application.
By adopting the selection scheme 2, the instruction selection at the configuration file level can be realized, so that the dimension of the instruction selection in the configuration file is relatively balanced, and the extreme instruction distribution condition possibly caused by randomly selecting the instruction is reduced. Therefore, the selected instruction is relatively more fit to the actual situation which may occur in practical application, so that the random simulation of the protocol flow test scene in the embodiment of the application is more practical, and the effectiveness of the compatibility test is improved.
S202, the main device randomly orders the selected instructions.
After the required instructions are selected, the embodiments of the present application may further perform a random ordering process (which may also be referred to as a random out-of-order process or a random out-of-order process) on the selected instructions, and disorder the order of the instructions to simulate a possible order among the instructions in the real protocol flow. The embodiment of the present application also does not excessively limit the specific random sorting method, and the random sorting method may be specifically selected or set by a tester. For example, including but not limited to, implementing random ordering of instructions using recursive functional comparisons, or implementing random ordering of instructions using, for example, a shuffle algorithm, such as using a Fisher-Yates (Fisher-Yates) shuffle algorithm, a Knuth (Knuth) shuffle algorithm, or an Inside-outside (Inside-Out) algorithm, among others.
By way of example, in the embodiment shown in fig. 1A, it is assumed that instruction 11, instruction 22, instruction 32, and instruction nz are randomly selected in S201. An ordered set of instructions (also referred to as a first ordered instruction set) is then obtained by randomly ordering the instructions. For example, fig. 3 is a schematic diagram of instruction sets before and after random sorting according to an embodiment of the present application, and as a possible result, an ordered instruction set may be obtained: { instruction 22, instruction 12, instruction nz, instruction 11 }.
As an optional embodiment of the present application, in order to improve the effectiveness of the simulation protocol flow, the master device may record the current ordered instruction set (i.e., record the current first ordered instruction set) after randomly ordering the instructions each time. For example, record { instruction 22, instruction 12, instruction nz, instruction 11 } in the embodiment shown in FIG. 3. On this basis, when the main device performs S202 operation of randomly sorting the selected instructions, the main device may match the ordered instruction set obtained at this time with the ordered instruction set of the history record. The ordered instruction set data of the history record can be called history ordered instruction set data. If the same ordered instruction set as the current first ordered instruction set is matched from the historical ordered instruction set data, the random ordering operation of S202 is executed again and matching is performed again. If the same ordered instruction set is not matched, the operations after S202 are normally executed, and the current first ordered instruction set is recorded to update the historical ordered instruction set data. By comparing with the historical ordered instruction set data, the embodiment of the application can effectively avoid repeatedly simulating the same protocol flow, so that the protocol flow is more effectively simulated. The effect of the connectivity test is better. In the embodiment of the application, the master device performs matching of the first history ordered instruction set data on the history ordered instruction set data. When the matching fails, the current first ordered instruction set is recorded.
And S203, the main device generates and runs a test script based on the randomly sequenced instructions, and tries to establish communication connection with the device to be tested based on the test script.
After the random selection and the random ordering of the instructions are completed, the embodiment of the application completes the random simulation of the protocol flow, and the connectivity test can be started at the moment. The communication test can be realized by generating corresponding test scripts according to the instructions based on random sequencing and executing the generated test scripts. Because the sequence of each instruction in the generated test script is randomly ordered, when the test script is operated, the main equipment can simulate a series of steps of establishing communication connection with the equipment to be tested under a real condition. The generation method of the test script is not limited too much, for example, some automatic test tools may be selected to automatically generate the test script, or a test script may be obtained by manually writing the test script by a tester. As an optional embodiment of the present application, the test script generation here may be to generate an available test script without a test script, or may be to preset a basic test script, and modify, adjust, or fill the basic test script based on a randomly ordered instruction to obtain an available test script.
As an alternative embodiment of the present application, the operation of generating the test script in S203 may also be implemented by an electronic device other than the host device, and the electronic device sends the test script to the host device for active or passive use. At this time, S203 may be replaced with: the main device obtains the test script and tries to establish communication connection with the device to be tested based on the test script. The test script is generated by other electronic equipment except the main equipment based on the randomly ordered instructions. The mode of obtaining the test script may be that the main device receives the test script sent by the other electronic device.
As an optional embodiment of the present application, the connectivity test may also be implemented in a manner other than a test script, for example, a scripted test manner may be adopted to try to establish a communication connection with the device under test based on randomly ordered instructions. The script-free test is a generic term for testing without generating a script file, and includes but is not limited to, for example: the method comprises the steps of object mapping test based on drag and drop, visual test based on a flow chart, manual simulation connection test of testers and the like. Wherein, the manual simulation connection test of tester indicates: and manually operating the main equipment by the tester to perform information interaction with the equipment to be tested according to the randomly ordered instruction sequence, namely manually simulating a series of steps for establishing communication connection by the tester to try to establish communication connection with the equipment to be tested.
And S204, the main equipment records the result of establishing communication connection with the equipment to be tested, and compatibility test data of the protocol to be tested in the equipment to be tested is obtained.
In the embodiment of the present application, the compatibility test data obtained in the connectivity test stage may also be referred to as first compatibility test data. In this embodiment, the main device may attempt to establish a communication connection with the device under test, and may include at least two possible connectivity test results (i.e., the first compatibility test data): and if the communication connection is successful and the communication connection is failed, the communication test result belongs to a type of data aiming at the protocol flow test in the compatibility test data. If the communication connection is successful, the protocol flow of the protocol to be tested in the equipment to be tested is described, and the protocol flow can be compatible with the current randomly generated protocol flow, so that the equipment to be tested and the main equipment can be successfully connected and communicate. If the communication connection fails, the protocol flow of the protocol to be tested in the device to be tested is indicated, and the problem of compatibility exists between the protocol flow and the current randomly generated protocol flow, so that the device to be tested is difficult to connect with the main device or cannot connect and communicate with the main device. The method includes the steps that the main device records a result of establishing communication connection with the device to be tested, and the communication test result is locally stored by the main device or sent to a specific storage device or a storage module for storage.
As an alternative embodiment of the present application, it is considered that there may be some accidental factor influence on the communication connection result in the process of actually establishing the communication connection. Environmental factors such as the device status of the main device and the test device during the test, and the temperature and humidity of the environment in which the main device and the test device are located may affect whether the main device and the test device can successfully establish a connection. Therefore, the single-pass test result may have a certain error. To reduce these possible errors, the confidence of the results of the connectivity test is improved, making the test more efficient. In the embodiment of the present application, when the master device attempts to establish a communication connection with the device under test in S203, one or more attempts may be performed. And after one or more attempts, determining a communication test result of the device to be tested according to the conditions of establishing communication connection with the device to be tested. The number of the specific attempts may be set by a technician, or may be randomly generated by the master device, which is not limited herein.
As an optional embodiment of the present application, on the basis that the master device tries to establish communication connection with the device under test one or more times, the method for determining the connectivity test result includes: when the communication connection with the device to be tested is successfully established in the process of establishing the communication connection with the device to be tested one or more times, the result can be judged to be the successful communication connection. When all the communication connections with the device to be tested fail in the process of establishing the communication connection with the device to be tested at one time or a plurality of times, the communication connection failure can be judged as a result. Accordingly, in the embodiment of the present application, "attempt to establish a communication connection with a device under test" in S203 may be replaced with "attempt to establish a communication connection with a device under test one or more times". Also after S203, may further include: and if the communication connection is successfully established with the equipment to be tested once or for multiple times, judging that the communication test result is successful in communication connection. And if the communication connection with the equipment to be tested fails, judging that the communication test result is communication connection failure.
In the embodiment of the application, the communication connection is established with the test equipment through one or more times of attempts, so that the anti-interference capability of the result of the overall communication test is higher. Therefore, the condition that the communication test result obtained by the test is inaccurate due to the influence of accidental factors on the establishment of single communication connection can be avoided to a great extent. Therefore, the method and the device can effectively improve the reliability of the result of the connectivity test, so that the compatibility test is more effective.
As an optional embodiment of the present application, on the basis of one or more attempts by the master device to establish a communication connection with the device under test, the connectivity test result may include: successful communication connection, failed communication connection, and unstable communication connection. The method for judging the connection test result comprises the following steps: and the main equipment determines a communication test result according to the probability of successfully establishing communication connection in the process of one or more times of trying to establish communication connection with the equipment to be tested. And when the probability of successfully establishing the communication connection is greater than the probability threshold value, judging that the communication connection test result is successful. And when the probability of successfully establishing the communication connection is less than or equal to the probability threshold and greater than 0, judging that the communication connection is unstable as a communication test result. When the probability of successfully establishing the communication connection is 0, the communication connection test result is judged to be the communication connection failure. The probability of successfully establishing the communication connection is the times of successfully establishing the communication connection and the times of trying to establish the communication connection between the main equipment and the equipment to be tested. The probability threshold value can be set by a tester according to the requirement. As an example, assume that the probability threshold is set to 20%, and assume that the master device tries to establish a communication connection with the device under test 10 times in total based on the current test script, wherein the communication connection is successfully established 5 times. The probability of successfully establishing the communication connection at this time is: 5 ÷ 10=50%, since the probability is greater than the probability threshold value of 20%, it can be determined that the connectivity test result is a successful communication connection at this time. In the embodiment of the application, the condition of poor protocol flow compatibility can be effectively identified by setting the threshold value and judging that the communication test result is unstable in communication connection under the condition that the success rate of the communication connection is lower than the threshold value. Therefore, the result of the connection test can be more accurate and reliable.
As an optional embodiment of the present application, after the master device obtains the connectivity test result, the master device may also choose not to record the connectivity test result. For example, after the connectivity test result is obtained, the connectivity test result may be optionally sent to other electronic devices, such as to a specific server.
In the embodiment of the present application, by means of randomly selecting an instruction and randomly ordering the instruction, two most core contents in a protocol flow can be implemented: instructions used by the flow and a simulation of the timing of the use of these instructions. Therefore, the embodiment of the application can realize the simulation of some possible real protocol flows, thereby realizing the simulation of various possible secondary development conditions of the protocol flows by a third party. And performing connectivity test on the basis, so that the main equipment can try to establish communication connection with the equipment to be tested according to the simulated protocol flow, and the compatibility condition of the protocol flow of the protocol to be tested and the simulated protocol flow is tested. Compared with the mode that a test scene is manually set by a tester and the protocol flow is simulated by manually configuring the content of the protocol flow, the embodiment of the application can realize more random test scene simulation. The test scenes can cover the condition that a third party develops the protocol flow for the second time and is known by a tester, and can also simulate the condition that the current tester does not know or master the protocol flow for the second time. Therefore, the embodiment of the application is not limited to the secondary development condition of the communication protocol mastered by the testers, can better meet the requirement of the actual communication protocol compatibility test, and greatly improves the effectiveness of the communication protocol compatibility test.
In addition, according to different actual test requirements, the communication test stage can execute simulation and communication test operation of multiple protocol flows, so that simulation and compatibility test of multiple possible different protocol flows are realized, and more possible real scene requirements are covered. For example, assuming that a tester wishes to obtain the protocol flow compatibility test results in 100 test scenarios, the master device may perform 10 times of operations in the connectivity test phase. Namely, 100 protocol flows are simulated randomly, and the obtained 100 protocol flows are subjected to connectivity test respectively. In practical applications, a communication protocol generally has more configuration files, and each configuration file also has more instructions. For example, with the bluetooth protocol, there may be tens to hundreds of instructions within a single profile. Therefore, when instructions are randomly selected and ordered, theoretically, there are very many possible combination ordering results, that is, theoretically, the embodiment of the present application can simulate a very many test scenarios. Therefore, compared with the method that a tester manually collects or designs a protocol flow and tests the protocol flow, the method and the device can realize simulation of abundant possible real conditions, and the testing effectiveness is higher. On this basis, the embodiment of the application can also save a large amount of time cost and economic cost of testers, and has lower requirements on the technical threshold of the testers. Therefore, the embodiment of the application has excellent practical application value and can meet the requirement of actual test work of testers.
In order to implement simulation and compatibility testing for a plurality of different possible protocol flows, in the embodiment of the present application, on one hand, a tester may set a number of times (i.e., a number threshold) to be simulated according to a requirement. On the other hand, after the master device completes the operation of attempting to establish the communication connection with the device to be tested, the master device may further obtain the total number of times of performing the operation of S201 to randomly select the instruction from the instruction set. I.e. several different protocol flows have been determined and simulated. When the total number of times is smaller than the preset number threshold, the operation of randomly selecting the instruction from the instruction set in step S201 is executed again to restart the next simulation of the protocol flow until the simulation of the number threshold number of times of the protocol flow is finally completed.
In practical application, the instructions in the preset instruction set can be selected to be arranged and combined in a traversing manner, so that all possible instruction combination orders are obtained. In this way, theoretically, all possible protocol flows can be simulated, but the following problems exist in practical application:
1. in practical applications, the communication protocol generally has more configuration files, and each configuration file also has more instructions. Therefore, the traversing instruction selection and permutation combination can generate a great number of combination results. For example, assuming that the instruction set contains 300 different instructions, there are 300 alternative selections from 1 to 300 in terms of the number of instructions selected. Where A (300 ) =300! Possible ordered combinations of instructions. Therefore, in practical application, if the traversal permutation and combination is performed, all possible protocol flows are simulated, and the workload is very large.
2. Even if all possible protocol flows are simulated, if the communication test is to be performed one by one, a large amount of preparation and test work is required from the start of preparation to the actual test. The time and cost are extremely high, and therefore the practical realizability is extremely low.
Compared with the mode of simulating the protocol flow by traversing permutation and combination of the instructions in the instruction set, the protocol flow is simulated by randomly selecting the instructions and randomly sequencing the instructions, and the simulation and test of various possible real situations of secondary development of the protocol flow can be realized at extremely low cost. The method can well meet various complex scenes of secondary development in real application and meet the unpredictable characteristic in the real scene. Therefore, the compatibility test effectiveness of the protocol to be tested is improved.
3. And a functional testing stage.
On the basis that the communication connection between the main device and the device to be tested is successfully established, the embodiment of the application can enter a functional test stage. In the compatibility of the protocol to be tested, the instruction supported by the protocol to be tested and the capability of processing the instruction parameter sent by other protocols are mainly tested at this stage. Whether the two electronic devices can normally respond to each other's commands and whether the command parameter values sent by each other can be processed during communication between the two electronic devices are important indicators of whether the two electronic devices can normally communicate with each other. Therefore, the functional test is also an important test in the compatibility test, and has important significance for evaluating the compatibility of the equipment to be tested.
In the embodiment of the present application, the functional testing phase can be further subdivided into: an instruction testing stage and a parameter testing stage.
(1) And an instruction testing stage.
In order to test whether the equipment to be tested can normally respond to the instruction, the compatibility condition of the equipment to be tested to the function is tested. In the instruction testing stage, the master device can send all instructions in the instruction set to the device to be tested one by one in a traversing manner. And detecting the response condition of the equipment to be tested to the sent instruction by waiting for receiving the response data returned by the equipment to be tested or by manually observing the condition of the equipment to be tested by a tester after the main equipment sends the instruction. And recording the response data of the equipment to be tested to each instruction so as to obtain the normal response condition of the equipment to be tested to the instruction. During the process of sending the instruction to the equipment to be tested, default parameter values can be selected for the instruction with parameters, and the default parameter values of the instruction are sent to the equipment to be tested.
(2) And a parameter testing stage.
In practical applications, during a process of using the electronic device to communicate with a device under test, a user may send various instructions, such as a common control instruction for data, to the device under test through the electronic device. The instruction is often related to a function used by the user, so that in practical application, according to the difference of the functions used by the user, the instruction sent to the device to be tested by the electronic device used by the user and a specific parameter value corresponding to the instruction are different.
Taking the bluetooth protocol as an example, assume that a user is connected with a vehicle-mounted bluetooth as a device to be tested through a mobile phone. At the moment, the user can use some basic service functions of the vehicle-mounted Bluetooth, such as listening to songs, talking, media control and the like. In practical applications, the functions actually used by the user are unknown, and it is also unknown how to use the functions. For example, the user may control the vehicle-mounted bluetooth to play music or movies through the mobile phone, and may also answer or make a call by using the vehicle-mounted bluetooth. In the process of playing music or movies, the volume of the playing can be adjusted through the volume control related function in the mobile phone, and at the moment, the specifically adjusted volume value, namely the volume value related to the volume control related instruction, is involved.
Because a possible real use scene of a user in practical application is complex, the processing capability of the device to be tested on the parameter value of the received instruction in the communication process is very important. Based on the above, in the parameter testing stage, the embodiment of the application can simulate the possible real use scene of the user by randomly extracting the instruction parameters, and send the instruction and the corresponding parameter value, so as to test the processing capability of the instruction parameter value.
Fig. 4 shows a flowchart of an implementation of a protocol testing method in a parameter testing phase according to an embodiment of the present application. In the embodiment of the present application, for example, each instruction in the parameter set has one parameter, and a plurality of parameter values are set for the parameters of some or all of the instructions. In which case each instruction within the parameter set may have one or more parameter values associated with it. The details are as follows:
s401, the main device randomly selects a parameter value for each instruction from the parameter values associated with each instruction in the parameter set.
In the embodiment of the present application, the selection of the instruction in the parameter set may include the following two optional ranges: 1. the instructions included in the parameter set are all instructions related to functions supported by the device to be tested. 2. The relevant instructions that may be involved in the user's commonly used scenario.
And on the basis of determining the parameter set, the main equipment selects the parameter values from the parameter set. Specifically, the embodiment of the present application considers that each instruction is an independent operation object, and for all parameter values associated with each instruction, one parameter value is randomly extracted as a parameter value to be tested at this time.
As an example, based on the embodiment shown in fig. 1B, the master device in the embodiment of the present application selects a parameter value. For instruction 11, a parameter value may be randomly selected from among parameter value 11, parameter value 12, and parameter value 13. For instruction 21, a parameter value may be randomly selected from among parameter value 21, parameter value 22, and parameter value 23. For instruction 31, a parameter value may be randomly selected from among parameter value 31, parameter value 32, and parameter value 33. For instruction n1, a parameter value may be randomly selected from among parameter value n1, parameter value n2, and parameter value n3. Referring to fig. 5, a schematic diagram of a possible result before and after the parameter value selection provided in the embodiment of the present application is shown, where for the parameter value 11 selected by the instruction 11, the parameter value 23 selected by the instruction 21, the parameter value 32 selected by the instruction 31, and the parameter value n3 selected by the instruction n 1.
S402, the main device sends the selected parameter value and the associated instruction to the device to be tested. The sending sequence among different instructions can be random or according to a preset sequence.
After the parameter values corresponding to the instructions are selected, the main device sends the instructions and the selected corresponding parameter values to the device to be tested so as to test the processing capacity of the device to be tested on the parameter values. The sending sequence between different instructions is not limited herein, and includes but is not limited to: sending the instructions in a random sequence, sending all the instructions together or sending the instructions according to a sequence preset by a tester.
Still taking the embodiment shown in fig. 5 as an example for illustration, on the basis of the embodiment shown in fig. 5, it is assumed that the random instruction sending sequence is: instruction 21, instruction 11, instruction n1, and instruction 31. At this time, in operation S402, the master device may send the instruction 21 and the parameter value 23 to the device to be tested, send the instruction 11 and the parameter value 11 to the device to be tested, send the instruction n1 and the parameter value n3 to the device to be tested, and send the instruction 31 and the parameter value 32 to the device to be tested according to the instruction random sending sequence.
And S403, the master equipment acquires the processing result of the equipment to be tested on each sent parameter value to obtain compatibility test data of the protocol to be tested in the equipment to be tested.
In the embodiment of the present application, the compatibility test data obtained in the parameter test stage may also be referred to as second compatibility test data. After the instruction and the parameter value are sent to the device to be tested, the device to be tested theoretically performs corresponding processing response on the parameter value. For the parameter values that can be normally processed by the device to be tested, due to the difference of the parameter values and the difference of the processing modes of the parameter values by the device to be tested, the processing modes of the parameter values by the device to be tested may differ. For example, for some control instructions, such as volume control, audio/video play control, call control, and other related instructions. After receiving the control instructions and the corresponding parameter values sent by the master device, some devices to be tested may adjust the corresponding control parameters according to the parameter values, for example, adjust the volume of the played audio and video according to the received volume value. And after the other devices to be tested can adjust the corresponding control parameters according to the parameter values, response information can be synchronously replied to the main device, for example, when the volume of the played audio and video is adjusted according to the volume value, a message of 'successful volume adjustment' can be replied to the main device.
As can be seen from the above description, in practical applications, the master device serving as the instruction and parameter value sending end may not receive the processing condition of the device under test serving as the receiving end on the parameter value. Therefore, in the embodiment of the present application, the processing result of the device under test on each parameter value may include at least the following two obtaining manners:
the acquisition method 1: and the main equipment receives the processing result of each parameter value sent by the equipment to be tested.
The acquisition mode 2: and the testing personnel obtains the processing result of the equipment to be tested on each parameter value by observing and the like, and then the processing result is recorded into the main equipment.
The processing results are the compatibility test data (i.e. the second compatibility test data) of the protocol to be tested for instructing the processing capability of different protocol parameter values. After the processing results of the device to be tested for each parameter value are obtained, the main device may select to store the processing results or send the processing results to a specific device.
As an optional embodiment of the present application, data logging in the form of log (log) can be selected for the connectivity test, the instruction test and the parameter test. The data such as the relevant test conditions, test process and test results in the test process are stored in the log for playback and use when needed.
In practical applications, in order to realize simulation of multiple possible usage scenarios of the user, the operations of S401 to S403 may be repeatedly performed multiple times. Because the parameter value is randomly selected each time, various possible use scenes of the user in the real use process can be realized by repeatedly executing for many times, and the effective simulation test of the protocol to be tested after secondary development is realized. The specific number of repetitions is not limited herein and can be set by a technician as desired.
In an alternative embodiment of the present application, multiple parameters may be associated with one instruction in practical applications. For example, if the instruction a is a battery information notification instruction, parameter values of two parameters, namely battery power and battery service life, which can be simultaneously sent to the device to be tested. At this time, theoretically, only the parameter value of the battery capacity or the battery service life may be set for the instruction a, and the battery capacity and the battery service life may also be set at the same time. In the embodiment of the present application, each instruction in the parameter set may also be associated with one or more parameters, where each parameter may be associated with one or more parameter values.
For the case that a single instruction is associated with multiple parameters, when randomly selecting parameter values, the master device may select to randomly select one parameter first, and then randomly select one parameter value from the parameter values associated with the parameter. Alternatively, one parameter value may be randomly selected from all parameter values associated with the instruction without distinguishing the parameters. Wherein, for the case of selecting the parameter value first and then selecting the parameter value, S401 can be adjusted to: and the master equipment randomly selects a parameter value for each instruction from the parameter values associated with each instruction in the parameter set. For an instruction associated with a plurality of parameters, one parameter is selected from the associated plurality of parameters, and one parameter value is randomly selected from the parameter values associated with the selected parameter.
To illustrate with an example, assume that instruction 11 and instruction 21 are included in a parameter set. The instruction 11 is associated with two parameters, namely a parameter 11 and a parameter 12, the parameter 11 is provided with 3 parameter values, namely a parameter 11, a parameter 12 and a parameter 13, and the parameter 12 is provided with two parameter values, namely a parameter 14 and a parameter 15. The command 21 has associated therewith a parameter 21, and has a corresponding parameter value 21, parameter value 22, and parameter value 23. At this time, by means of random selection, it is assumed that the parameter 14 is selected for the instruction 11 and the parameter value 22 is selected for the instruction 21. Then, reference may be made to fig. 6, which is a schematic diagram illustrating a possible result of parameter value selection provided in the embodiment of the present application. Based on fig. 6, the master device may send the instruction 11 to the device under test together with the parameter value 14, and send the instruction 21 to the device under test together with the parameter value 22. And simultaneously recording the processing results of the equipment to be tested on the parameter values 14 and 22 as compatibility test data corresponding to the processing capability of the parameter values. For the random selection of the associated parameter value of the instruction 11, the parameter value 14 may be randomly selected from 5 parameter values, namely, the parameter value 11, the parameter value 12, the parameter value 13, the parameter value 14 and the parameter value 15. It is also possible to select the parameter 12 first and then randomly select the parameter value 14 from the parameter value 14 and the parameter value 15 associated with the parameter 12.
As an optional embodiment of the present application, the master device may also select a parameter value of one instruction at a time, send the randomly selected parameter value to the device under test, and record a processing result of the device under test on the parameter value. Referring to fig. 7, S401 may be replaced by: s701, the main device selects an instruction from the parameter set, and randomly selects a parameter value from all parameter values associated with the selected instruction. S402 may be replaced with: and S702, the main equipment sends the selected instruction and the parameter value to the equipment to be tested together. S403 may be replaced with: and S703, the master device obtains the processing result of the device to be tested on the sent parameter value, and obtains compatibility test data of the protocol to be tested in the device to be tested. The instruction selected in S701 may be referred to as a target instruction, and the parameter value of the target instruction selected randomly may be referred to as a target parameter value. Therefore, in S702, it can also be described as: and the main equipment sends the target instruction and the target parameter to the equipment to be tested together.
In the embodiment of the present application, the selection method of the instruction is not limited too much, and for example, the instruction may be selected randomly, or may be selected in a traversal manner. Meanwhile, in order to test the processing capability of the device under test for different parameter values of different instructions, the operations of S701 to S703 may be performed multiple times. As an optional embodiment of the present application, at this time, the master device may be configured not to repeatedly select the same parameter value in the operation of S701, that is, the random selection operation is not repeated when the parameter value is randomly selected.
In practical applications, different application protocols may have differences in parameter value settings and processing manners for the same parameter. For example, also for the charge parameter, assume that application protocol a sets the charge value to a range of 0-10, where 10 is the full charge. The application protocol B sets the charge value to 0-15, where 15 is full. The application protocol C sets the charge value to 0% -100%, where 100% is full charge. At this time, the setting modes of the electric quantity values between the 3 application protocols are different, and in actual application, the three protocols may have a compatibility problem. For example, the definition form of the electric quantity value is different between the application protocol a and the application protocol C, and therefore, the two communication devices may not be able to resolve the correct electric quantity value. Therefore, through the operations of S401 to S403 or S701 to S703, not only various possible actual use situations of the user can be simulated, but also parameter value compatibility of the protocol to be tested under actual situations of secondary development of various possible instruction parameters can be simulated and tested. For example, under the condition that the setting mode of the protocol to be tested for the parameter value is unknown, whether the protocol to be tested can be compatible with the parameter value set in the parameter instruction normally is tested. The method can test the compatibility of the protocol to be tested and different parameter value forms under the condition that the specific parameter value of the protocol to be tested is unknown. Or the compatibility between the protocol to be tested and various parameter value setting modes can be tested under the condition that the parameter value setting modes of the protocol to be tested are known. Therefore, the method and the device for testing the compatibility of the protocol to be tested can greatly improve the effectiveness of parameter testing in the compatibility testing of the protocol to be tested.
As an optional embodiment of the present application, in order to improve the effect of the compatibility test on the protocol parameters to be tested, the effectiveness of the test is improved. In the embodiment of the application, at least one abnormal value is contained in the parameter value associated with each instruction. The abnormal value refers to a parameter value which exceeds a normal value range corresponding to the parameter to which the abnormal value belongs. It is assumed that for the parameter of the volume, the volume value (i.e. the parameter value of the volume) normally ranges from 0 to 100. In this case, values other than 0 to 100, such as any negative value or any value exceeding 100, are abnormal values. Assuming that the volume belongs to a parameter of a command in the parameter set, in this embodiment, the volume value associated with the command at least includes a negative value or any value exceeding 100, such as the volume value 110. When the embodiment of the present application is combined with the embodiment shown in fig. 1B, it is described that the instruction 11, the instruction 21, the instruction 31 \8230, the instruction 8230, and the instruction n1 each include at least one abnormal value in the 3 parameter values associated therewith. For example, for the instruction 11, at least 1 abnormal value is included in the parameter value 11, the parameter value 12, and the parameter value 13. As another alternative embodiment of the present application, a part of the instruction sets may have associated abnormal values, and another part of the instruction sets may not have associated abnormal values. The instruction associated with the abnormal value may also be referred to as a fourth instruction. When combined with all cases containing outliers, we can also describe: the parameter set comprises at least one fourth instruction, wherein the parameter values associated with the fourth instruction each comprise at least one abnormal value. For example, assuming that 10 instructions are included in the parameter set, 1 to 10 instructions may be associated with abnormal values.
By setting the abnormal value and performing random selection test, the embodiment of the application can effectively test the processing capacity of the protocol to be tested on the abnormal value in the parameter test stage. For example, the sound volume value of the abnormal value is not displayed or is displayed in the most approximate normal state, and the like, if the sound volume value of the abnormal value is not displayed or the response processing is not performed, the sound volume value of the abnormal value is displayed in the most approximate normal state. Therefore, more possible secondary development real conditions of the instruction parameters and possible user use conditions can be simulated, and the compatibility test effectiveness on the parameter value processing capacity is higher.
It should be particularly noted that in practical applications, the functional test phase (including the instruction test phase and the parameter test phase) may also be independent of the connectivity test phase. That is, the tester may use any method to implement the communication connection between the main device and the device to be tested, for example, use the method in the connectivity test stage, or use a method other than the connectivity test stage to establish the communication connection between the main device and the device to be tested. And on the basis that the communication connection between the main equipment and the equipment to be tested is successfully established, the corresponding operation of the instruction testing stage or the parameter testing stage can be independently performed. For example, independently performing instruction testing to detect the instruction support of the protocol under test. Or independently perform parameter test to detect the processing capability (i.e. the processing capability to the parameter value) of the protocol to be tested to the instruction parameter sent by other protocols.
As a specific embodiment of the present application, a connectivity test stage and a parameter test stage may be optionally included in the embodiment of the present application. At this time, the compatibility test flow for the protocol to be tested may refer to fig. 8, which is detailed as follows:
s801, a tester configures an instruction library and a parameter library (namely an instruction set and a parameter set) in advance.
S802, the tester configures a random test scheme of the main equipment for the connectivity test and the function test.
And S803, the main device adopts the set random test scheme to process the instruction library and the parameter library to obtain the simulated protocol content.
And S804, the main device carries out compatibility test on the device to be tested based on the simulated protocol content.
And S805, the main equipment records the test result to obtain compatibility test data.
For the specific operation principle, details, and beneficial effects of S801 to S805, reference may be made to the above description of the pre-configuration stage, the connectivity test stage, and the functionality test stage, which is not repeated herein. In the random test scheme in S802, the random test scheme is used in the connectivity test stage and the functional test stage, and the details of the random test scheme may refer to the descriptions of the connectivity test stage and the functional test stage. The simulated protocol content is the protocol flow after the random selection and sequencing of the instructions of the instruction library through the random test scheme and the random selection of parameter values of the parameter library.
In the embodiment of the application, random simulation of the protocol flow can be realized by randomly selecting the instructions and randomly sequencing the instructions, and the test scene corresponding to the protocol flow is randomly obtained. Through the test of the test scene, the situation of unpredictable third-party secondary development protocol flows in real situations can be effectively simulated. And through the random selection of the parameter values, the test scene corresponding to the parameter values is randomly obtained, so that the unpredictable third-party secondary development instruction or functional condition in the real condition can be effectively simulated. Therefore, by the method of the embodiment of the application, a tester can realize the compatibility test of the communication protocol secondary development random condition, wherein the compatibility test comprises the simulation of the unknown secondary development condition, and the compatibility test is not limited to the communication protocol secondary development condition mastered by the tester. Therefore, the embodiment of the application can better meet the requirement of the actual communication protocol compatibility test and greatly improve the effectiveness of the communication protocol compatibility test. Meanwhile, adaptation to unknown secondary development conditions is not needed, and the workload of testers for manually constructing different test scenes in the compatibility test process can be reduced. Therefore, the efficiency of the compatibility test can be improved.
As an optional embodiment of the present application, on the basis of acquiring compatibility test data (including a connectivity test result, an instruction test result, and a parameter test result) of a protocol to be tested, the embodiment of the present application does not limit the actual application of the compatibility test results too much.
For example, as an optional embodiment of the present application, for a possible application scenario of a connectivity test result, when a new electronic device (installed with an application protocol that belongs to the same class as the protocol to be tested) comes into the market, a tester may quickly determine whether the electronic device can establish a communication connection with the device to be tested by analyzing a protocol flow of the application protocol installed in the electronic device and performing data matching with the connectivity test result. When a new application protocol is disclosed, the protocol flow of the application protocol is analyzed and data matching is carried out on the communication test result, so that whether the application protocol is matched with the protocol flow of the protocol to be tested can be quickly judged. Therefore, when the electronic equipment provided with the application protocol is on the market, whether the electronic equipment on the market and the equipment to be tested can normally establish communication connection or not is quickly judged.
As another optional embodiment of the present application, in another possible application scenario for the connectivity test result, the connectivity test result may serve as a reference data of a developer of the protocol to be tested, so as to evaluate connectivity capability of the protocol to be tested and other application protocols. When the communication test result is not expected by the developer, the protocol flow of the protocol to be tested can be optimized and adjusted, so that the compatibility of the protocol to be tested is improved, and the use experience of the user on the equipment to be tested is improved.
As another alternative embodiment of the present application, for a possible application scenario of a parameter test result (i.e., a processing result of a device under test on a parameter value), the parameter test result may be used as a reference data of a developer of a protocol under test, for evaluating capability of the protocol under test to process the parameter value under different conditions. When the parameter test result is not expected by the developer, the processing mode of the parameter value in the protocol to be tested can be optimized and adjusted, so that the processing capability of the protocol to be tested on the parameter values of different conditions is improved, the compatibility of the parameter value is improved, and the use experience of a user on the equipment to be tested is improved.
Fig. 9 shows a schematic structural diagram of a protocol testing apparatus provided in the embodiment of the present application, and only shows a part related to the embodiment of the present application for convenience of description, corresponding to the protocol testing method described in the embodiment above.
Referring to fig. 9, the protocol testing apparatus includes:
the instruction selecting module 91 is configured to randomly select at least one second instruction from an instruction set including at least one first instruction.
And the instruction sorting module 92 is used for randomly sorting all the second instructions.
And the communication test module 93 is configured to perform a communication connection test on the protocol to be tested in the device to be tested based on the second instruction after the random sorting processing, so as to obtain first compatibility test data of the protocol to be tested.
The process of implementing each function by each module in the protocol testing apparatus provided in the embodiment of the present application may specifically refer to the description of the embodiments shown in fig. 1A to fig. 8 and other related method embodiments, and is not described herein again.
It should be noted that, for the information interaction, execution process, and other contents between the above devices/units, the specific functions and technical effects thereof based on the same concept as those of the method embodiment of the present application can be specifically referred to the method embodiment portion, and are not described herein again.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing a relative importance or importance. It will also be understood that, although the terms first, second, etc. may be used herein to describe various elements in some embodiments of the application, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first table may be named a second table, and similarly, a second table may be named a first table, without departing from the scope of various described embodiments. The first table and the second table are both tables, but they are not the same table.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically stated.
The protocol testing method provided by the embodiment of the application can be applied to electronic devices such as a mobile phone, a tablet personal computer, a wearable device, a vehicle-mounted device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a server, a netbook, a Personal Digital Assistant (PDA), and the like, and the embodiment of the application does not limit the specific types of the electronic devices at all. The electronic device described in the embodiment of the present application may refer to a master device or a device to be tested.
For example, the electronic device may be a cellular phone, a cordless phone, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication capability, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a vehicle networking terminal, a computer, a laptop, a handheld communication device, a handheld computing device, a satellite radio, a Customer Premises Equipment (CPE), and/or other devices used to communicate over a wireless system, as well as next generation communication systems, e.g., an electronic device in a 5G Network or an electronic device in a future evolved Public Land Mobile Network (PLMN) Network, and the like.
By way of example and not limitation, when the electronic device is a wearable device, the wearable device may also be a generic term for intelligently designing daily wearing by applying wearable technology, developing wearable devices, such as glasses, gloves, watches, clothing, shoes, and the like. The wearable device may be worn directly on the body or may be a portable device integrated into the user's clothing or accessory. The wearable device is not only a hardware device, but also realizes powerful functions through software support, data interaction and cloud interaction. The general formula smart machine of wearing includes that the function is complete, the size is big, can not rely on the smart mobile phone to realize complete or partial function, like intelligent wrist-watch or intelligent glasses etc to and only be absorbed in a certain class of application function, need use like the smart mobile phone cooperation with other equipment, like all kinds of intelligent bracelet, intelligent ornament etc. that carry out the sign monitoring.
Hereinafter, taking the electronic device as a mobile phone as an example, fig. 10 shows a schematic structural diagram of the mobile phone 100.
The handset 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a SIM card interface 195, and the like. The sensor module 180 may include a gyroscope sensor 180A, an acceleration sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an ambient light sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, and a touch sensor 180K (of course, the mobile phone 100 may further include other sensors, such as a temperature sensor, a pressure sensor, an air pressure sensor, a bone conduction sensor, and the like, which are not shown in the figure).
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a Neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors. Wherein the controller may be a neural center and a command center of the cell phone 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
The processor 110 may run the protocol testing method provided in the embodiment of the present application, so as to prompt and improve the user experience. The processor 110 may include different devices, for example, when the CPU and the GPU are integrated, the CPU and the GPU may cooperate to execute the protocol testing method provided in the embodiment of the present application, for example, part of the algorithm in the protocol testing method is executed by the CPU, and another part of the algorithm is executed by the GPU, so as to obtain faster processing efficiency.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the cellular phone 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, codes of application programs (such as a camera application, a WeChat application, and the like), and the like. The data storage area can store data created during the use of the mobile phone 100 (such as images, videos and the like acquired by a camera application), and the like.
The internal memory 121 may further store one or more computer programs corresponding to the protocol testing method provided in the embodiment of the present application. The one or more computer programs stored in the memory 121 and configured to be executed by the one or more processors 110, the one or more computer programs comprising instructions which can be used to perform the steps as in the respective embodiments of fig. 2-8, the computer programs can comprise an account number verification module, a priority comparison module. The account verification module is used for authenticating system authentication accounts of other terminal equipment electronic equipment in the local area network; and the priority comparison module can be used for comparing the priority of the audio output request service with the priority of the current output service of the audio output equipment. The state synchronization module can be used for synchronizing the device state of the audio output device currently accessed by the terminal device electronic device to other terminal device electronic devices, or synchronizing the device state of the audio output device currently accessed by other devices to local. When the code of the protocol testing method stored in the internal memory 121 is executed by the processor 110, the processor 110 may control the terminal device electronic device to perform compatibility test-related data processing.
In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
Of course, the code of the protocol testing method provided by the embodiment of the present application may also be stored in the external memory. In this case, the processor 110 may execute the code of the protocol testing method stored in the external memory through the external memory interface 120, and the processor 110 may control the electronic device to perform compatibility test-related data processing.
The wireless communication function of the mobile phone 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the handset 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including wireless communication of 2G/3G/4G/5G, etc. applied to the handset 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110. In the embodiment of the present application, the mobile communication module 150 may also be used for information interaction with other electronic devices.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication applied to the mobile phone 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (BT), global Navigation Satellite System (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves. In this embodiment, the wireless communication module 160 may be used to access the access point device, and send and receive messages to other electronic devices.
In addition, the mobile phone 100 can implement an audio function through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playing, recording, etc. The handset 100 may receive key 190 inputs, generating key signal inputs relating to user settings and function controls of the handset 100. The handset 100 can generate a vibration alert (e.g., an incoming call vibration alert) using the motor 191. The indicator 192 in the mobile phone 100 may be an indicator light, and may be used to indicate a charging status, a power change, or a message, a missed call, a notification, etc. The SIM card interface 195 in the handset 100 is used to connect a SIM card. The SIM card can be attached to and detached from the cellular phone 100 by being inserted into the SIM card interface 195 or being pulled out from the SIM card interface 195.
It should be understood that in practical applications, the mobile phone 100 may include more or less components than those shown in fig. 10, and the embodiment of the present application is not limited thereto. The illustrated handset 100 is merely an example, and the handset 100 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The software system of the electronic device may employ a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the application takes an Android system with a layered architecture as an example, and exemplarily illustrates a software structure of an electronic device. Fig. 11 is a block diagram of a software configuration of an electronic device according to an embodiment of the present application.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.
The application layer may include a series of application packages.
As shown in fig. 11, the application package may include phone, camera, gallery, calendar, talk, map, navigation, WLAN, bluetooth, music, video, short message, etc. applications.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 11, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide communication functions of the electronic device. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a brief dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scrollbar text in a status bar at the top of the system, such as a notification of a running application in the background, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide a fusion of the 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as: MPEG4, H.164, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
Fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 12, the electronic apparatus 12 of this embodiment includes: at least one processor 120 (only one shown in fig. 12), a memory 121, said memory 121 having stored therein a computer program 122 executable on said processor 120. The processor 120, when executing the computer program 122, implements the steps in the above-described embodiments of the protocol testing method, such as the steps 201 to 204 shown in fig. 2. Alternatively, the processor 120, when executing the computer program 122, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules 91 to 93 shown in fig. 9.
The electronic device 12 may be a desktop computer, a notebook, a palm top computer, a cloud server, or other computing devices. The electronic device may include, but is not limited to, a processor 120, a memory 121. Those skilled in the art will appreciate that fig. 12 is merely an example of electronic device 12 and does not constitute a limitation of electronic device 12 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the electronic device may also include an input transmitting device, a network access device, a bus, etc.
The Processor 120 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 121 may be an internal storage unit of the electronic device 12 in some embodiments, such as a hard disk or a memory of the electronic device 12. The memory 121 may also be an external storage device of the electronic device 12, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the electronic device 12. Further, the memory 121 may also include both an internal storage unit and an external storage device of the electronic device 12. The memory 121 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer programs. The memory 121 may also be used to temporarily store data that has been transmitted or is to be transmitted.
In addition, it is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing functional units and modules are merely illustrated in terms of division, and in practical applications, the foregoing functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
An embodiment of the present application further provides an electronic device, where the electronic device includes at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor, and when the computer program is executed by the processor, the electronic device is enabled to implement the steps in any of the method embodiments.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when executed on an electronic device, enables the electronic device to implement the steps in the above method embodiments.
An embodiment of the present application further provides a chip system, where the chip system includes a processor, the processor is coupled to the memory, and the processor executes a computer program stored in the memory to implement the steps in the foregoing method embodiments.
The integrated module/unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application, and are intended to be included within the scope of the present application.

Claims (11)

1. A protocol testing method, comprising:
randomly selecting at least one second instruction from an instruction set containing at least one first instruction;
randomly sequencing all the second instructions;
and performing communication connection test on the protocol to be tested in the equipment to be tested based on the second instruction after the random sequencing processing to obtain first compatibility test data of the protocol to be tested.
2. The protocol testing method of claim 1, further comprising: and acquiring a parameter set, wherein the parameter set comprises at least one third instruction, and each third instruction is associated with at least one parameter value.
3. The protocol testing method according to claim 2, after establishing the communication connection with the device under test through the operation of performing the communication connection test on the protocol under test in the device under test, further comprising:
selecting a target instruction from the at least one third instruction;
selecting a target parameter value from all parameter values associated with the target instruction;
sending the target instruction and the target parameter value to the equipment to be tested;
and acquiring a processing result of the target parameter value by the equipment to be tested, and acquiring second compatibility test data of the protocol to be tested.
4. The protocol testing method according to claim 2, after establishing the communication connection with the device under test through the operation of performing the communication connection test on the protocol under test in the device under test, further comprising:
randomly selecting one associated parameter value for each third instruction to obtain target parameter values associated with the third instructions one by one;
sending the third instruction and the associated target parameter value to the equipment to be tested;
and acquiring a processing result of the target parameter value by the equipment to be tested, and acquiring second compatibility test data of the protocol to be tested.
5. The protocol testing method according to claim 3 or 4, wherein the at least one third instruction includes a fourth instruction, and the parameter value associated with each fourth instruction includes an abnormal value, where the abnormal value is a parameter value that exceeds a value range of the parameter to which the abnormal value belongs.
6. The protocol testing method according to any one of claims 1 to 4, wherein at least one configuration file is contained in the instruction set, and at least one first instruction is contained in each configuration file;
the randomly selecting at least one second instruction from an instruction set including at least one first instruction comprises:
and randomly selecting the first instruction for each configuration file to obtain at least one selected second instruction.
7. The protocol testing method according to any one of claims 1 to 4, wherein after the operation of performing a communication connection test on the protocol to be tested in the device to be tested based on the second instruction after the random ordering processing, the method further comprises:
acquiring the total times of executing the at least one second instruction operation randomly selected from an instruction set containing at least one first instruction;
and when the total times is less than or equal to the time threshold value, returning to execute the operation of randomly selecting at least one second instruction from the instruction set containing at least one first instruction and the subsequent operation until the total times is greater than the time threshold value.
8. The protocol testing method according to claim 7, wherein after said randomly ordering all said second instructions, a first ordered instruction set is obtained, said first ordered instruction set comprising said second instructions after said randomly ordering;
after the operation of performing random ordering processing on all the second instructions, the method further includes:
identifying whether the first ordered instruction set is contained in historical ordered instruction set data; an ordered instruction set obtained by randomly sequencing instructions randomly selected from the instruction set historically is recorded in the historical ordered instruction set data;
when the historical ordered instruction set data does not contain the first ordered instruction set, recording the first ordered instruction set into the historical ordered instruction set data, and executing the second instruction based on the random ordering processing to perform communication connection testing on a protocol to be tested in the equipment to be tested;
and when the historical ordered instruction set data contains the first ordered instruction set, returning to execute the operation of randomly selecting at least one second instruction from the instruction set containing at least one first instruction.
9. The protocol testing method according to any one of claims 1 to 4, wherein the performing, based on the second instruction after the random ordering processing, a communication connection test on a protocol to be tested in a device to be tested includes:
and performing at least two communication connection tests on the protocol to be tested in the device to be tested based on the second instruction after the random sequencing processing, and determining a communication connection test result of the protocol to be tested according to the results of the at least two communication connection tests.
10. An electronic device, characterized in that the electronic device comprises a memory, a processor, a computer program being stored on the memory and being executable on the processor, the processor implementing the steps of the method according to any of the claims 1 to 9 when executing the computer program.
11. A chip system, characterized in that the chip system comprises a processor coupled with a memory, the processor executing a computer program stored in the memory to implement the protocol testing method according to any of claims 1 to 9.
CN202211242967.1A 2022-10-11 2022-10-11 Protocol testing method, electronic equipment and chip system Active CN115314427B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211242967.1A CN115314427B (en) 2022-10-11 2022-10-11 Protocol testing method, electronic equipment and chip system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211242967.1A CN115314427B (en) 2022-10-11 2022-10-11 Protocol testing method, electronic equipment and chip system

Publications (2)

Publication Number Publication Date
CN115314427A true CN115314427A (en) 2022-11-08
CN115314427B CN115314427B (en) 2023-03-31

Family

ID=83867878

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211242967.1A Active CN115314427B (en) 2022-10-11 2022-10-11 Protocol testing method, electronic equipment and chip system

Country Status (1)

Country Link
CN (1) CN115314427B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116669064A (en) * 2022-12-08 2023-08-29 荣耀终端有限公司 Wireless protocol testing method and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105791032A (en) * 2016-05-04 2016-07-20 珠海格力电器股份有限公司 Test method for transport protocol between intelligent household electrical appliance and mobile terminal and test device thereof
CN106330593A (en) * 2015-07-01 2017-01-11 中兴通讯股份有限公司 Protocol detection method and device
CN109686385A (en) * 2017-12-27 2019-04-26 苏州乐轩科技有限公司 Video and audio device test system
CN113765718A (en) * 2021-09-10 2021-12-07 烽火通信科技股份有限公司 Test topology construction method and device for QUIC protocol
CN114679402A (en) * 2022-03-25 2022-06-28 武汉联影智融医疗科技有限公司 Method and device for testing communication protocol between upper computer and lower computer of medical robot

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106330593A (en) * 2015-07-01 2017-01-11 中兴通讯股份有限公司 Protocol detection method and device
CN105791032A (en) * 2016-05-04 2016-07-20 珠海格力电器股份有限公司 Test method for transport protocol between intelligent household electrical appliance and mobile terminal and test device thereof
CN109686385A (en) * 2017-12-27 2019-04-26 苏州乐轩科技有限公司 Video and audio device test system
CN113765718A (en) * 2021-09-10 2021-12-07 烽火通信科技股份有限公司 Test topology construction method and device for QUIC protocol
CN114679402A (en) * 2022-03-25 2022-06-28 武汉联影智融医疗科技有限公司 Method and device for testing communication protocol between upper computer and lower computer of medical robot

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116669064A (en) * 2022-12-08 2023-08-29 荣耀终端有限公司 Wireless protocol testing method and electronic equipment
CN116669064B (en) * 2022-12-08 2024-04-05 荣耀终端有限公司 Wireless protocol testing method and electronic equipment

Also Published As

Publication number Publication date
CN115314427B (en) 2023-03-31

Similar Documents

Publication Publication Date Title
US20230156835A1 (en) NFC-Based Communication Method, Apparatus, and System
CN110602686B (en) Method for using remote SIM module and electronic equipment
CN112817634B (en) COTA package downloading method and device
US20230054451A1 (en) Communication Connection Method and Electronic Device
WO2024037032A1 (en) Account login method and electronic device
CN115314427B (en) Protocol testing method, electronic equipment and chip system
WO2022135485A1 (en) Electronic device, theme configuration method therefor, and medium
CN113207115B (en) Mobile terminal and network searching control method
CN116669064B (en) Wireless protocol testing method and electronic equipment
CN116089358B (en) Data migration method and electronic equipment
CN114816463A (en) Upgrade prompting method, terminal device and computer readable storage medium
CN113867851A (en) Electronic equipment operation guide information recording method, electronic equipment operation guide information acquisition method and terminal equipment
CN117135729B (en) Multi-device cooperation method, system and terminal device
CN111159734A (en) Communication terminal and multi-application data inter-access processing method
CN112786022A (en) Terminal, first voice server, second voice server and voice recognition method
CN113867999B (en) Application exception handling method, terminal and computer readable storage medium
CN114006969B (en) Window starting method and electronic equipment
CN117135263B (en) Log information acquisition method, electronic device and computer readable storage medium
CN114339591B (en) Method and related device for positioning based on ultra-wideband chip
CN116033592B (en) Method and device for using cellular communication function
CN117376830B (en) Geofence matching method, electronic device and computer readable storage medium
CN114172925B (en) Network distribution method and equipment
CN112929858B (en) Method and terminal for simulating access control card
WO2024078412A1 (en) Cross-screen sharing method, graphical interface, and related apparatus
WO2023160217A1 (en) Method for detecting embedded subscriber identity module (esim) card, and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant