Test method, device, equipment and medium

By obtaining the general test instructions in the general test cases and converting them into target test AT commands, the problem of low testing efficiency in the existing technology is solved, efficient testing of different devices is achieved, and the testing process is simplified.

CN118779246APending Publication Date: 2024-10-15ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411114515.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

The testing methods in the existing technology are inefficient and difficult to adapt to the increase in equipment types and manufacturers, resulting in testers needing to write AT commands in multiple different formats, which is inefficient.

Method used

Provide a testing method that obtains the general test instructions in the general test case, determines the correspondence between the standard AT instructions and the general test instructions based on the device identification of the device under test, converts them into target test AT commands, and sends them to the device under test to perform the test. Task, shield the differences in AT commands of different devices or manufacturers.

Benefits of technology

When the same test task is performed on equipment from different devices or manufacturers, there is no need to change the general test instructions, which reduces the workload of testers, improves test efficiency, and simplifies the test process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779246A_ABST
    Figure CN118779246A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a test method and device, equipment and a medium. According to the scheme, the method comprises the steps of obtaining a test case for executing a test task; the test case at least comprises one general test instruction; the general test instruction can be converted into a plurality of AT commands in different formats for realizing the same test task; based on an equipment identifier of to-be-tested equipment, determining a corresponding relation between a standard AT instruction which can be identified by the to-be-tested equipment and the general test instruction; based on the corresponding relationship, converting the general test instruction into a target test AT command which can be executed by the to-be-tested device; and sending the target AT command to the to-be-tested device so as to execute the test task on the to-be-tested device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a testing method, device, equipment and medium. Background Art

[0002] With the development of computer technology, more and more electronic devices are used in various fields, such as financial services, intelligent manufacturing, etc., which provide convenience for people's life and production. In practical applications, in order to ensure that the equipment in actual use meets the requirements, the equipment needs to be tested and can only be officially put into use after passing the test.

[0003] In the prior art, testers usually write each test instruction for the device according to the device type and actual needs. To test the same function for devices of different manufacturers or models, testers are also required to write different test instructions for devices of different manufacturers or models. However, with the continuous increase in device types and manufacturers, the traditional manual testing method is inefficient and difficult to adapt to the current situation. Therefore, how to provide a more effective testing method is a technical problem that needs to be solved urgently. Summary of the invention

[0004] The embodiments of this specification provide a testing method, device, equipment and medium to solve the problem of low testing efficiency in existing testing methods.

[0005] To solve the above technical problems, the embodiments of this specification are implemented as follows:

[0006] A testing method provided in an embodiment of this specification includes:

[0007] Acquire a test case for executing a test task; the test case includes at least one general test instruction; the general test instruction can be converted into AT commands of multiple different formats for implementing the same test task;

[0008] Based on the device identification of the device under test, determining the correspondence between the standard AT command recognizable by the device under test and the general test command;

[0009] Based on the corresponding relationship, converting the general test instruction into a target test AT command that can be executed by the device under test;

[0010] The target test AT command is sent to the device under test so as to execute the test task on the device under test.

[0011] A testing device provided in an embodiment of the present specification includes:

[0012] A test case acquisition module, used to acquire a test case for executing a test task; the test case includes at least one general test instruction; the general test instruction can be converted into AT commands of multiple different formats for implementing the same test task;

[0013] A relationship determination module, used to determine the corresponding relationship between the standard AT command recognizable by the device under test and the general test command based on the device identification of the device under test;

[0014] A command conversion module, used for converting the general test instruction into a target test AT command executable by the device under test based on the corresponding relationship;

[0015] The command sending module is used to send the target test AT command to the device under test so as to execute the test task on the device under test.

[0016] A test device provided in an embodiment of this specification includes:

[0017] at least one processor; and,

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0020] Acquire a test case for executing a test task; the test case includes at least one general test instruction; the general test instruction can be converted into AT commands of multiple different formats for implementing the same test task;

[0021] Based on the device identification of the device under test, determining the correspondence between the standard AT command recognizable by the device under test and the general test command;

[0022] Based on the corresponding relationship, converting the general test instruction into a target test AT command that can be executed by the device under test;

[0023] The target test AT command is sent to the device under test so as to execute the test task on the device under test.

[0024] An embodiment of the present specification provides a computer-readable medium on which computer-readable instructions are stored. The computer-readable instructions can be executed by a processor to implement a testing method.

[0025] An embodiment of this specification can achieve the following beneficial effects:

[0026] The test case used to perform the test task in the embodiment of this specification may include a general test instruction that can be converted into a plurality of AT commands of different formats for implementing the same test task, and then based on the correspondence between the standard AT instructions recognizable by the device under test and the general test instructions, the general test instructions are converted into target test AT commands that can be executed by the device under test, and the device under test can execute the target test AT commands to perform the task test. Among them, the general test instructions can correspond to a plurality of AT commands of different formats for implementing the same test task, that is, the general test instructions can only be related to the test task and can be independent of the device under test, so that the same general test instructions can be used for the same test task for different devices under test, and the differences in AT commands of different devices or devices of different manufacturers can be shielded. When testing different devices or devices of different manufacturers, there is no need to change the general test instructions, which also reduces the workload of testers, improves test efficiency, and can better meet the needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0028] Figure 1 This is a schematic diagram of an application scenario flow of a test method in an embodiment of this specification;

[0029] Figure 2 A flow chart of a testing method provided in an embodiment of this specification;

[0030] Figure 3 A swimming lane diagram of a test method provided in an embodiment of this specification;

[0031] Figure 4 A schematic diagram of the structure of a testing device provided in an embodiment of this specification;

[0032] Figure 5 A schematic diagram of the structure of a test device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solutions and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of one or more embodiments of this specification.

[0034] First, the terms involved in one or more embodiments of this specification are explained.

[0035] Microlanguage: A set of customized microlanguages ​​for specific fields built based on rules, including syntax, semantics, data types, variables, operators, methods, etc.

[0036] AT command: The full name is Attention command, which is a set of string instructions used to control devices, providing a simple and effective way to interact with communication hardware modules. AT commands usually start with "AT", followed by one or more letters and numbers, as well as some specific characters to specify specific commands. AT commands can be used to control the settings and operations of modems. AT commands are also widely used in other devices, such as mobile phones, wireless modules, etc., for configuring network parameters, sending text messages, making calls and other functions. AT commands are also often used to control and configure various communication modules, such as GSM, GPS, Wi-Fi, etc.

[0037] AT command expression: The AT command is repackaged to comply with certain grammatical rules, and only focuses on the command expression of functional characteristics, which can shield the differences of AT commands.

[0038] Device under test: The object under test in software function test and performance test can be any qualified hardware connected to the test computer through the serial port.

[0039] Test engine: Software that automatically executes test cases and manages test activities. It can simplify the testing process, improve the efficiency and reliability of testing, and help track test results. The test engine runs on the test computer.

