Test method, electronic device and storage medium
Through automated detection methods, wireless connection between testing tools and smart wearable devices is used to select and execute pre-stored test instructions, solving the problems of low test accuracy and high test complexity caused by manual operation errors, and achieving efficient and accurate testing Results and simplified test project extensions.
Patent Information
- Application Number
- CN202010870288.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-26
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-08-26
AI Technical Summary
The performance testing methods before leaving the factory of existing smart wearable devices rely on manual operations and are prone to operational errors, resulting in low accuracy of test results, and expanding new test projects takes time and is complex.
It provides an automated detection method, selects target test instructions from pre-stored test instructions through test tools, communicates with the tested device based on wireless connection, realizes automated testing, reduces manual operation errors, and simplifies the expansion of new test projects.
Improve the accuracy of test results, reduce labor costs and test complexity, simplify the expansion process of new test projects, and only adjust the test instructions based on rules.
Smart Images

Figure CN112084076B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of testing, and in particular to a testing method, an electronic device and a storage medium. Background Art
[0002] At present, with the continuous development of smart wearable devices, there are more and more types of smart wearable devices, such as smart watches, smart bracelets, etc., which not only meet the needs of accessories, but also meet the needs of users for functions; therefore, the performance testing of smart wearable devices before leaving the factory has also become an important development direction at this stage. In the prior art, the performance testing method for smart wearable devices before leaving the factory is: manually operate the user interface of the smart wearable device, so as to select test items and test them one by one, and cooperate with the performance testing process of the smart wearable device.
[0003] The inventors have discovered that there are at least the following problems in the prior art: since the testing process needs to be manually operated, operational errors are prone to occur during the manual operation, resulting in low accuracy of the test results. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a testing method, an electronic device and a storage medium, and to provide an automated detection method, thereby improving the accuracy of the test results.
[0005] To solve the above technical problems, an embodiment of the present invention provides a testing method, which is applied to a testing device in a testing system; the testing device is communicatively connected with a device under test; the testing method comprises: selecting a target test instruction from a plurality of pre-stored test instructions through a testing tool, wherein the plurality of test instructions are generated by the testing tool according to the test requirements of the test items of the device under test; and sending the target test instruction to the device under test through the testing tool, so that the device under test performs a test based on the target test instruction.
[0006] An embodiment of the present invention also provides a testing method, which is applied to a device under test in a testing system; the device under test is communicatively connected to a detection device; the testing method comprises: receiving a target test instruction sent by the detection device through a testing tool; the target test instruction is selected by the testing tool from a plurality of pre-stored test instructions, and the plurality of test instructions are generated by the testing tool according to the test requirements of the test items of the device under test; and testing is performed based on the target test instruction.
[0007] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to perform the above-mentioned test method.
[0008] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, wherein the computer program implements the above-mentioned testing method when executed by a processor.
[0009] Compared with the prior art, the embodiment of the present invention has a test tool for the detection device storing a plurality of test instructions. When a certain test needs to be performed, a plurality of test instructions can be stored in the test tool to select a target test instruction. The device under test can be tested based on the target test instruction, thereby realizing automated testing of the device under test and improving the accuracy of the test results, thereby avoiding the problem of low accuracy of the test results of manual detection caused by errors in manual operation in the prior art. In addition, since the test process in the prior art is complicated and requires manual cooperation to implement the test, when expanding new test items, it is also necessary to manually learn new test steps and cooperate to implement them. Therefore, the prior art takes a long time to expand new test items by means of manual assisted testing; while the automated testing of the present application reduces the labor cost and the complexity of the test process, and the new test items only need to adjust the test instructions based on the rules, which is convenient for expanding new test items. In addition, the connection method between the device under test and the detection device is: wireless connection.
[0010] In addition, the process of the detection device communicating with the device under test is: detecting wireless connection signals sent by multiple devices under test; and establishing a wireless communication connection with the device under test corresponding to the wireless connection signal with the strongest signal.
[0011] In addition, after sending the test instruction to the device under test, it also includes: detecting that the wireless connection signal of the currently connected device under test becomes weaker and the wireless connection signal of another device under test becomes stronger; cutting off the wireless communication connection with the currently connected device under test, and establishing a wireless communication connection with the other device under test. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0013] Figure 1 is a flow chart of a testing method according to the first embodiment of the present application;
[0014] Figure 2 is a flow chart of a testing method according to a second embodiment of the present application;
[0015] Figure 3 It is a schematic structural diagram of an electronic device according to the third embodiment of the present application. DETAILED DESCRIPTION
[0016] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.
[0017] The first embodiment of the present invention relates to a testing method, the specific process is as follows Figure 1 As shown, the following steps are included:
[0018] Step 101: Select a target test instruction from a plurality of pre-stored test instructions through a test tool.
[0019] Specifically, the present embodiment is applied to a detection device in a test system; the test system includes a detection device and a device under test, wherein the detection device and the device under test are in communication connection.
[0020] Specifically, multiple test instructions are generated by the test tool according to the test requirements of the test items of the device under test. Before the test, the detection device will generate multiple test instructions through the test tool. The test instructions are generated according to the test requirements of the test items of the device under test and can cover all the test items of the device under test. In actual applications, the detection device can also continue to generate new test instructions according to actual detection requirements.
[0021] Specifically, the test instruction is generated according to the specification of the instruction protocol. The instruction protocol can unify the data represented by the test instruction. Therefore, all test instructions can be divided into three parts, namely, the standard header, data, and standard tail. The standard header can be divided into seven parts, namely, TagID, frame header (Start Of Frame, SOF), valid data length (Length, LEN), control field (Control, CTL), multi-frame number (Number Of Frame, NOF), business ID (Business ID, BID), command ID (Command, CID), among which TagID, SOF, CTL are composed of one byte, LEN, NOF, BC are composed of two bytes; data includes payload (Payload), Payload is composed of multiple bytes; standard tail includes cyclic redundancy check (Cyclic Redundancy Check, CRC), CRC is composed of two bytes.
[0022] Among them, TagID is the category identifier, which can be used to indicate which test chip of the device under test this test instruction needs to be sent to; LEN represents the length of the valid data of the test instruction, including the length of CTL, NOF, BID, CID and Payload, which can help parse the BID, CID and Payload of the data instruction, and provide a basis for the subsequent device under test to execute the target test instruction.
[0023] In actual applications, the detection device can be a computer or mobile phone, and the device under test can be a smart wearable device, such as a smart bracelet, smart watch, etc. The test tool is an application on the computer or mobile phone. After the detection device establishes a communication connection with the device under test, it sends the selected target test instruction through the test tool (i.e., application); the application on the mobile phone can be watchtester.
[0024] Step 102: Send the target test instruction to the device under test through the test tool, so that the device under test performs the test based on the target test instruction.
[0025] In actual applications, there will be multiple devices under test in the detection system. The detection device is placed in a fixed position, and multiple devices under test are placed on the test assembly line. The detection device needs to establish a connection with each device under test and perform detection. When one of the devices under test reaches an area where it can communicate with the detection device, the detection device establishes a communication connection with the device under test.
[0026] In this embodiment, the connection mode between the device under test and the detection device is: wireless connection; for example, Bluetooth connection, which can adopt classic Bluetooth or low-power Bluetooth. In other embodiments, the device under test and the detection device can be connected by wire, that is, the detection device can use Universal Serial Bus (USB) to connect to the device under test.
[0027] In one example, the process of the detection device communicating with the device under test is as follows: detecting wireless connection signals sent by multiple devices under test; and establishing a wireless communication connection with the device under test corresponding to the wireless connection signal with the strongest signal. Since the detection device and the device under test are wirelessly connected, the detection device will simultaneously detect wireless connection signals sent by multiple devices under test. Therefore, in order to ensure the stability of the connection, the detection device will establish a wireless communication connection with the device under test corresponding to the wireless connection signal with the strongest signal.
[0028] Since multiple devices under test in the detection system are placed on the test assembly line, that is, the signal strength of the wireless connection signal detected by the detection device sent by the same device under test will gradually change, and the signal strength may gradually become stronger or gradually become weaker; therefore, in this embodiment, after sending the test instruction to the device under test, it also includes: detecting that the wireless connection signal of the currently connected device under test becomes weaker and the wireless connection signal of another device under test becomes stronger; cutting off the wireless communication connection with the currently connected device under test, and establishing a wireless communication connection with another device under test; in this way, the switching connection between the detection device and multiple devices under test is realized.
[0029] In one example, after the device under test is tested based on the target test instruction, the device under test generates test parameters, and then the device under test sends the test parameters to the detection device, wherein the test parameters carry the attribute information of the device under test. After the detection device receives the test parameters sent by the device under test, the detection device determines whether the test parameters are abnormal, obtains the test result of whether the device under test is abnormal, and binds the attribute information of the device under test with the test result, and stores the test result in the detection device, so that the user can find the corresponding detection result according to the attribute information of the device under test.
[0030] Specifically, the detection device may be set with a preset parameter. After receiving the test parameter sent by the device under test, the detection device matches the test parameter with the preset parameter to obtain a test result of whether the device under test is abnormal.
[0031] It should be noted that only when the target test instruction is executed in the current device under test and the detection device has obtained the detection result of the current device under test, and the detection device detects that the wireless connection signal of the currently connected device under test becomes weaker and the wireless connection signal of the other device under test becomes stronger, will it cut off the connection with the currently connected device under test and establish a wireless communication connection with the other device under test.
[0032] In this embodiment, a plurality of test instructions are stored in the test tool of the detection device. When a certain test needs to be performed, a target test instruction can be selected from the plurality of test instructions stored in the test tool. The device under test can be tested based on the target test instruction, thereby realizing automated testing of the device under test and improving the accuracy of the test results, thereby avoiding the problem of low accuracy of the test results of manual detection due to errors in manual operation in the prior art. In addition, since the test process in the prior art is complicated and requires manual cooperation to implement the test, when expanding new test items, it is also necessary to manually learn new test steps and cooperate to implement them. Therefore, the prior art takes a long time to expand new test items through manual assisted testing; while the automated testing of the present application reduces labor costs and the complexity of the test process, and new test items only need to adjust the test instructions based on rules, which is convenient for expanding new test items.
[0033] The second embodiment of the present invention relates to a testing method, the specific process is as follows Figure 2 As shown, the following steps are included:
[0034] Step 201: receiving a target test instruction sent by a detection device through a test tool.
[0035] Specifically, the target test instruction is selected by the test tool from a plurality of pre-stored test instructions, and the plurality of test instructions are generated by the test tool according to the test requirements of the test items of the device under test.
[0036] Specifically, this embodiment is applied to a device under test in a test system. The test system includes a detection device and a device under test. The device under test is communicatively connected with the detection device.
[0037] Step 202: Perform testing based on the target test instruction.
[0038] Specifically, after the device under test receives the target test instruction sent by the detection device, it will perform detection based on the target test instruction.
[0039] In one example, testing based on a target test instruction includes: parsing the target test instruction to obtain a target test interface and test parameters; and calling the target test interface to run the test parameters. Specifically, since the test instruction is generated according to the specification of the instruction protocol, parsing the target test instruction also needs to be parsed according to the specification of the instruction protocol.
[0040] In actual applications, the standard tail of the target test instruction includes CRC. When the device under test receives the target test instruction sent by the detection device, it will parse the target test instruction to obtain CRC, and then verify whether the target test instruction is legal based on CRC; only after the target test instruction is verified to be legal, the target test interface corresponding to the target test instruction will be determined.
[0041] In one example, a test instruction consists of three parts: a standard header, data, and a standard tail. Therefore, a target test instruction also includes a standard header, data, and a standard tail. Among them, parsing the target test instruction to obtain a target test interface and parameters to be tested may include the following steps: determining the target test interface according to the standard header of the target test instruction; then, determining the parameters to be tested according to the data of the target test instruction.
[0042] In an example, the standard header of the test instruction includes a category identifier TagID, a service identifier BID, and a command identifier CID; determining the target test interface according to the standard header of the target test instruction may include the following steps: first, determining the target test chip according to the category identifier TagID of the target test instruction; then, determining the target test module in the target test chip according to the service identifier BID of the target test instruction; finally, determining the target test interface in the target test module according to the command identifier CID of the target test instruction.
[0043] In one example, after the device under test is tested based on the target test instructions, the device under test generates test parameters. Afterwards, the device under test can also determine whether the test parameters are abnormal, obtain a test result of whether the device under test is abnormal, and bind the attribute information of the device under test to the test result, and send the test result to the detection device for the detection device to store the test result, so that the user can find the corresponding detection result according to the attribute information of the device under test.
[0044] It is not difficult to find that this embodiment is a method embodiment corresponding to the first embodiment, and this embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the first embodiment.
[0045] The step division of the above methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.
[0046] A third embodiment of the present invention relates to an electronic device, such as Figure 3 As shown, it includes at least one processor 301; and a memory 302 that is communicatively connected to the at least one processor 301; wherein the memory 302 stores instructions that can be executed by the at least one processor 301, and the instructions are executed by the at least one processor 301 so that the at least one processor 301 can execute the above-mentioned test method.
[0047] The memory 302 and the processor 301 are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors 301 and the memory 302 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor 301 is transmitted on a wireless medium through an antenna, and further, the antenna also receives data and transmits the data to the processor 301.
[0048] The processor 301 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 302 can be used to store data used by the processor 301 when performing operations.
[0049] A fourth embodiment of the present invention relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0050] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0051] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present invention, and that in actual applications, various changes may be made in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A testing method, characterized in that: A detection device used in a test system; the detection device is connected to the device under test by wireless communication; The device under test is a smart wearable device; the testing method comprises: A target test instruction is selected from a plurality of pre-stored test instructions by a test tool, wherein the plurality of test instructions are generated by the test tool according to the test requirements of the test items of the device under test; the target test instruction also includes a standard header, data, and a standard tail; the standard header of the target test instruction includes a category identifier TagID, a service identifier BID, and a command identifier CID; the standard tail of the target test instruction includes a cyclic redundancy check CRC; Sending the target test instruction to the device under test through a test tool, so that the device under test performs a test based on the target test instruction; Among them, the test of the device under test based on the target test instruction includes: parsing the target test instruction, verifying whether the target test instruction is legal according to the cyclic redundancy check CRC of the target test instruction; after verifying that the target test instruction is legal, determining the target test chip according to the category identifier TagID of the target test instruction; determining the target test module in the target test chip according to the business identifier BID of the target test instruction; determining the target test interface in the target test module according to the command identifier CID of the target test instruction; determining the parameters to be tested according to the data of the target test instruction; calling the target test interface to run the parameters to be tested; After the device under test is tested based on the target test instruction, the device under test generates test parameters, and the device under test sends the test parameters to the detection device, wherein the test parameters carry attribute information of the device under test; after the detection device receives the test parameters sent by the device under test, the detection device determines whether the test parameters are abnormal, obtains a test result of whether the device under test is abnormal, and binds the attribute information of the device under test to the test result, and stores the test result in the detection device; Alternatively, after the device under test is tested based on the target test instruction, the device under test generates test parameters, the device under test determines whether the test parameters are abnormal, obtains a test result of whether the device under test is abnormal, and binds the attribute information of the device under test to the test result, and sends the test result to the detection device for the detection device to store the test result.
2. The testing method according to claim 1, characterized in that: The process of communication connection between the detection device and the device under test is as follows: Detecting wireless connection signals sent by a plurality of the devices under test; A wireless communication connection is established with the device under test corresponding to the wireless connection signal with the strongest signal.
3. The testing method according to claim 1 or 2, characterized in that: After sending the test instruction to the device under test, the method further includes: It is detected that the wireless connection signal of the currently connected device under test becomes weaker and the wireless connection signal of another device under test becomes stronger; The wireless communication connection with the currently connected device under test is cut off, and a wireless communication connection with the other device under test is established.
4. A testing method, characterized in that: A device under test used in a test system; the device under test is connected to a detection device by wireless communication; the device under test is a smart wearable device; the test method comprises: Receive a target test instruction sent by the detection device through a test tool; the target test instruction is selected by the test tool from a plurality of pre-stored test instructions, and the plurality of test instructions are generated by the test tool according to the test requirements of the test items of the device under test; the target test instruction also includes a standard header, data, and a standard tail; the standard header of the target test instruction includes a category identifier TagID, a service identifier BID, and a command identifier CID; the standard tail of the target test instruction includes a cyclic redundancy check CRC; Performing testing based on the target test instruction; The testing based on the target test instruction includes: Parse the target test instruction, and verify whether the target test instruction is legal according to the cyclic redundancy check CRC of the target test instruction; after verifying that the target test instruction is legal, determine the target test chip according to the category identifier TagID of the target test instruction; determine the target test module in the target test chip according to the business identifier BID of the target test instruction; determine the target test interface in the target test module according to the command identifier CID of the target test instruction; determine the parameters to be tested according to the data of the target test instruction; call the target test interface to run the parameters to be tested; After the device under test is tested based on the target test instruction, the device under test generates test parameters, and the device under test sends the test parameters to the detection device, wherein the test parameters carry attribute information of the device under test; after the detection device receives the test parameters sent by the device under test, the detection device determines whether the test parameters are abnormal, obtains a test result of whether the device under test is abnormal, and binds the attribute information of the device under test to the test result, and stores the test result in the detection device; Alternatively, after the device under test is tested based on the target test instruction, the device under test generates test parameters, the device under test determines whether the test parameters are abnormal, obtains a test result of whether the device under test is abnormal, and binds the attribute information of the device under test to the test result, and sends the test result to the detection device for the detection device to store the test result.
5. An electronic device, characterized in that: include: 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, and the instructions are executed by the at least one processor so that the at least one processor can execute the test method as described in any one of claims 1 to 3, or execute the test method as described in claim 4.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the test method according to any one of claims 1 to 3 is implemented, or the test method according to claim 4 is implemented.