[0040] Test item: A collection of multiple micro-language instruction expressions organized to test a specific function of the software.

[0041] Test case: A set of test cases constructed to test the functionality of the software, which may include one or more test items.

[0042] Automated testing: is the process of running test cases using specific software tools that can automatically execute defined test actions, compare results with expectations and generate detailed test reports.

[0043] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0044] In order to solve the defects in the prior art, this solution provides the following embodiments:

[0045] Figure 1 This is a schematic diagram of an application scenario flow of a test method in an embodiment of this specification. Figure 1 As shown, the scheme includes a test platform 1, a device under test 2, and may also include a cloud platform 3. Among them, the test platform 1 can obtain a test case for executing a test task, and the test case may include at least one general test instruction, and then based on the correspondence between the standard AT instructions recognizable by the device under test and the general test instructions, the general test instructions for executing the test task are converted into target test AT commands that can be executed by the device under test 2, and sent to the device under test 2. The device under test 2 can execute the acquired target test AT command to test the test task. The device under test 2 can also send the execution data or result data of executing the target test AT command to the cloud platform 3. The cloud platform 3 can be used as a data storage platform. The test platform 1 can also obtain test data from the cloud platform 3, which can be used to evaluate whether the device under test has accurately executed the AT command.

[0046] In the embodiments of this specification, the general test instruction can be a test instruction corresponding to the test task, which can be converted into AT commands of multiple different formats for implementing the same test task. The AT commands executable by different devices under test are converted based on the same general test instruction. In this way, when testing different devices, the test can be performed based on the same general test instruction. The tester does not need to write different AT commands for each device under test, which can reduce the workload of the tester and improve the test efficiency. In addition, after determining the test task and the device under test, the test platform can perform automated testing, which can also improve the test efficiency.

[0047] In practical applications, the device under test may be one device or multiple devices, which is not specifically limited here.

[0048] Next, a test method provided in the embodiment of the specification will be specifically described with reference to the accompanying drawings:

[0049] Figure 2 A flow chart of a test method provided in an embodiment of this specification. From a program perspective, the execution subject of the process can be a program or application client installed on a server, or a test engine capable of executing the process.

[0050] like Figure 2 As shown, the process may include the following steps:

[0051] Step 202: Acquire a test case for executing a test task; the test case includes at least one general test instruction; the general test instruction can be converted into AT commands of multiple different formats for implementing the same test task.

[0052] In the embodiments of this specification, the test cases may be test cases corresponding to the test tasks, and different test tasks may correspond to different test cases. The general test instructions may be test instructions set according to preset language rules, and may correspond to ATs in a variety of different formats. The test tasks may include functional testing, performance testing, security testing, etc. Specific test tasks may be set according to actual needs.

[0053] In actual applications, the formats of executable AT commands may differ between devices from different manufacturers or devices with different systems. For example, in order to achieve the networking function, the AT command that can be recognized by device a provided by manufacturer A is AT+Network, and the AT command that can be recognized by device b provided by manufacturer B is AT+NWK. In the embodiments of this specification, the general test instructions can be converted into AT commands of different formats. For example, for the above-mentioned device a and device b, the same general test instruction can be converted into an AT command that can be executed by device a, or it can be converted into an AT command that can be executed by device b.

[0054] Step 204: Based on the device identification of the device under test, determine the correspondence between the standard AT commands recognizable by the device under test and the general test commands.

[0055] The standard AT command recognizable by the device under test may represent the AT command supported by the device under test and may be recognized by the device under test. In practical applications, an AT command line may include an AT command, and the AT command may represent the command part of the AT command that represents the command content.

[0056] The correspondence between the standard AT commands recognizable by the device under test and the general test commands can be pre-built based on manual operation or the generation capability of the machine model. The standard AT commands recognizable by the device under test can be provided by the manufacturer of the device under test, or can be obtained by analyzing data of the device under test or other devices of the same type and manufacturer as the device under test. The method for obtaining the standard AT commands and the method for building the correspondence are not specifically limited here.

[0057] Device identification can be used to distinguish devices of different manufacturers or types. For example, devices of the same manufacturer, configuration or model can correspond to the same device identification. Device identification can also correspond to devices one by one. For example, two or more devices of the same manufacturer, configuration and model can have different device identifications. There is no specific limitation here and it can be set according to actual needs.

[0058] Step 206: Based on the corresponding relationship, convert the general test instruction into a target test AT command that can be executed by the device under test.

[0059] The target test AT command may represent an AT command executable by the device under test to complete the test task. The target test AT command may include a standard AT command that can be recognized by the device under test. In the embodiment of this specification, the general test command can be converted into a target test AT command that can be executed by the device under test according to a preset conversion rule.

[0060] Step 208: Send the target test AT command to the device under test, so as to execute the test task on the device under test.

[0061] The target test AT command may be sent to the device under test via a network or cable, such as via a serial port.

[0062] It should be understood that the order of some steps in the methods described in one or more embodiments of this specification can be interchanged according to actual needs, or some steps can be omitted or deleted.

[0063] Figure 2 In the method, the test case for executing the test task may include a general test instruction that can be converted into a plurality of AT commands of different formats for implementing the same test task, and then based on the correspondence between the standard AT instructions recognizable by the device under test and the general test instructions, the general test instructions are converted into target test AT commands that can be executed by the device under test, and the device under test can execute the target test AT commands to perform the task test. Among them, the general test instructions can correspond to a plurality of AT commands of different formats for implementing the same test task, that is, the general test instructions can only be related to the test task and can be independent of the device under test, so that the same general test instructions can be used for the same test task for different devices under test, and the differences in AT commands of different devices or devices of different manufacturers can be shielded. When testing different devices or devices of different manufacturers, there is no need to change the general test instructions, which also reduces the workload of testers and improves test efficiency.

[0064] On the other hand, in the embodiments of the present specification, for multiple devices with different recognizable AT commands, the tester does not need to write a complete device test case for each device. On the basis of using the test case containing the general test command, only the correspondence between the standard AT commands recognizable by the device to be tested and the general test command can be maintained. This can reduce the amount of code that the tester needs to write, and can also reduce some repetitive operations performed by the tester, further reducing the problem of inaccurate testing caused by differences in tester experience.

[0065] based on Figure 2 The method, the examples of this specification also provide some specific implementation plans of the method, which are described below.

[0066] In actual applications, required test cases can be constructed for different test tasks, and when a test needs to be performed, a test case corresponding to the test task can be selected from the pre-constructed test cases. Optionally, the test case for performing the test task described in the embodiments of this specification may specifically include:

[0067] Obtaining a task identifier of the test task determined based on a preset operation of a user;

[0068] Based on the task identifier, a test case corresponding to the task identifier and used to execute the test task is selected from a database containing task identifiers and corresponding test cases.

[0069] The execution subject of the embodiments of this specification may also be a test platform equipped with a test program, and the user's preset operation may be an input operation, a selection operation, etc. For example, the user enters the number, code, name, etc. of the test task in the test interface, or selects the test task from a drop-down list, etc. The test case may be set according to the test content of the test task, and may be independent of the specific device.

[0070] As an implementation method, before testing the device under test, test cases corresponding to various test tasks can be pre-built, and a database of corresponding relationship values ​​between the test cases and the corresponding test tasks can be saved. For example, the test task identifier can be used as a keyword, and the corresponding test case can be used as a key value to query the corresponding test case based on the task identifier. In practical applications, test cases can be generated based on expert experience, for example, testers can write test cases based on actual needs, or they can be generated based on machine models, such as using large models such as GPT to generate test cases.

[0071] A test case may include one test item or multiple test items. For example, a test case for testing the data transmission capability of a device may include a data reporting test item for testing whether the device reports data accurately, and may also include a transmission volume test item for testing the data transmission volume of the device.

[0072] In actual applications, testers can also write test cases and provide them to the test platform to test the device under test. As an implementation mode, optionally, the test cases for executing the test tasks described in the embodiments of this specification may specifically include:

[0073] Obtain test cases input by the user according to preset language rules for executing test tasks.

[0074] In the embodiments of this specification, the test platform can also support users to write test cases. For example, for a newly developed function, the previous test case is not applicable or meets the test of the function, and the user can write a test case for the function. For another example, with the update of software or hardware, the previously set test case does not meet the actual needs, and the user can also write a test case.

[0075] The preset language rules can be predefined test case writing rules, existing computer language rules such as c++, java, python, etc., or writing rules based on natural language rules, such as a simple and easy-to-understand micro language based on natural language. The instructions included in the test case can be universal test instructions, so there is no need for testers to write different test cases for AT commands of different formats.

[0076] The test case for executing the test task input by the above user according to the preset language rules can be a complete test case required for the test task, or it can be a partial instruction in the test case. As an implementation method, the test platform in the embodiment of this specification can also display the content of the test case. After the corresponding test case is determined from the database based on the task identifier of the test task, the test case can be displayed on the display page, and the user can check the test case or edit it. If some parameter values ​​in the test case determined from the database do not meet the actual needs, they can be modified, and test instructions can be added or deleted.

[0077] AT commands are executable commands for test equipment, and may include information such as instruction type and instruction content, such as request type AT commands, test type AT commands, setting type test commands, etc. In the embodiments of this specification, the general test instructions may include information on the instruction type, and a target test AT command may be generated based on the instruction type. Optionally, based on the correspondence, converting the general test instruction into a target test AT command that can be executed by the device under test may specifically include:

[0078] Based on the corresponding relationship, determining a standard AT command that is identifiable by the device to be tested and corresponds to the general test command;

[0079] Based on the structure of the general test instruction, determining the instruction type represented by the general test instruction;

[0080] Based on the instruction type and the standard AT instruction, a target test AT command executable by the device under test is generated.

[0081] In the embodiments of this specification, the general test instruction may be an instruction that conforms to a preset structural rule, and the corresponding instruction type may be determined by analyzing the structure of the general test instruction. For example, the identifier representing the instruction type contained in the general test instruction may be determined based on a regular matching rule, thereby determining the instruction type. The type of the general test instruction may also be determined based on a machine model.

[0082] In actual applications, the types of general test instructions can also be saved in advance. For example, after the general test instruction is generated for the first time, the instruction type of the general test instruction can be determined based on a manual or machine model, and then the correspondence between the general test instruction and the corresponding instruction type can be recorded. In this way, when the device needs to be tested, the instruction type can be determined through the correspondence.

[0083] In the embodiments of this specification, the general test instruction may be an instruction set according to a preset language rule. As an implementation method, the general test instruction may conform to the format of an instruction expression of a preset rule, wherein the instruction expression may be expressed as:

[0084] Command handle = [number of times] command [parameter 1 [parameter 2] ...] [=> expected value]

[0085] Each part of the instruction expression can be separated by a space, and brackets [] can indicate an omitted part. The instruction handle can include a return type and an index, such as:

[0086] void_*: The instruction handle starting with void indicates that the current instruction does not care about the reply value and the default is successful execution. It is mainly used to execute action instructions, such as controlling device reset.

[0087] true_*: A command handle starting with true indicates that the command is expected to be executed successfully. The result of the command execution and the expected value must conform to the regular expression match. In this case, the command is logically considered to be executed successfully.

[0088] false_*: A command handle that starts with false indicates that the command is expected to fail to execute. The result of the command execution and the expected value do not conform to the regular expression match. In this case, the command is logically considered to be executed successfully.

[0089] var_*: Instruction handles starting with var are called variables. In actual applications, variables in test cases can include local variables and / or global variables. Variables in the same test item can be called local variables, which can be used as parameters by other instructions under the current test item; global variables can be called as parameters by each test instruction that needs the variable in the test case. The number of times can indicate the number of times the instruction expression needs to be executed. The next instruction can be executed only when the instruction is executed successfully or the number of times reaches the set number.

[0090] Instructions may indicate instruction contents, including standard AT instructions, instruction contents indicating general test instructions, internal instructions, test item sub-commands, etc.

[0091] For example, a standard AT command starting with AT+, such as AT+CMEE=2, means directly using the standard AT command as the instruction. For another example, an instruction containing a general test instruction identifier in brackets, such as (CGMM), may indicate the use of a general test instruction as the instruction, wherein the general test instruction identifier may be a string consisting of multiple uppercase letters. For another example, an instruction containing a variable identifier in brackets, such as (var_imei), may indicate the use of other variables as instructions. For another example, an instruction containing an internal function identifier in brackets, such as (inter_Sleep), may indicate the use of an internal function as an instruction, and the internal function may start with inter_. For another example, an instruction containing the identifier of other test items in angle brackets, such as<TESTCASE_mpub> , which can indicate the use of other test items as subcommands.

[0092] Parameters can refer to local variables or global variables in this test case, or they can be strings. For example, "hello" indicates a string type; (var_imei) indicates a variable type.

[0093] The expected value can represent the value you want to get after executing the instruction, which can be a regular expression.

[0094] As an implementation mode, the universal test instruction in the embodiment of this specification may include an identifier representing a standard AT instruction, and the corresponding standard AT instruction may be determined according to the identifier. Optionally, the universal test instruction in the embodiment of this specification includes an AT instruction alias; the AT instruction alias corresponds to a plurality of AT instructions of different formats for implementing the same function; the correspondence relationship represents the correspondence relationship between the AT instruction alias and the standard AT instruction executable by the device under test;

[0095] The determining, based on the corresponding relationship, a standard AT command identifiable by the device to be tested corresponding to the general test command may specifically include:

[0096] Based on the corresponding relationship, a standard AT command identifiable by the device to be tested and corresponding to the AT command alias is determined.

[0097] The AT command alias may represent a common identifier of a standard AT command for implementing the same function, and may be a string of one or more digits. For the convenience of computer processing, it may be one or more uppercase letters or other characters.

[0098] In the embodiments of this specification, a correspondence between an AT command alias and a corresponding standard AT command can be established. The corresponding standard AT command can be determined based on the AT command alias contained in the general test command, and then combined with the command type, a target test command executable by the device under test can be obtained.

[0099] For example, the general test instruction is true_1=5(MCONSTA)?, and the return type contained in its instruction handle is true, which can indicate an instruction that is expected to be executed successfully, and the number of executions is 5. The instruction is (MCONSTA)?, which indicates that the standard AT instruction with the AT instruction alias MCONSTA is referenced. Assuming that the standard AT instruction is AT+MAASCONNSTATE, it indicates an AT instruction for querying the device connection status, specifically identifying an instruction for querying the connection status of the MaaS module. In actual applications, the AT instruction alias in the general test instruction can be replaced with the standard AT instruction to obtain the standard AT command AT+MAASCONNSTATE?, which can be sent to the device under test 5 times, that is, the command is sent to the MaaS module 5 times.

[0100] To facilitate the management of various AT commands, an AT command expression that satisfies a preset rule may be used to represent the correspondence between the AT command alias and the standard AT command. As an implementation method, the format of the AT command expression may be:

[0101] Command alias = standard AT command | [head regular expression] | [expected regular expression] | [timeout];

[0102] Among them, the command alias can represent a character string set according to preset rules. AT commands with the same function can correspond to the same command alias, which can also be called AT command alias; standard AT commands can represent AT commands recognizable by the device under test; head regular expression can represent the prefix of the expected AT command reply; expected regular expression can represent the expected returned data; timeout can represent the delay waiting time.

[0103] For example, send the AT command AT+CGATT? to the device under test, and the device under test can reply with the following information:

[0104] +CGATT:1

[0105] OK

[0106] Among them, +CGATT: can represent the prefix head; 1 can represent the expected value expected. In practical applications, the head regular expression and the expected regular expression can be used to verify whether the device under test accurately executes the AT command.

[0107] Preferably, the number of characters included in the AT command alias may be less than or equal to the number of characters included in the standard AT command, for example, the AT command alias may be an abbreviation of the standard AT command.

[0108] If the standard AT command is AT+MAASCONNSTATE, the corresponding command expression can be:

[0109] MCONSTA=AT+MAASCONNSTATE|+MAASCONNSTATE:|1

[0110] In actual applications, an AT command alias can also correspond to multiple AT commands of the same AT command format. For example, when executing AT command a, AT command b needs to be executed. The two commands are linked or bound. In order to simplify test cases, an AT command alias can correspond to multiple AT commands. The format of multiple commands can be expressed as command alias = standard AT command 1 separator standard AT command 2... separator standard AT command n.

[0111] You can use preset separators, such as "\r\n", to divide different AT commands, such as DIALING = AT + CGDCON T = 3, "IP", "CMNET" \r\nAT + CGACT = 1, 3, where AT + CGDCON T = 3, "IP", "CMNET" and nAT + CGACT = 1, 3 are two standard AT commands. These two commands can be sent directly to the device for execution.

[0112] In the embodiments of this specification, there may be instructions that reference other instruction aliases, such as NETSTATUS=(NETREG)?, and it can be understood that the instruction alias NETSTATUS may represent an instruction that references the AT instruction whose instruction alias is NETREG.

[0113] In practical applications, the type of the AT command expression corresponding to the AT command alias contained in the general test command can be determined according to a preset regular rule, and then the target AT command sent to the device under test can be determined.

[0114] The AT command expression may include an AT command alias and a corresponding standard AT command, and the AT command expression may be used to represent the correspondence between the AT command alias and the corresponding standard AT command.

[0115] Optionally, the determining of the correspondence between the standard AT command recognizable by the device under test and the general test command based on the device identification of the device under test may specifically include:

[0116] Based on the device identification, determining a standard AT command recognizable by the device under test;

[0117] An AT command expression including the standard AT command and the AT command alias is obtained; the AT command expression is a command identification format set according to a preset rule, and the AT command expression and the standard AT command are used to implement the same command function.

[0118] In practical applications, the correspondence between the device identification and the standard AT commands recognizable by the device can be established in advance, or the standard AT commands recognizable by the device under test can be determined based on the data provided by the manufacturer or other data providers containing the standard AT commands recognizable by the device under test.

[0119] For example, the above-mentioned AT command expression may include a standard AT command and a corresponding AT command alias. In actual applications, testers can compile an AT command expression database for various functions to be tested and various devices to be tested, or they can build an AT command expression database based on historical test data, for example, saving the AT command expressions used in previous tests into a database. When it is necessary to test the device under test, an AT command expression including the standard AT command and the AT command alias can be obtained from the database. Specifically, the required AT command expression can be obtained by using regular matching or other methods, or by using some query tools for querying, which is not specifically limited here.

[0120] To facilitate testing of the device under test, the correspondence between the standard AT commands and AT command aliases required in the test task, such as the above AT command expressions, can also be added to the test case containing the general test command to obtain the target test case for the device under test, and the target test case can also be used to test the device under test. There is no need for the tester to manually write each instruction in the test case one by one, and the target test case for the device under test can be automatically generated, which can also improve the test efficiency.

[0121] In practical applications, in order to improve test efficiency and test stability, the AT command expression obtained in the embodiment of this specification can also be saved in an internal table for subsequent search. Optionally, the method in the embodiment of this specification can also include:

[0122] The AT command expression is parsed, and the elements contained in the AT command expression are stored in an internal table according to a preset storage format; in the internal table, the AT command alias is used as a keyword, and the standard AT command is used as a corresponding key value.

[0123] Internal tables are also called internal tables. They are tables in the internal memory table. When a program processes data with a fixed structure, internal tables can be used to store data.

[0124] As an implementation method, the storage format of the AT command expression may be:

[0125] 'Command alias':['Standard AT command','head regular expression]:','expected regular expression','timeout']

[0126] Each element of the AT command expression can be stored in the form of key-value. The command alias can be used as the key and other elements can be stored as part of the value to facilitate subsequent data search.

[0127] The general test case in the embodiment of this specification may also include a parameter part. For example, in addition to the instruction part, the above instruction expression may also include an optional parameter part. If the general test instruction includes a parameter part, a target test AT command that can be recognized by the device under test can also be generated based on the parameter value. Optionally, the general test instruction in the embodiment of this specification may also include a referenced parameter identifier, which is an identifier set according to a preset language rule to represent the parameters required in the standard AT instruction; the method in the embodiment of this specification may also include:

[0128] Based on the parameter identifier, a parameter value corresponding to the parameter identifier is determined from a variable set corresponding to the test task.

[0129] The above-mentioned generating a target test AT command executable by the device under test based on the instruction type and the standard AT instruction may specifically include:

[0130] Based on the instruction type, the standard AT instruction and the parameter value, a target test AT command executable by the device under test is generated.

[0131] The parameter identifier may include one or more characters, and the specific content may be set according to actual needs. The variable set corresponding to the test task may be determined according to the task identifier of the test task, or may be determined according to the parameter identifiers contained in each instruction of the test case. In practical applications, the corresponding relationship between the test task and the required variables may be established in advance through artificial or computer models, or a set of variables required for the task to be tested may be constructed.

[0132] The parameter value may represent the specific data of the parameter represented by the parameter identifier. In practical applications, the parameter value may have a corresponding relationship with the test task, and different test tasks for the same parameter may correspond to different parameter values. The parameter value may also be related to the device under test, and the corresponding relationship between the parameter value and the device under test may be established in advance, and the parameter value corresponding to the parameter identifier may also be determined based on the parameter identifier and the device identifier of the device under test.

[0133] If the general test instruction includes a parameter identifier, after determining the parameter value corresponding to the parameter identifier, the parameter identifier in the general test instruction can be replaced with the parameter value to generate a target test AT instruction that can be executed by the device under test.

[0134] For example, a general test instruction is true_2=5(MREGSTA)"(var_assetId)". Based on the regular rule, it can be determined that the instruction references other instructions in brackets, MREGSTA and var_assetId, where MREGSTA represents the referenced AT instruction and var_assetId represents the referenced parameter. The AT instruction corresponding to MREGSTA can be found, and the parameter value corresponding to var_assetId can be found from the parameter set. Assume that MREGSTA=AT+MAASREGSTATUS|+MAASREGSTATUS:|^1$$, which represents the instruction for querying the asset activation status of the Maas module; va r_assetId = (var_module_imei)_(var_host_user_name), you can further find the parameter values ​​corresponding to the variables var_module_imei and var_host_user_name, assuming var_module_imei = 1234, var_host_user_name = testAnt, then you can get the complete command AT+MAASREGSTATUS = "(1234_testAnt)", which is the command that can be recognized by the device under test. The command can be sent to the device under test. According to the number of times information contained in the general test command, the command can be sent to the device under test 5 times.

[0135] In actual applications, in order to make the test cases more concise, some processing logic can be executed by calling functions, and the functions can be universal and can be applied to different test cases, which can also reduce the workload of testers. For example, the logic used to implement business function combination, simple logical operations, remote platform requests, local operating system calls and other functions can be encapsulated into function modules. Optionally, the general test instructions described in the embodiments of this specification may include instructions for using internal functions; the internal functions are functions set according to preset language rules; the execution logic of the internal functions includes the AT instruction alias corresponding to the standard AT instructions; the AT instruction alias corresponds to a variety of different formats of AT instructions used to implement the same test task; the conversion of the general test instructions into target test AT commands that can be executed by the device under test may specifically include:

[0136] Calling the internal function to determine the instruction alias contained in the internal function;

[0137] Based on the command alias, determining a standard AT command identifiable by the device under test corresponding to the command alias;

[0138] Based on the execution logic of the internal function and the standard AT instruction, a target test AT command executable by the device under test is generated.

[0139] An internal function may represent a function that is allowed to be called by a test platform or a test engine, and may be a function set according to test requirements. In the embodiments of this specification, a general test instruction may include an identifier of an internal function, such as a function name, and the corresponding test content of the internal function may be called. An internal function may be a predefined function, and when executing a test instruction, the internal function may be called directly. As an implementation method, the execution logic of the internal function may include an AT instruction alias, and the corresponding standard AT instruction may be determined based on the AT instruction alias, and the target test AT command that can be executed by the device under test may be generated in combination with the execution logic represented by the internal function. It can be understood that the general test instruction may not directly include an AT instruction alias, and the target test AT command that can be executed by the device under test may be generated by calling an internal function.

[0140] For example, the general test instruction true_4=(inter_DataPub)0 references the instruction inter_DataPub, which is an instruction for calling the internal function DataPub, and inter can be the identifier of calling the internal function. The internal function DataPub can represent a function that packages preset parameters and sends them to the device under test and instructs the device under test to send the obtained packaged data to the cloud platform, and generates AT commands that can be recognized by the device under test based on the internal function.

[0141] Specifically, the DataPub internal function can combine the preset parameters into a json string, and then use the AT command expression MPUB=AT+MAASPUB to combine the data to be sent and the AT command into a real AT command. Assuming that the preset parameters include the parameter assetId=BMS_001 representing the device number, the parameter soh=90 representing the battery health status, the parameter soc=90 representing the battery power, and the parameter voltage=2000 representing the battery voltage, the following AT command can be obtained based on these parameters:

[0142] AT+MAASPUB={"assetId":"BMS_001","soh":90,"soc":90,"voltage":2000}

[0143] As an implementation method, the test case may include a physical model template item, and the physical model template item may include data to be sent to the device under test, such as the above-mentioned parameters indicating the device number, the parameters indicating the battery health status, the parameters indicating the battery power, the parameters indicating the battery voltage, etc. The DataPub internal function can generate a string based on the configuration item data in the physical model template, and combine it with the AT instruction to form a real AT command, that is, the target test AT command sent to the device under test.

[0144] It is understandable that the above preset parameters are only examples for more clearly explaining the method in the embodiments of this specification. In actual applications, the various configuration items included in the physical model template item can be set according to the test task, and can be static data set according to actual needs. In actual applications, the correspondence between the various configuration items in the physical model template item and the test task can be constructed based on expert experience, and the corresponding configuration item can be determined according to the task identifier of the test task.

[0145] In actual applications, internal functions also include internal functions that do not have AT command aliases, such as some internal functions that are independent of the device under test and are used to assist in completing test tasks, such as internal functions used for delay. Instructions that can call delayed internal functions can only be executed in the test platform or test engine, and can be used to control the timing of sending other instructions, and are independent of the device under test.

[0146] For example, the following combination of test instruction expressions means calling an internal function to shut down the network before resetting the device, and then resetting the device. During the device reset, the test engine sleeps for 5 seconds:

[0147] true_1=(inter_closeNet)

[0148] true_2= <reset>

[0149] void_4 = (inter_Sleep) 5

[0150] The internal function inter_Sleep may represent a sleep function, and sleeping for 5 seconds may represent that the duration of the suspension of sending AT commands to the device under test when the test engine stops is 5 seconds.

[0151] In order to improve the efficiency of the test, if the test case contains variable instructions, the parameter values ​​corresponding to each variable can be determined before converting the general test instruction into the target test AT instruction, so that the parameter value can be directly called later, without the need to gradually determine and store the required variable value according to the reference relationship contained in the general test instruction. Optionally, the test case described in the embodiment of this specification may also include variable instructions; the variable instructions are used to provide the parameters required in the test case; the method may also include:

[0152] If the variable instruction is a reference type variable instruction, determining the sub-instruction referenced by the variable instruction;

[0153] Get the parameter value corresponding to the sub-command;

[0154] A correspondence between the variable instruction and the parameter value is established.

[0155] A variable instruction may be an instruction containing a preset variable character, such as an instruction starting with var. A reference type variable instruction may be an instruction containing a reference identifier, such as an instruction containing brackets. A variable instruction and a reference type variable instruction may be determined based on preset rules, such as regular rules.

[0156] For example, var_assetId=(var_module_imei)_(var_host_user_name), which means that the variable var_assetId references the variables var_module_imei and var_host_user_name.

[0157] Sub-instructions can represent referenced instructions, such as var_module_imei and var_host_user_name mentioned above.

[0158] The parameter value corresponding to the sub-command can be pre-set or a device parameter related to the device under test. Testers can set the parameter value of the variable according to the requirements of the test task, or obtain the relevant parameters of the device after connecting to the device under test, such as the device name, the model of certain modules, etc. There is no specific limitation on the source of the parameter value here, and it can be set according to actual needs.

[0159] In the embodiments of this specification, a correspondence between variable instructions and corresponding parameter values ​​can be established. For example, in the above var_module_imei=1234, var_host_user_name=testAnt, a correspondence between var_assetId and 1234_testAnt can be established. In this way, when parsing general test instructions, the parameter value corresponding to the variable can be directly called without gradually obtaining the parameter value, which can improve test efficiency.

[0160] The general test instructions in the embodiments of this specification may be instructions that comply with preset rules. To ensure the smooth progress of the test, the structure format of the general test instructions may also be checked, and only instructions with the correct format may be executed. Optionally, the method in the embodiments of this specification may also include:

[0161] Determining whether the structure format of the general test instruction conforms to a preset structure format;

[0162] If it does not conform to the preset structural rules, a prompt message indicating the abnormality is generated.

[0163] Among them, it can be judged based on regular rules whether the structural format of the general test instruction conforms to the preset structural format. The preset structural format can be a structural format set according to actual needs, such as the format of the instruction expression mentioned above. A general test instruction can include an instruction handle part, a parameter part and other parts. The instruction handle is located on the left side of the equal sign and includes the return type and index information. If the general test instruction is an instruction containing number information and parameter information, the information representing the number, the information representing the instruction and the information representing the parameter need to be arranged in sequence. If it also includes information representing the expected value, the information should be located at the end of the general test instruction. In actual applications, judgments can also be made based on pre-trained machine models, or large language models such as GPT can be used for judgment, which is not specifically limited here.

[0164] In actual applications, format detection is performed before storing the general test instructions in the database. For example, after the tester completes writing the general test instructions or test cases for the first time, the format detection can be performed first. If the detection passes, the general test instructions or test cases are saved to the database to establish a corresponding relationship between the task identifier and the general test instructions or test cases. Format detection can also be performed before the general test instructions are executed. For example, each instruction contained in the test case determined based on the task identifier can be formatted, and the instruction can be parsed if it meets the requirements.

[0165] In actual applications, in order to verify whether the device under test actually executes the received AT command, the device under test can also feed back the execution result of the AT command to the test platform, which can be sent to the test platform directly or indirectly. For example, the device under test can send the execution result to the cloud platform, and the test platform can obtain the execution result from the cloud platform.

[0166] Optionally, the method in the embodiments of this specification may further include:

[0167] Obtaining the execution result of the target test AT command executed by the device under test;

[0168] Determine whether the execution result meets the expected result.

[0169] The expected result may be the expected data contained in the AT command. For example, the above-mentioned AT command expression may include the expected regular expression part, which may represent the expected return result. It may be determined whether the execution result provided by the device under test is consistent with the expected return result. If they are consistent, it may indicate that the device under test has accurately executed the test command and meets the requirements indicated by the test command. If they are inconsistent, it may indicate that the device under test has not accurately executed the command, and the command that has not been accurately executed may also be marked.

[0170] In order to more clearly determine the device status of the device under test, a test report for the device can also be generated based on the obtained execution results. The specific report content can be set according to actual needs, such as which test tasks have been executed by the device under test, the execution results of each test task, test instructions that have not been accurately executed, etc., which are not specifically limited here.

[0171] In order to more clearly illustrate the test method provided in the embodiments of this specification, the data reporting function of the device under test is taken as an example for description. Figure 3 A swim lane diagram of a test method provided in an embodiment of this specification, the scheme may use a use case acquisition phase, an instruction conversion phase, an instruction execution phase, and a result evaluation phase, and may specifically include:

[0172] Step 302: The test platform obtains the task identifier of the test task provided by the user.

[0173] Step 304: Based on the task identifier, determine a test case including at least one general test instruction.

[0174] Assume that the test case for testing the data reporting function is as follows:

[0175] #Product configuration test items

[0176] [GLOBAL_PRODUCT]

[0177] var_ProductName = bms

[0178] var_ProductKey=1234

[0179] var_ProductSecret=5678abcd

[0180] #Object model template

[0181] [GLOBAL_TEMPLATE_BMS_1]

[0182] var_assetId = (var_assetId) # equipment number

[0183] var_soh=90 #Battery health status

[0184] var_soc=90 #Battery power

[0185] var_voltage=2000 #Battery voltage

[0186] var_temperature=2000 #Battery temperature

[0187] #Global variable collection

[0188] [GLOBAL_variable]

[0189] var_module_imei=1234567890

[0190] var_host_name=test

[0191] var_assetId=(var_module_imei)_(var_host_name)

[0192] #Data reporting test items

[0193] [TESTCASE_mpub]

[0194] Description = "Data reporting"

[0195] true_1=5(MCONSTA)?

[0196] true_2=5(MREGSTA)"(var_assetId)"

[0197] var_timestamp=(inter_TimeTime)

[0198] true_4=(inter_DataPub)0

[0199] void_5 = ​​(inter_Sleep) 1

[0200] true_6=(inter_IotQueryDevProperties)(var_ProductKey)(var_module_imei)

[0201] (var_instanceId)(var_timestamp)

[0202] #One-click test

[0203] [TESTCASE_onecick]

[0204] Description="Functional test and report generation"

[0205] void_1=(inter_Report)<TESTCASE_mpub> Functional Test_F17

[0206] This test case contains multiple general test instructions, and the test case can be used to test the data reporting function of data reporting modules that support different AT commands.

[0207] Step 306: Obtain the device identification of the device under test, and determine the correspondence between the standard AT commands recognizable by the device under test and the general test commands.

[0208] Continuing with the above example, the test case contains AT command aliases consisting of uppercase letters, such as IMEI, MCONSTA, MREGSTA, etc. The correspondence between the standard AT commands recognizable by the device under test and the general test commands contained in the test case can be obtained from a pre-built database containing the correspondence between standard AT commands and AT command aliases. Assume that the following correspondence exists:

[0209] MCONSTA=AT+MAASCONNSTATE|+MAASCONNSTATE:|1#Query the device connection status

[0210] MREGSTA=AT+MAASREGSTATUS|+MAASREGSTATUS:|^1$$#Query asset activation status

[0211] Step 308: Based on the corresponding relationship, convert the general test instruction into a target test AT command that can be executed by the device under test.

[0212] Continuing with the above example, each variable instruction in the global variable can be parsed layer by layer to obtain the parameter value corresponding to the variable, such as the above variable var_assetId = (var_module_imei)_(var_host_name), where var_module_imei = 1234567890, var_host_name = test, so var_assetId = 1234567890_test can be obtained.

[0213] Each instruction in the data reporting test item can also be analyzed one by one, specifically:

[0214] Parse true_1=5(MCONSTA)? to generate the target test AT command AT+MAASCONNSTATE? to query the device connection status, which can be used to query whether the device under test has established a connection with the cloud platform. And the command can also be sent to the device under test 5 times.

[0215] Parse true_2=5(MREGSTA)"(var_assetId)", where var_assetId=1234567890_test, and generate the target test AT command AT+MAASREGSTATUS="(1234567890_test)" for querying the asset activation status, which can be used to query whether the device under test has the permission to use the cloud platform. And the command can also be sent to the device under test 5 times.

[0216] var_timestamp=(inter_TimeTime) may refer to the internal function TimeTime, which may represent a function for obtaining the current time, and may obtain the current time of the test platform, which may be independent of the device under test, and the obtained time may be used to assist in detecting the data reporting function of the device under test. The test platform may generate a timestamp based on the sending time.

[0217] In actual applications, an internal function table can be pre-built, which can contain execution logics of various internal functions. When an internal function needs to be referenced, the corresponding execution logic can be queried from the internal function table based on the function name or identifier and executed.

[0218] true_4=(inter_DataPub)0 indicates referencing the internal function DataPub, which indicates that the preset data is packaged and sent to the device under test and instructs the device under test to send the received data to the cloud platform. The execution logic of the internal function may include: determining the corresponding object model template according to the name of the device under test, then generating a string from the data contained in the object model template, and then generating a data report AT command containing the string to the device under test, so that the device under test sends the obtained string to the cloud platform based on the AT command.

[0219] Specifically, the configuration items in the physical model template can be packaged and sent to the device under test. For example, the data in the physical model template can be used to generate a string:

[0220] {"assetId":"1234567890_test","soh":90,"soc":90,"voltage":2000,"temperature":2000};

[0221] Then compose the AT command:

[0222] AT+MAASPUB=

[0223] {"assetId":"1234567890_test","soh":90,"soc":90,"voltage":2000,"temperature":2000},

[0224] It can be sent to the device under test through the serial port.

[0225] void_5=(inter_Sleep)1 indicates to reference the internal function Sleep, which can indicate sleep or pause, and this instruction can indicate sleep for 1 second. This instruction can be executed inside the test platform, or it can be irrelevant to the device under test.

[0226] true_6=(inter_IotQueryDevProperties)(var_ProductKey)(var_module_imei)

[0227] (var_instanceId)(var_timestamp) refers to the internal function IotQueryDevProperties, and the parameters required by the function include var_ProductKey, var_module_imei, var_instanceId, and var_timestamp. This function can be used to obtain data with a timestamp of var_timestamp from the cloud platform based on the product identifier, such as ProductKey, and then determine whether the device under test has accurately uploaded the data. This instruction can be an instruction executed within the test platform, without sending AT instructions to the device under test.

[0228] void_1=(inter_Report)<TESTCASE_mpub> Functional test_F17, this instruction may indicate that after obtaining the test item TESTCASE_mpub, each instruction under the test item is called one by one, and after the execution is completed, the test result may be saved to the F17 position of the table used to store the test result.

[0229] Step 310: Send the target test AT command to the device under test.

[0230] Step 312: The device under test may execute the target test AT command and send the execution result to the cloud platform.

[0231] As described above, execute the AT command AT+MAASPUB={"assetId":"1234567890_test","soh":90,"soc":90,"voltage":2000,"temperature":2000} to send the string {"assetId":"1234567890_test","soh":90,"soc":90,"voltage":2000,"temperature":2000} to the cloud platform.

[0232] Step 314: The cloud platform sends the execution result to the test device.

[0233] Among them, the test device can send a request to obtain data to the cloud platform, and the cloud platform can send corresponding data to the test platform based on the obtained request.

[0234] For example, the cloud platform can send the string sent by the device under test to the test platform, and can also include information such as the instruction prefix. The specific content can be set according to actual needs and is not specifically limited here.

[0235] Step 316: The test platform generates a test report based on the acquired test results.

[0236] Among them, the test platform can compare the obtained test results with the preset expected values ​​to determine whether the device under test has accurately executed the test, and then determine whether the device under test has passed the test of the test task.

[0237] As in the above example, by judging whether the string obtained from the platform is consistent with the string sent to the device under test, it can be judged whether the device under test has accurately executed the AT command for data upload, and further whether the data upload function of the device under test is normal.

[0238] In the embodiment of this specification, the test platform may include a test engine for parsing test cases, and the test engine may represent a test tool or platform for the execution and management of automated test cases. Test cases can be imported, test resources can be collected, tests can be executed, and test results and logs can be generated. The test engine can also be understood as a program contained in the test platform. The steps of test instruction parsing, result analysis, etc. mentioned above can be executed by the test engine, such as converting a general test instruction into a target test AT instruction that can be executed by the device under test, which can be executed by the test engine and sent to the device under test. To ensure the accurate conduct of the test, the test engine can also save the test case locally after obtaining the test case, and can also preliminarily parse the instructions in the test case, for example, before generating the AT command as described above, the parameter value of the required variable is parsed first, and the AT instruction expression can also be saved in the internal table, etc.

[0239] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method. Figure 4 This is a schematic diagram of the structure of a test device provided in the embodiment of this specification. Figure 4 As shown, the device may include:

[0240] A test case acquisition module 402 is used to acquire a test case for executing a test task; the test case includes at least one general test instruction; the general test instruction can be converted into AT commands of multiple different formats for implementing the same test task;

[0241] A relationship determination module 404, configured to determine a correspondence between a standard AT command recognizable by the device under test and the general test command based on a device identification of the device under test;

[0242] A command conversion module 406, configured to convert the general test instruction into a target test AT command executable by the device under test based on the corresponding relationship;

[0243] The command sending module 408 is used to send the target test AT command to the device under test so as to execute the test task on the device under test.

[0244] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method.

[0245] Figure 5 This is a schematic diagram of the structure of a test device provided in the embodiment of this specification. Figure 5 As shown, the device 500 may include:

[0246] at least one processor 510; and,

[0247] A memory 530 in communication with the at least one processor; wherein,

[0248] The memory 530 stores instructions 520 executable by the at least one processor 510. The instructions are executed by the at least one processor 510 to enable the at least one processor 510 to:

[0249] Acquire a test case for executing a test task; the test case includes at least one general test instruction; the general test instruction can be converted into AT commands of multiple different formats for implementing the same test task;

[0250] Based on the device identification of the device under test, determining the correspondence between the standard AT command recognizable by the device under test and the general test command;

[0251] Based on the corresponding relationship, converting the general test instruction into a target test AT command that can be executed by the device under test;

[0252] The target test AT command is sent to the device under test so as to execute the test task on the device under test.

[0253] Based on the same idea, the embodiment of this specification also provides a computer-readable medium corresponding to the above method. The computer-readable medium stores computer-readable instructions, and the computer-readable instructions can be executed by a processor to implement the above test method.

[0254] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. Figure 5 As for the device shown, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0255] In the 1990s, it was very clear whether the improvement of a technology was a hardware improvement (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements in the method flow today can be regarded as direct improvements in the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs. The original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0256] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0257] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0258] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0259] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0260] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0261] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0262] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0263] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0264] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0265] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0266] It should also be noted that the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the existence of other identical elements in the process, method, commodity or device including the element.

[0267] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0268] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0269] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.< / reset>

Claims

1. A testing method comprising: Get the test cases used to execute the test tasks; The test case includes at least one general test instruction; the general test instruction can be converted into AT commands of multiple different formats for implementing the same test task; Based on the device identification of the device under test, determining the correspondence between the standard AT command recognizable by the device under test and the general test command; Based on the corresponding relationship, converting the general test instruction into a target test AT command that can be executed by the device under test; The target test AT command is sent to the device under test so as to execute the test task on the device under test.

2. According to the method of claim 1, the obtaining of a test case for executing a test task specifically comprises: Obtaining a task identifier of the test task determined based on a preset operation of a user; Based on the task identifier, a test case corresponding to the task identifier and used to execute the test task is selected from a database containing task identifiers and corresponding test cases.

3. According to the method of claim 1, the obtaining of a test case for executing a test task specifically comprises: Obtain test cases input by the user according to preset language rules for executing test tasks.

4. The method according to claim 1, wherein based on the corresponding relationship, converting the general test instruction into a target test AT command executable by the device under test comprises: Based on the corresponding relationship, determining a standard AT command that is identifiable by the device to be tested and corresponds to the general test command; Based on the structure of the general test instruction, determining the instruction type represented by the general test instruction; Based on the instruction type and the standard AT instruction, a target test AT command executable by the device under test is generated.

5. The method according to claim 4, wherein the general test command includes an AT command alias; the AT command alias corresponds to a plurality of AT commands of different formats for implementing the same function; the corresponding relationship represents the corresponding relationship between the AT command alias and the standard AT command executable by the device under test; The determining, based on the corresponding relationship, a standard AT command that is identifiable by the device to be tested and corresponds to the general test command specifically includes: Based on the corresponding relationship, a standard AT command identifiable by the device to be tested and corresponding to the AT command alias is determined.

6. The method according to claim 1, wherein the general test command includes an AT command alias; the AT command alias corresponds to a plurality of AT commands of different formats for implementing the same function; The determining, based on the device identification of the device under test, the correspondence between the standard AT command recognizable by the device under test and the general test command specifically includes: Based on the device identification, determining a standard AT command recognizable by the device under test; Obtaining an AT command expression including the standard AT command and the AT command alias; The AT command expression is a command identification format set according to a preset rule, and the AT command expression and the standard AT command are used to implement the same command function.

7. The method according to claim 6, further comprising: Parsing the AT command expression, and storing the elements contained in the AT command expression in an internal table according to a preset storage format; In the internal table, the AT command alias is used as a keyword, and the standard AT command is used as a corresponding key value.

8. The method according to claim 4, wherein the general test instruction further comprises a referenced parameter identifier, wherein the parameter identifier is an identifier set according to a preset language rule and used to represent a parameter required in a standard AT instruction; The method further comprises: Based on the parameter identifier, determining a parameter value corresponding to the parameter identifier from a variable set corresponding to the test task; The generating, based on the instruction type and the standard AT instruction, a target test AT command executable by the device under test specifically includes: Based on the instruction type, the standard AT instruction and the parameter value, a target test AT command executable by the device under test is generated.

9. The method according to claim 1, wherein the general test instruction includes an instruction using an internal function; the internal function is a function set according to a preset language rule; the execution logic of the internal function includes an AT instruction alias corresponding to the standard AT instruction; the AT instruction alias corresponds to a plurality of AT instructions of different formats for implementing the same test task; The converting the general test instruction into a target test AT command executable by the device under test specifically includes: Calling the internal function to determine the instruction alias contained in the internal function; Based on the command alias, determining a standard AT command identifiable by the device under test corresponding to the command alias; Based on the execution logic of the internal function and the standard AT instruction, a target test AT command executable by the device under test is generated.

10. The method according to claim 1, wherein the test case further comprises a variable instruction; the variable instruction is used to provide parameters required in the test case; the method further comprises: If the variable instruction is a reference type variable instruction, determining the sub-instruction referenced by the variable instruction; Get the parameter value corresponding to the sub-command; A correspondence between the variable instruction and the parameter value is established.

11. The method according to claim 1, further comprising: Determining whether the structure format of the general test instruction conforms to a preset structure format; If it does not conform to the preset structural rules, a prompt message indicating the abnormality is generated.

12. The method according to claim 1, further comprising: Obtaining the execution result of the target test AT command executed by the device under test; Determine whether the execution result meets the expected result.

13. A testing device comprising: A test case acquisition module is used to acquire test cases for executing test tasks; The test case includes at least one general test instruction; the general test instruction can be converted into AT commands of multiple different formats for implementing the same test task; A relationship determination module, used to determine the corresponding relationship between the standard AT command recognizable by the device under test and the general test command based on the device identification of the device under test; A command conversion module, used for converting the general test instruction into a target test AT command executable by the device under test based on the corresponding relationship; The command sending module is used to send the target test AT command to the device under test so as to execute the test task on the device under test.

14. A testing device comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Acquire a test case for executing a test task; the test case includes at least one general test instruction; the general test instruction can be converted into AT commands of multiple different formats for implementing the same test task; Based on the device identification of the device under test, determining the correspondence between the standard AT command recognizable by the device under test and the general test command; Based on the corresponding relationship, converting the general test instruction into a target test AT command that can be executed by the device under test; The target test AT command is sent to the device under test so as to execute the test task on the device under test. 15 . A computer-readable medium having computer-readable instructions stored thereon, wherein the computer-readable instructions can be executed by a processor to implement the testing method according to any one of claims 1 to 12.