Equipment testing method, device, storage medium and computer equipment

By responding to the signal of the device to be tested and using the pre-built test function library to automatically perform the test, the problem of low device testing efficiency and low accuracy in the existing technology is solved, and efficient and accurate device testing is achieved.

CN116860630BActive Publication Date: 2024-09-20ZHUHAI SHIXI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310820462.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-05
Publication Date
2024-09-20
Estimated Expiration
2043-07-05

AI Technical Summary

Technical Problem

Existing equipment testing methods are inefficient and inaccurate, mainly due to the need to write test code for each test item and the uneven technical level of staff, resulting in frequent writing errors.

Method used

By responding to the test signal of the device under test, the device type is determined, and the corresponding test function library (such as the Android test function library or component test function library) is used to automatically perform the test, avoiding manual writing of test code and directly calling the pre-built test function. test.

Benefits of technology

It improves the efficiency and accuracy of equipment testing, reduces the possibility of writing errors, and simplifies the testing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116860630B
    Figure CN116860630B
Patent Text Reader

Abstract

The present invention discloses a device testing method, apparatus, storage medium and computer equipment, which relate to the field of device testing, and mainly focus on improving the testing efficiency and accuracy of the device. The method includes: in response to the test signal of the device to be tested, determining the device type to which the device to be tested belongs; if the device type is an Android device, then using the Android test function library corresponding to the Android device to test various Android test items in the Android device, and obtaining the test results corresponding to the Android device; if the device to be tested is a component, then using the component test function library corresponding to the component to test various component test items in the component, and obtaining the test results corresponding to the component. The present invention is used in device testing scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of equipment testing, and in particular to an equipment testing method, device, storage medium and computer equipment. Background Art

[0002] In order to ensure the stable operation of the equipment, the equipment needs to be tested after development is completed.

[0003] At present, the equipment is usually tested by writing test codes. However, the equipment contains multiple test items. In this test method, a set of test codes needs to be written for each test item, resulting in low equipment testing efficiency. At the same time, due to the uneven technical level of the staff, errors in test code writing may occur, resulting in low equipment testing accuracy. Summary of the invention

[0004] The present invention provides a device testing method, apparatus, storage medium and computer equipment, which are mainly capable of improving the testing efficiency and testing accuracy of the device.

[0005] According to a first aspect of the present invention, there is provided a device testing method, comprising:

[0006] In response to a test signal of the device to be tested, determining a device type to which the device to be tested belongs;

[0007] If the device type is an Android device, then various Android test items in the Android device are tested using an Android test function library corresponding to the Android device to obtain a test result corresponding to the Android device;

[0008] If the device to be tested is a component, various component test items in the component are tested using a component test function library corresponding to the component to obtain a test result corresponding to the component.

[0009] According to a second aspect of the present invention, there is provided a device testing apparatus, comprising:

[0010] A determination unit, configured to determine a device type to which the device to be tested belongs in response to a test signal of the device to be tested;

[0011] An Android test unit, for testing various Android test items in the Android device using an Android test function library corresponding to the Android device to obtain a test result corresponding to the Android device if the device type is an Android device;

[0012] The component testing unit is used to test various component testing items in the component by using the component testing function library corresponding to the component if the device to be tested is a component, so as to obtain the test result corresponding to the component.

[0013] According to a third aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, which implements the above device testing method when executed by a processor.

[0014] According to a fourth aspect of the present invention, there is provided a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above device testing method when executing the program.

[0015] According to a device testing method, apparatus, storage medium and computer device provided by the present invention, compared with the current method of writing a test code for each test, the present invention determines the device type of the device to be tested by responding to the test signal of the device to be tested; if the device type is an Android device, the various Android test items in the Android device are tested using the Android test function library corresponding to the Android device to obtain the test result corresponding to the Android device; if the device to be tested is a component, the various component test items in the component are tested using the component test function library corresponding to the component to obtain the test result corresponding to the component, thereby constructing an Android test function library corresponding to the Android device to obtain the test result corresponding to the component. And the component test function library corresponding to the component, the Android test function library covers test functions for testing various common test items in various Android devices, the component test function library covers test functions for testing various common test items of various components, when the Android device is to be tested, the test function in the Android test function library is directly called to test the Android device, and when the component is to be tested, the test function in the component test function library is directly called to test the component, thereby avoiding the time wasted by the staff in pre-writing the test code, so that the present invention can improve the testing efficiency of the equipment, and at the same time, it can also avoid the situation where the staff writes the test code incorrectly, so that the present invention can improve the testing accuracy of the equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0017] Figure 1 A flow chart of a device testing method provided by an embodiment of the present invention is shown;

[0018] Figure 2Another device testing method flow chart provided by an embodiment of the present invention is shown;

[0019] Figure 3 A schematic diagram of the structure of a device testing apparatus provided by an embodiment of the present invention is shown;

[0020] Figure 4 A schematic diagram showing the structure of another device testing apparatus provided by an embodiment of the present invention is shown;

[0021] Figure 5 A schematic diagram of the physical structure of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0022] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0023] It should be noted that the device testing method provided in this application can be applied to terminals. For example, the terminal can be various large tablets for commercial use, mobile phones or computers, ordinary consumer tablets, smart TVs, portable computer terminals, or fixed terminals such as desktop computers.

[0024] The embodiments of the present application can be applied to computer systems / servers, which can operate with many other general or special computing system environments or configurations. Examples of well-known computing systems, environments and / or configurations suitable for use with computer systems / servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.

[0025] Computer systems / servers may be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. In general, program modules may include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers may be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules may be located on local or remote computing system storage media including storage devices.

[0026] At present, the method of testing equipment by writing test codes results in low equipment testing efficiency. At the same time, due to the uneven technical levels of the staff, the equipment testing accuracy is low.

[0027] In order to solve the above problems, an embodiment of the present invention provides a device testing method, such as Figure 1 As shown, the method includes:

[0028] 101. In response to a test signal of a device to be tested, determine a device type to which the device to be tested belongs.

[0029] For the embodiment of the present invention, the test signal carries the device identification of the device to be tested. Different devices have their corresponding unique identification. Through the device identification, the device type of the device to be tested can be determined, where the device type may include Android devices and components. Android devices include mobile phones, tablet computers, large video conferencing screens and other devices. Components may be independent cameras, camera modules in the whole machine, system components and other devices including component functions.

[0030] 102. If the device type is an Android device, various Android test items in the Android device are tested using an Android test function library corresponding to the Android device to obtain a test result corresponding to the Android device.

[0031] Among them, the Android test function library stores test functions for testing various test items in various Android devices; various test items in Android devices include: flashing test, power on and off test and basic function test, basic function test includes: Android device's wifi function, Bluetooth function, screenshot function, unlock function, sleep function, installation package installation function and other tests.

[0032] For the embodiment of the present invention, after determining the device type to which the device to be tested belongs, if the device to be tested is an Android device, the test function library corresponding to the Android device is determined in the test configuration table, and the Android test function library corresponding to the Android device is obtained in the database, and then the test functions corresponding to various Android test items are determined in the Android test function library, and the test functions are used to automatically test various test items in the Android device. Thus, by testing the Android device through various test functions in the Android test function library, the time wasted in manually writing test codes can be avoided, so that the embodiment of the present invention can improve the test efficiency of the Android device, and at the same time, it can also avoid the situation where the staff writes the test code incorrectly, so that the embodiment of the present invention can improve the test accuracy of the Android device.

[0033] 103. If the device to be tested is a component, various component test items in the component are tested using a component test function library corresponding to the component to obtain a test result corresponding to the component.

[0034] Among them, if the component is an independent camera, the various test items include: independent camera power on and off function test, independent camera hardware interface function test, and independent camera serial port communication function test.

[0035] For the embodiment of the present invention, after determining the device type to which the device to be tested belongs, if the device to be tested is a component, the component test function library corresponding to the component is determined in the test configuration table, and the component test function library corresponding to the component is obtained in the database, and then the test functions corresponding to various component test items are determined in the component test function library, and the various test items in the component are automatically tested using the test function. Thus, by testing the component through various test functions in the component test function library, the time wasted in manually writing test codes can be avoided, so that the embodiment of the present invention can improve the testing efficiency of the component, and at the same time, it can also avoid the situation where the staff writes the test code incorrectly, so that the embodiment of the present invention can improve the testing accuracy of the component.

[0036] According to a device testing method provided by the present invention, compared with the current method of writing a test code for each test, the present invention determines the device type of the device to be tested by responding to the test signal of the device to be tested; if the device type is an Android device, the various test items in the Android device are tested using the Android test function library corresponding to the Android device to obtain the test results corresponding to the Android device; if the device to be tested is a component, the various test items in the component are tested using the component test function library corresponding to the component to obtain the test results corresponding to the component, thereby constructing an Android test function library corresponding to the Android device and a component test function library corresponding to the component. A test function library, the Android test function library covers test functions for testing various test items in various Android devices, and the component test function library covers test functions for testing various test items in various components. When an Android device is to be tested, the test function in the Android test function library is directly called to test the Android device; when a component is to be tested, the test function in the component test function library is directly called to test the component, thereby avoiding the time wasted by the staff in pre-writing the test code, so that the present invention can improve the testing efficiency of the device, and at the same time, it can also avoid the situation where the staff writes the test code incorrectly, so that the present invention can improve the testing accuracy of the device.

[0037] Further, in order to better illustrate the process of testing the device, as a refinement and extension of the above embodiment, the embodiment of the present invention provides another device testing method, such as Figure 2 As shown, the method includes:

[0038] 201. In response to a test signal of a device to be tested, determine a device type to which the device to be tested belongs.

[0039] Specifically, when the server receives the test signal of the device to be tested, it parses the device identification carried in the test signal, and determines the device type of the device to be tested based on the device identification. Finally, the device to be tested is tested using the test method corresponding to the device type. The embodiment of the present invention can improve the testing accuracy of the device by determining different test methods for different device types.

[0040] 202. If the device type is an Android device, determine a flashing test function, a power on / off test function, and a basic function test function in an Android test function library.

[0041] Among them, the Android test function library includes Android test functions for testing common functions of various Android devices.

[0042] For an embodiment of the present invention, before using an Android test function library to test an Android device, it is first necessary to build an Android test function library. Based on this, the method includes: encapsulating each group of common test logic codes corresponding to different Android devices to obtain each group of Android test functions corresponding to the different Android devices; and storing each group of Android test functions in the Android test function library.

[0043] Specifically, it is necessary to encapsulate each group of test logic codes corresponding to different Android devices first. Specifically, different languages ​​can be used to encapsulate each group of test logic codes. The language that is convenient to use can be used for encapsulation. The embodiment of the present invention does not specifically limit the encapsulation language. For example, JAVA, C++, Python and other languages ​​can be used to encapsulate each group of test logic codes corresponding to different Android devices, and each group of Android test functions corresponding to different Android devices can be obtained. Then, each group of Android test functions is put into the Android test function library. In this way, by encapsulating the test functions for testing the common functions of various Android devices, if various Android devices are to be tested later, the encapsulated test functions can be directly called to test the Android devices, avoiding the time wasted or writing errors caused by the staff needing to rewrite the test code for the tests of different Android devices. Therefore, the embodiment of the present invention can improve the testing efficiency and accuracy of Android devices.

[0044] Among them, the Android test function library stores various test functions for testing Android devices. In order to test Android devices, it is first necessary to determine the various test items in the Android device, and then obtain the test functions corresponding to the various test items in the Android test function library according to the various test items of the Android device. If the various test items of the Android device are: flashing test, power on and off test, and basic function test, then for the system flashing test item, obtain the flashing test function in the Android test function library, for the power on and off test item, obtain the power on and off test function in the Android test function library, and for the basic function test, obtain the basic function test function in the Android test function library, and then use the above-mentioned various test functions to test the corresponding test items. Therefore, by directly calling various test functions in the test function library to test various test items in the Android device, the testing efficiency and accuracy of the Android device can be improved.

[0045] 203. Use the flashing test function to test the system flashing function of the Android device to obtain the flashing test result corresponding to the Android device.

[0046] For the embodiment of the present invention, if the system flashing function of the Android device is to be tested, it is necessary to call the flashing test function in the Android test function library to test the system flashing function of the Android device. Based on this, step 203 specifically includes: obtaining a first flashing firmware with a first version number and a second flashing firmware with a second version number; determining whether the first version number is consistent with the pre-flashing version number of the Android device; if the first version number is consistent with the pre-flashing version number, flashing the Android device with the second flashing firmware to obtain the first flashed Android device; determining the first post-flashing version number corresponding to the first flashed Android device, if the first post-flashing version number is consistent with the second If the first version number after flashing is inconsistent with the second version number, it is determined that the system flashing function of the Android device is normal; if the first version number after flashing is inconsistent with the second version number, it is determined that the system flashing function of the Android device is abnormal. At the same time, if the first version number is inconsistent with the version number before flashing, the Android device is flashed with the first flashing firmware to obtain the second Android device after flashing; determine the second post-flashing version number corresponding to the second Android device after flashing, if the second post-flashing version number is consistent with the first version number, it is determined that the system flashing function of the Android device is normal; if the second post-flashing version number is inconsistent with the first version number, it is determined that the system flashing function of the Android device is abnormal.

[0047] Specifically, two versions of flashing firmware are prepared, namely, flashing firmware A with a first version number and flashing firmware B with a second version number. The serial number of the Android device connected to the test server is obtained, and the corresponding Fastboot (a lower-level flashing mode) number is read, written and stored. Each time, the serial number of the device can be guaranteed to correspond to the Fastboot number one by one. The version number of the Android device before flashing is obtained. If the version number before flashing is consistent with the version number of A, firmware B is flashed. If not, firmware A is flashed. After the flashing is completed, the corresponding version of the Android device after flashing is obtained. If the version number after flashing is consistent with the version number of the firmware flashed in, the flashing function is normal; if the version number after flashing is inconsistent with the version number of the firmware flashed in, the flashing function is abnormal; at the same time, the flashing log information and the flashing process information are recorded in the background, and firmware A and firmware B are continuously cycled to flash the Android device until the number of flashing times reaches a preset number; if the number of normal flashing functions during multiple flashing processes is greater than a preset threshold, it is determined that the system flashing function of the Android device is normal; if the number of normal flashing functions during multiple flashing processes is less than or equal to the preset threshold, it is determined that the system flashing function of the Android device is abnormal.

[0048] 204. Use the power on and off test function to test the power on and off function of the Android device, and obtain a power on and off test result corresponding to the Android device.

[0049] For the embodiment of the present invention, if the power on and off function of the Android device is to be tested, it is necessary to call the power on and off test function in the Android test function library to test the power on and off function of the Android device. Based on this, step 204 specifically includes: establishing a connection between the Android device and the programmable relay; receiving a power supply signal from the programmable relay to power the Android device; after receiving the power supply signal for a preset time, determining whether a prompt message of successful power on of the Android device is received; if the prompt message of successful power on is received, determining that the power on function of the Android device is normal; if the prompt message of successful power on is not received, determining that the power on function of the Android device is abnormal; after receiving the prompt message of successful power on, in response to the power off signal from the programmable relay to the Android device, determining whether a prompt message of successful shutdown of the Android device is received; if the prompt message of successful shutdown is received, determining that the shutdown function of the Android device is normal; if the prompt message of successful shutdown is not received, determining that the shutdown function of the Android device is abnormal.

[0050] Specifically, prepare the programmable relay and Android device, connect the power switch and power line of the Android device to the programmable relay through an external connection, wherein the power switch of the Android device can simulate the pressing and releasing operation by short-circuiting, thereby realizing the power on and off operation of the Android device, the power line is connected to the relay to control the power on and off operation of the Android device through programmable control, the programmable relay controls the power supply of the Android device, and the serial port of the power switch of the Android device needs to correspond to the serial number of the Android device, when the programmable relay power switch is closed, the Android device is powered on, after the programmable relay power switch is closed for a preset time, simulate the Android device to long press the power button to start, at this time check the device startup completion mark information (after the device is fully powered on, through the command "adb shell dumpsys window|grep mCurrentFocus" can get the page where the Android device is currently located, and determine whether the prompt message "com.android.launcher3" of successful startup is displayed in the current page. If the prompt message of successful startup is displayed, it is determined that the Android device has been successfully started. In this test process, it can be determined that the startup function of the Android device is normal. After the Android device is successfully started, the program-controlled relay power supply switch is disconnected, that is, the power supply to the Android device is disconnected. At this time, if the prompt message of successful shutdown of the Android device is received, it is determined that the shutdown function of the Android device is normal during the test. The power on and off function of the Android device is tested in a continuous cycle according to the above method. If the startup function is normal during the test, If the number of normal tests is greater than the preset number, the Android device is ultimately judged to have a normal power-on function. If the number of normal power-on tests is less than or equal to the preset number, the Android device is ultimately judged to have an abnormal power-on function. If the number of normal power-off tests during the test is greater than the preset threshold, the Android device is ultimately judged to have a normal power-off function. If the number of normal power-off tests during the test is less than or equal to the preset threshold, the Android device is ultimately judged to have an abnormal power-off function. Thus, by using a programmable relay to test the power-on and power-off function of an Android device, the Android device can simulate the pressing and releasing operations by short-circuiting, thereby realizing automatic power-on and power-off control in the simplest way, thereby improving the convenience and efficiency of the test.

[0051] 205. Use the basic function test function to test various basic functions of the Android device to obtain test results of various basic functions corresponding to the Android device.

[0052] Among them, the basic functions include: the launch function of each APP in the Android device, the WiFi function, Bluetooth function, screenshot function, unlocking function, sleep function, installation function of the installation package, etc.

[0053] For the embodiment of the present invention, if the startup function of each APP in the Android device is to be tested, it is necessary to call the basic function test function in the Android test function library to test the startup function of each APP. Based on this, step 205 specifically includes: obtaining the center point coordinates of each APP icon on the Android device; in response to a click operation on the center point coordinates, recording a first time point corresponding to the click operation; after the click operation on the center point coordinates, recording a second time point corresponding to each APP after it is fully started; subtracting the second time point from the first time point to obtain the startup time corresponding to each APP; judging whether each startup time is less than a preset time threshold; if each startup time is less than the preset time threshold, judging that the startup of each APP in the Android device is normal; if each startup time is greater than or equal to the preset time threshold, judging that the startup of each APP in the Android device is abnormal.

[0054] Among them, the preset time threshold is data set according to actual needs. Specifically, first determine whether there are unauthorized APPs in each APP. If there are unauthorized APPs, then authorize the unauthorized APPs, list various APPs in the main interface of the Android device, and do not know the cache of each APP. Then determine the center point coordinates of each APP icon on the Android device interface, and then test the server to control the click operation on the center point coordinates, record the first time point of the click operation, and after clicking the center point coordinates, each APP starts to start. After each APP is started, record the second time point when each APP is started, and determine the difference between the second time point and the first time point as the corresponding startup time of each APP. If the startup time of an APP is less than the preset time threshold, it is determined that the startup function of the APP is normal. If the startup time of an APP is greater than or equal to the preset time threshold, it is determined that the startup function of the APP is abnormal.

[0055] Furthermore, you can also test whether the Bluetooth function of the Android device is normal by turning on and off Bluetooth, and test whether the WiFi function of the Android device is normal by turning on and off WiFi; control the Android device to take a screenshot of the target page to obtain a test image captured by the Android device, and then compare the actual hash value corresponding to the target page with the test hash value corresponding to the test image. If the hash values ​​corresponding to the two are the same, it is determined that the screenshot function of the Android device is normal. If the hash values ​​between the two are different, it is determined that the screenshot function of the Android device is abnormal. At the same time, the non-sleep screen-off function, unlock wake-up function, and batch installation function of the Android device are tested.

[0056] Furthermore, it is necessary to test the serial port communication function of the Android device. Based on this, the method includes: determining a serial port communication test function library corresponding to the Android device; using the test function in the serial port communication test function library to test the serial port communication function of the Android device, and obtaining the serial port communication test result corresponding to the Android device.

[0057] Among them, the test items of serial communication include: data transmission integrity test, data transmission time test, data transmission form test, etc.

[0058] Specifically, each group of test codes for testing serial port communication can be pre-packaged to obtain each group of serial port communication test functions, and then each group of test functions can be stored in a serial port communication test function library. When the serial port communication function of an Android device is to be tested, the corresponding test function can be obtained from the serial port communication test function library, and finally the serial port communication function can be tested using the test function. Thus, by packaging the serial port communication test code, the next time the serial port communication function is tested, the test function can be directly obtained from the test function library, thereby avoiding the time wasted in manually writing test codes or writing errors, so that the embodiments of the present invention can improve the testing efficiency and accuracy of serial port communications.

[0059] Furthermore, the hardware interface function of the Android device can also be tested. Specifically, the hardware interfaces of different Android devices can be connected to the program-controlled relays, and the power-on function of the hardware interface can be tested by the program-controlled relays powering on and off the hardware interface. Thus, by using the program-controlled relays to test the hardware interface function of the Android device, different switch closing and opening operations can be used to simulate the test needs in different scenarios, so that automatic control can be achieved in the simplest way, which improves the convenience and efficiency of the test.

[0060] Furthermore, there are common test items in Android devices and components. In order to test the common test items in Android devices, it is necessary to first build a common test function library. Based on this, the method includes: encapsulating the common test logic code corresponding to the Android devices and components, and obtaining each group of common test functions corresponding to the Android devices and components; storing the each group of common test functions in the common test function library corresponding to the Android devices and components.

[0061] Specifically, it is necessary to first encapsulate each group of common function test logic codes corresponding to the Android devices and components. Specifically, different languages ​​can be used to encapsulate each group of common function test logic codes. The language that is convenient to use can be used for encapsulation. The embodiment of the present invention does not specifically limit the encapsulation language. For example, JAVA, C++, Python and other languages ​​can be used to encapsulate each group of common function test logic codes corresponding to the Android devices and components to obtain each group of common function test functions, and then each group of common function test functions is stored in the common test function library. Thus, by encapsulating the test functions for testing the common functions of various Android devices and various components, if the common functions of various Android devices and components are to be tested later, the encapsulated test functions can be directly called to test the common functions, thereby avoiding the time wasted or the writing errors caused by the staff needing to rewrite the test code for the tests of the common functions in different Android devices and different components. Therefore, the embodiment of the present invention can improve the testing efficiency and accuracy of Android devices.

[0062] Furthermore, after building the universal test function library, the test functions in the universal test function library can be used to test the Android device. Based on this, the method includes: using the universal test function library corresponding to the Android device and the component to test the universal test items in the Android device, and obtaining the universal test results corresponding to the Android device.

[0063] Among them, the universal test function library includes universal test functions for performing the same function tests on Android devices and components. The universal test items in Android devices include the shooting function test of Android devices. Before testing the shooting function of Android devices, it is first necessary to install a camera module on the Android device. Based on this, the method includes: determining the Android ID corresponding to the Android device; based on the Android ID, unlocking the Android device, and installing the installation package corresponding to the camera function plug-in on the unlocked Android device; running the installation package to obtain the camera function plug-in installed on the Android device.

[0064] Specifically, the method for testing the camera function of an Android device includes: determining a camera function test function in the general test function library; using the camera function test function to test the camera function of the Android device, and obtaining a camera function test result corresponding to the Android device. Specifically, the method for testing the camera function of an Android device using the camera function test function includes: taking a picture of a first reference object using a camera with a normal shooting function to obtain a first actual picture corresponding to the first reference object; starting the camera function of the Android device to take a picture of the first reference object to obtain a first test picture corresponding to the first reference object; calculating a first actual hash value corresponding to the first actual image, and a first test hash value corresponding to the first test picture; determining whether the first test hash value is equal to the first actual hash value; if the first test hash value is equal to the first actual hash value, determining that the camera function of the Android device is normal.

[0065] Among them, the Android logo can be a character logo or an icon logo. As long as the Android device can be uniquely identified by the Android logo, the embodiment of the present invention does not specifically limit the form of the Android logo; the reference object can be any object, such as an animal, a plant, etc.

[0066] Specifically, obtain the serial number of the Android device connected to the test server, create a control object for the Android device, control the Android device to unlock the screen, and when the Android device screen is unlocked, install the apk (installation package) corresponding to the camera function plug-in on the Android device, and authorize the installation package to run, so that the camera function plug-in can be installed on the Android device.

[0067] Furthermore, after installing the apk on the Android device and running it, it is necessary to call the camera function test function in the general test function library to test the camera function of the Android device. The specific test method is that the test server controls the camera function plug-in on the Android device to start, and then controls the camera function plug-in to take a picture of the first reference object to obtain a test picture. At the same time, a camera with normal camera performance is used to take a picture of the first reference object to obtain an actual picture corresponding to the first reference object. Then, the actual hash value corresponding to the actual picture and the test hash value corresponding to the test picture are calculated. If the actual hash value is equal to the test hash value, it is determined that the shooting function of the Android device is normal during this test. If the actual hash value is not equal to the test hash value, it is determined that the shooting function of the Android device is abnormal during this test. Repeat the above test process until the number of tests reaches a preset number. If the number of normal test functions during each test is greater than a preset threshold, it is finally determined that the camera function of the Android device is normal. If the number of normal test functions during each test is less than or equal to the preset threshold, it is finally determined that the camera function of the Android device is abnormal.

[0068] Furthermore, when testing the above-mentioned various test items of the Android device, in order to obtain the test process and test results for subsequent analysis, it is necessary to record the test process and test results of the above-mentioned various test items. Based on this, the method includes: starting the log thread corresponding to the Android device; in the process of testing various test items in the Android device, calling the log thread corresponding to the Android device to store the test information of the test of the Android device.

[0069] Specifically, when the test of the Android device begins, the serial number of the Android device is obtained, a control object of the Android device is created, a log thread is started, and the log thread is called to store the log information generated by the Android device during the test for subsequent analysis. The generated log information is stored corresponding to the serial number of the Android device.

[0070] 206. If the device to be tested is a component, various component test items in the component are tested using a component test function library corresponding to the component to obtain a test result corresponding to the component.

[0071] Among them, the component test function library includes component test functions for testing the independent functions of the components. If the component is an independent camera module, the various test items include: independent camera module power-on and power-off function test, independent camera module hardware interface function test, independent camera module serial port communication function test, etc.

[0072] Specifically, because the test items corresponding to different types of devices may be different, in order to avoid test confusion, different devices correspond to different test function libraries. Android devices correspond to Android test function libraries, and components correspond to component test function libraries. If you want to test various test items in the components, you need to call the corresponding test functions in the component test function library to test the test items. Based on this, you first need to build a component test function library. The specific construction method includes: encapsulating each group of general independent component test logic codes corresponding to different components, and obtaining each group of component test functions corresponding to the different components; storing the each group of component test functions in the component test function library.

[0073] Specifically, it is necessary to first encapsulate each group of test logic codes corresponding to different components. Specifically, different languages ​​can be used to encapsulate each group of test logic codes. The language that is convenient to use can be used for encapsulation. The embodiment of the present invention does not specifically limit the encapsulation language. For example, JAVA, C++, Python and other languages ​​can be used to encapsulate each group of test logic codes corresponding to different components to obtain each group of component test functions corresponding to different components, and then each group of component test functions is stored in the component test function library corresponding to the different components. In this way, the test functions for testing the common functions of various components are encapsulated. If various components are to be tested later, the encapsulated test functions can be directly called to test the components, thereby avoiding the time wasted or writing errors caused by the staff needing to rewrite the test code for the tests of different components. Therefore, the embodiment of the present invention can improve the testing efficiency and accuracy of the components.

[0074] Wherein, if the component is an independent camera, the various test items of the component include independent camera power on and off function test, independent camera hardware interface function test, and independent camera serial port communication function test. Further, after the component test function library corresponding to the component is constructed, the component needs to be tested according to the component test function library. Based on this, step 206 specifically includes: determining the independent camera power on and off test function, the independent camera hardware interface test function, and the independent camera serial port communication test function in the component test function library; using the independent camera power on and off test function to test the independent camera power on and off function, and obtain the independent camera power on and off function test result corresponding to the independent camera; using the independent camera hardware interface test function to test the independent camera hardware interface function, and obtain the independent camera hardware interface function test result corresponding to the independent camera; using the independent camera serial port communication test function to test the independent camera serial port communication function, and obtain the independent camera serial port communication function test result corresponding to the independent camera.

[0075] Among them, the component test function library stores various test functions for testing the components. In order to test the components, it is first necessary to determine the various test items in the components, and then obtain the test functions corresponding to the various test items in the component test function library according to the various test items of the components. If the various test items of the components are: independent camera power-on and power-off function test items, hardware interface function test items, and serial port communication function test items, then for the independent camera power-on and power-off function test items, the independent camera power-on and power-off test function is obtained in the component test function library, for the hardware interface function test items, the hardware interface test function is obtained in the component test function library, and for the serial port communication function test items, the serial port communication test function is obtained in the component test function library, and then the above-mentioned various test functions are used to test the corresponding test items. Therefore, by directly calling various test functions in the test function library to test various test items in the components, the testing efficiency and accuracy of the components can be improved. Specifically, if the power-on and power-off functions of the camera are to be tested using an independent camera power-on and power-off test function, the specific testing method includes: establishing a connection between a programmable relay and the independent camera; in response to a power supply signal from the programmable relay to the independent camera, determining whether a prompt message indicating that the independent camera has been powered on successfully is received; if the prompt message indicating that the power-on has been successfully received is received, determining that the power-on function of the independent camera is normal; if the prompt message indicating that the power-on has been successfully received is not received, determining that the power-on function of the independent camera is abnormal; after receiving the prompt message indicating that the power-on has been successfully received, in response to a power-off signal from the programmable relay to the independent camera, determining whether a prompt message indicating that the independent camera has been powered off successfully is received; if the prompt message indicating that the power-off has been successfully received is received, determining that the power-off function of the independent camera is normal; if the prompt message indicating that the power-off has been successfully received is not received, determining that the power-off function of the independent camera is abnormal.

[0076] Specifically, the independent camera is connected to the programmable relay switch, and the programmable relay is controlled to supply power to the independent camera. At this time, it is determined whether the independent camera is powered on. If the independent camera is powered on, it is determined that the power-on function of the independent camera is normal. If the independent camera is not powered on, it is determined that the power-on function of the independent camera is abnormal. When the independent camera is powered on normally, the programmable relay is controlled to power off the independent camera. At this time, it is determined whether the independent camera is powered off. If the independent camera is powered off, it is determined that the power-off function of the independent camera is normal. If the independent camera is still powered on, it is determined that the power-off function of the independent camera is abnormal. At the same time, the above-mentioned power-on and power-off operations can be performed a preset number of times. Finally, if the number of normal power-on functions is greater than the preset threshold, it is determined that the power-on function of the independent camera is normal. If the number of normal power-on functions is less than or equal to the preset threshold, it is determined that the power-on function of the independent camera is abnormal. At the same time, if the number of normal power-off functions is greater than the preset threshold, it is determined that the power-off function of the independent camera is normal. If the number of normal power-off functions is less than or equal to the preset threshold, it is determined that the power-off function of the independent camera is abnormal. Therefore, by using a programmable relay to test the power-on and power-off functions of a component, automatic control of the power-on and power-off of the component can be achieved in the simplest way, thereby improving the convenience and efficiency of the test.

[0077] Furthermore, if the hardware interface test function is to be used to test the function of the independent camera hardware interface, the specific testing method includes: establishing a connection between a programmable relay and the independent camera hardware interface; in response to a power supply signal from the programmable relay to the independent camera hardware interface, inputting test parameters into the independent camera hardware interface, and receiving a test return value corresponding to the test parameters output by the independent camera hardware interface; determining an actual return value corresponding to the test parameter; determining whether the test return value matches the actual return value; if the test return value matches the actual return value, determining that the independent camera hardware interface functions normally; if the test return value does not match the actual return value, determining that the independent camera hardware interface functions abnormally.

[0078] Specifically, firstly, the program-controlled relay is controlled to supply power to the hardware interface of the independent camera. When the hardware interface is powered on, information (test parameters) is transmitted to the hardware interface. Then, the return value (test return value) for the transmitted information transmitted back by the hardware interface is received. Then, it is determined whether the actual return value corresponding to the transmitted information is the same as the test return value. If they are the same, it is determined that the hardware interface function of the independent camera is normal. If the actual return value is different from the test return value, it is determined that the hardware interface function of the independent camera is abnormal. Therefore, by using the program-controlled relay to test the hardware interface function of the independent camera, different switch closing and opening operations can be used to simulate the test needs in different scenarios, so that the independent camera can be automatically controlled in the simplest way, which improves the convenience and efficiency of the test.

[0079] Furthermore, if the serial port communication function of an independent camera is to be tested using a serial port communication test function, the specific testing method includes: determining a serial port communication test function library corresponding to the independent camera; using a test function in the serial port communication test function library corresponding to the independent camera to test the serial port communication function of the independent camera, and obtaining a test result of the serial port communication function of the independent camera.

[0080] Among them, the test items of serial communication include: data transmission integrity test, data transmission time test, data transmission form test, etc.

[0081] Specifically, the serial communication test function library contains various test functions for testing the serial port communication of independent cameras, such as data transmission integrity test function, data transmission time test function and data transmission form test function. If you want to test the serial communication function of an independent camera, you can obtain the corresponding test function in the test function library and use the test function to test the serial communication function.

[0082] Furthermore, there are common test items for the Android device and the component. In order to test the common test items in the component, the method also includes: using the common test function library corresponding to the Android device and the component to test the common test items in the component, and obtaining the common test results corresponding to the component.

[0083] Among them, the universal test function library includes universal test functions for performing the same function test on Android devices and components, and the universal test items in the components include independent camera shooting function test. The specific method of using the universal test function library to test the universal test items in the components includes: obtaining the camera function test function in the universal test function library; using the camera function test function to test the shooting function of the independent camera, and obtaining the camera shooting function test result corresponding to the independent camera. Among them, the method of using the camera function test function to test the shooting function of the independent camera includes: using a camera with normal shooting function to take a picture of a second reference object, and obtain a second actual picture corresponding to the second reference object; using the independent camera to take a picture of the second reference object, and obtain a second test picture corresponding to the second reference object; calculating the second actual hash value corresponding to the second actual image, and the second test hash value corresponding to the second test picture; judging whether the second test hash value is equal to the second actual hash value; if the second test hash value is equal to the second actual hash value, it is judged that the shooting function of the independent camera is normal.

[0084] Specifically, the test server controls the independent camera to turn on, and then controls the independent camera to take a picture of the second reference object to obtain a test picture taken by the independent camera. At the same time, a camera with normal camera performance is used to take a picture of the second reference object to obtain an actual picture corresponding to the second reference object. Then, an actual hash value corresponding to the actual picture is calculated, and a test hash value corresponding to the test picture is calculated. If the actual hash value is equal to the test hash value, it is determined that the shooting function of the independent camera corresponding to the component is normal during this test. If the actual hash value is not equal to the test hash value, it is determined that the shooting function of the independent camera is abnormal during this test. Repeat the above test process until the number of tests reaches a preset number. If the number of normal test functions during each test is greater than a preset threshold, it is finally determined that the shooting function of the independent camera corresponding to the component is normal. If the number of normal test functions during each test is less than or equal to the preset threshold, it is finally determined that the shooting function of the independent camera corresponding to the component is abnormal.

[0085] Furthermore, the component can also be an independent camera module, the camera module includes an RGB camera module and a Tof (Time of Flight, infrared depth of field sensor) camera module, the RGB camera module includes: 12M camera module, 13M camera module, 18M camera module, etc. The specific method of testing the independent camera module is the same as the method of testing the independent camera, and the embodiment of the present invention will not be repeated here. At the same time, the independent camera module can also be installed on the Android device to test the camera function of the whole device.

[0086] Furthermore, when testing the above-mentioned various test items of the component, in order to obtain the test process and test results for subsequent analysis, it is necessary to record the test process and test results of the above-mentioned various test items. Based on this, the method includes: starting the log thread corresponding to the component; in the process of testing the various test items in the component, calling the log thread corresponding to the component to store the test information of the test of the component.

[0087] Specifically, when the component is tested, the serial number of the component is obtained, the control object of the component is created, and then a log thread is started and called to store the log information generated by the component during the test for subsequent analysis. The generated log information is stored corresponding to the serial number of the component.

[0088] According to another device testing method provided by the present invention, compared with the current method of writing a test code for each test, the present invention determines the device type of the device to be tested by responding to the test signal of the device to be tested; if the device type is an Android device, the various test items in the Android device are tested using the Android test function library corresponding to the Android device to obtain the test result corresponding to the Android device; if the device to be tested is a component, the various test items in the component are tested using the component test function library corresponding to the component to obtain the test result corresponding to the component, thereby constructing the Android test function library corresponding to the Android device and the component test function library corresponding to the component. The Android test function library includes test functions for testing various common test items in various Android devices, and the component test function library includes test functions for testing various common test items in various components. When an Android device is to be tested, the test function in the Android test function library is directly called to test the Android device; when a component is to be tested, the test function in the component test function library is directly called to test the component, thereby avoiding the time wasted by the staff in pre-writing the test code, so that the present invention can improve the testing efficiency of the device, and at the same time, it can also avoid the situation where the staff writes the test code incorrectly, so that the present invention can improve the testing accuracy of the device.

[0089] Further, as Figure 1 The specific implementation of the present invention provides a device testing apparatus, such as Figure 3 As shown, the device includes: a determination unit 31, an Android testing unit 32 and a component testing unit 33.

[0090] The determining unit 31 may be configured to determine the device type to which the device to be tested belongs in response to a test signal of the device to be tested.

[0091] The Android test unit 32 can be used to test various Android test items in the Android device using an Android test function library corresponding to the Android device if the device type is an Android device, and obtain a test result corresponding to the Android device.

[0092] The component testing unit 33 may be used to test various component testing items in the component using a component testing function library corresponding to the component if the device to be tested is a component, so as to obtain a test result corresponding to the component.

[0093] In a specific application scenario, in order to test the common functions in the Android device and components, the Android testing unit 32 can also be used to test the common test items in the Android device using the common test function library corresponding to the Android device and the components to obtain the common test results corresponding to the Android device.

[0094] The component testing unit 33 can also be used to test the common test items in the component using the common test function library corresponding to the Android device and the component to obtain the common test results corresponding to the component.

[0095] In a specific application scenario, the Android test function library includes Android test functions for testing common functions of various Android devices, the component test function library includes component test functions for testing independent functions of components, and the universal test function library includes universal test functions for testing the same functions of Android devices and components.

[0096] In specific application scenarios, in order to build an Android test library, such as Figure 4 As shown, the device further includes a packaging unit 34 and a storage unit 35 .

[0097] The encapsulation unit 34 may be used to encapsulate various groups of common test logic codes corresponding to different Android devices to obtain various groups of Android test functions corresponding to the different Android devices.

[0098] The storage unit 35 can be used to store the groups of Android test functions in the Android test function libraries corresponding to the different Android devices.

[0099] In a specific application scenario, in order to construct a component test function library, the encapsulation unit 34 can also be used to encapsulate various groups of common independent component test logic codes corresponding to different components to obtain various groups of component test functions corresponding to the different components.

[0100] The storage unit 35 may also be used to store the groups of component test functions in the component test function library.

[0101] In a specific application scenario, in order to construct a universal test function library, the encapsulation unit 34 can also be used to encapsulate the universal test logic code corresponding to the Android device and the component to obtain groups of universal test functions corresponding to the Android device and the component.

[0102] The storage unit 35 may also be used to store the groups of universal test functions in a universal test function library corresponding to the Android device and components.

[0103] In a specific application scenario, in order to use the Android test function library corresponding to the Android device to test various test items in the Android device, the Android test unit 32 includes a first determination module 321 and a first test module 322 .

[0104] The first determination module 321 can be used to determine the flashing test function, the power on and off test function and the basic function test function in the Android test function library.

[0105] The first testing module 322 may be used to test the system flashing function of the Android device using the flashing test function to obtain a flashing test result corresponding to the Android device.

[0106] The first testing module 322 may also be used to test the power on / off function of the Android device using the power on / off test function to obtain a power on / off test result corresponding to the Android device.

[0107] The first testing module 322 may also be used to test various basic functions of the Android device using the basic function testing function to obtain test results of various basic functions corresponding to the Android device.

[0108] In a specific application scenario, in order to test the system flashing function, the first test module 322 can be specifically used to obtain a first flashing firmware with a first version number and a second flashing firmware with a second version number; determine whether the first version number is consistent with the pre-flashing version number of the Android device; if the first version number is consistent with the pre-flashing version number, use the second flashing firmware to flash the Android device to obtain the first flashed Android device; determine the first post-flashing version number corresponding to the first flashed Android device, if the first post-flashing version number is consistent with the second version number, determine that the system flashing function of the Android device is normal; if the first post-flashing version number is inconsistent with the second version number, determine that the system flashing function of the Android device is abnormal.

[0109] In a specific application scenario, in order to test the system flashing function, the first test module 322 can be specifically used to flash the Android device with the first flashing firmware to obtain a second Android device after flashing if the first version number is inconsistent with the pre-flashing version number; determine the second post-flashing version number corresponding to the second Android device after flashing, if the second post-flashing version number is consistent with the first version number, determine that the system flashing function of the Android device is normal; if the second post-flashing version number is inconsistent with the first version number, determine that the system flashing function of the Android device is abnormal.

[0110] In a specific application scenario, in order to test the power on and off function of the Android device, the first test module 322 can be specifically used to establish a connection between the Android device and the programmable relay; receive a power supply signal from the programmable relay to power the Android device; after receiving the power supply signal for a preset time, determine whether a prompt message of successful power on of the Android device is received; if the prompt message of successful power on is received, determine that the power on function of the Android device is normal; if the prompt message of successful power on is not received, determine that the power on function of the Android device is abnormal; after receiving the prompt message of successful power on, respond to the power off signal from the programmable relay to the Android device, determine whether a prompt message of successful shutdown of the Android device is received; if the prompt message of successful shutdown is received, determine that the shutdown function of the Android device is normal; if the prompt message of successful shutdown is not received, determine that the shutdown function of the Android device is abnormal.

[0111] In a specific application scenario, in order to test the startup function of each APP in the Android device, the first test module 322 can be specifically used to obtain the center point coordinates of each APP icon on the Android device; in response to a click operation on the center point coordinates, record a first time point corresponding to the click operation; after the click operation on the center point coordinates, record a second time point corresponding to when each APP is fully started; subtract the second time point from the first time point to obtain the startup time corresponding to each APP; determine whether each startup time is less than a preset time threshold; if each startup time is less than the preset time threshold, determine that the startup of each APP in the Android device is normal; if each startup time is greater than or equal to the preset time threshold, determine that the startup of each APP in the Android device is abnormal.

[0112] In a specific application scenario, the basic functions also include: the Android device's WiFi function, Bluetooth function, screenshot function, unlocking function, sleep function, and installation package installation function.

[0113] In a specific application scenario, in order to test the serial port communication function of the Android device, the determining unit 31 may also be used to determine a serial port communication test function library corresponding to the Android device.

[0114] The Android testing unit 32 may also be used to test the serial communication function of the Android device using the test function in the serial communication test function library to obtain a serial communication test result corresponding to the Android device.

[0115] In a specific application scenario, in order to test the common functions of Android devices and components, the Android testing unit 32 can be specifically used to determine a camera function test function in the common test function library; use the camera function test function to test the camera function of the Android device, and obtain the camera function test result corresponding to the Android device.

[0116] In a specific application scenario, in order to test the shooting function of the camera module in an Android device, the Android testing unit 32 can be specifically used to determine the Android identifier corresponding to the Android device; based on the Android identifier, unlock the Android device, and install the installation package corresponding to the camera function plug-in on the unlocked Android device; run the installation package to obtain the camera function plug-in installed on the Android device; use a camera with normal shooting function to take a picture of a first reference object to obtain a first actual picture corresponding to the first reference object; start the camera function of the Android device to take a picture of the first reference object to obtain a first test picture corresponding to the first reference object; calculate the first actual hash value corresponding to the first actual image, and the first test hash value corresponding to the first test picture; determine whether the first test hash value is equal to the first actual hash value; if the first test hash value is equal to the first actual hash value, it is determined that the camera function of the Android device is normal.

[0117] In a specific application scenario, in order to test a component, the component testing unit 33 includes a second determining module 331 and a second testing module 332 .

[0118] The second determination module 331 may be used to determine an independent camera power-on and power-off test function, an independent camera hardware interface test function, and an independent camera serial port communication test function in the component test function library.

[0119] The second test module 332 may be configured to test the power on and off function of the independent camera using the independent camera power on and off test function to obtain an independent camera power on and off function test result corresponding to the independent camera.

[0120] The second test module 332 may also be used to test the independent camera hardware interface function using the independent camera hardware interface test function to obtain an independent camera hardware interface function test result corresponding to the independent camera.

[0121] The second test module 332 may also be used to test the serial port communication function of the independent camera using the independent camera serial port communication test function to obtain the independent camera serial port communication function test result corresponding to the independent camera.

[0122] In a specific application scenario, in order to test the power-on and power-off functions of the independent camera, the second test module 332 can be specifically used to establish a connection between the programmable relay and the independent camera; in response to the power supply signal of the programmable relay to the independent camera, determine whether a prompt message of successful power-on of the independent camera is received; if the prompt message of successful power-on is received, determine that the power-on function of the independent camera is normal; if the prompt message of successful power-on is not received, determine that the power-on function of the independent camera is abnormal; after receiving the prompt message of successful power-on, in response to the power-off signal of the programmable relay to the independent camera, determine whether a prompt message of successful power-off of the independent camera is received; if the prompt message of successful power-off is received, determine that the power-off function of the independent camera is normal; if the prompt message of successful power-off is not received, determine that the power-off function of the independent camera is abnormal.

[0123] In a specific application scenario, in order to test the hardware interface function of an independent camera, the second test module 332 can be specifically used to establish a connection between a programmable relay and the independent camera hardware interface; in response to a power supply signal of the programmable relay to the independent camera hardware interface, input test parameters into the independent camera hardware interface, and receive a test return value corresponding to the test parameter output by the independent camera hardware interface; determine an actual return value corresponding to the test parameter; determine whether the test return value matches the actual return value; if the test return value matches the actual return value, determine that the independent camera hardware interface functions normally; if the test return value does not match the actual return value, determine that the independent camera hardware interface functions abnormally.

[0124] In a specific application scenario, in order to test the serial port communication function of an independent camera, the determination unit 31 may also be used to determine a serial port communication test function library corresponding to the independent camera.

[0125] The component testing unit 33 may also be used to test the serial port communication function of the independent camera using the test function in the serial port communication test function library corresponding to the independent camera to obtain the test result of the serial port communication function of the independent camera.

[0126] In a specific application scenario, in order to test the shooting function of an independent camera, the component testing unit 33 can also be used to obtain a camera function test function in the general test function library; use the camera function test function to test the shooting function of the independent camera, and obtain the camera shooting function test result corresponding to the independent camera.

[0127] In a specific application scenario, in order to test the shooting function of an independent camera using a camera function test function, the component testing unit 33 can also be used to take a picture of a second reference object using a camera with a normal shooting function to obtain a second actual picture corresponding to the second reference object; take a picture of the second reference object using the independent camera to obtain a second test picture corresponding to the second reference object; calculate a second actual hash value corresponding to the second actual image and a second test hash value corresponding to the second test picture; determine whether the second test hash value is equal to the second actual hash value; if the second test hash value is equal to the second actual hash value, it is determined that the shooting function of the independent camera is normal.

[0128] In a specific application scenario, in order to record the test information of the Android device, the apparatus further includes a starting unit 36 ​​.

[0129] The starting unit 36 ​​may be used to start a log thread corresponding to the Android device.

[0130] The storage unit 35 may also be used to call a log thread corresponding to the Android device to store test information of the Android device during the process of testing various test items in the Android device.

[0131] In a specific application scenario, in order to record the test information of a component, the starting unit 36 ​​can also be used to start a log thread corresponding to the component.

[0132] The storage unit 35 may also be used to call the log thread corresponding to the component to store the test information of the component during the process of testing various test items in the component.

[0133] It should be noted that for other corresponding descriptions of the functional modules involved in the device testing apparatus provided in the embodiment of the present invention, reference can be made to Figure 1 The corresponding description of the method shown will not be repeated here.

[0134] Based on the above Figure 1 The method shown, accordingly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the following steps are implemented: in response to a test signal of a device to be tested, determining the device type to which the device to be tested belongs; if the device type is an Android device, using an Android test function library corresponding to the Android device to test various test items in the Android device, and obtaining test results corresponding to the Android device; if the device to be tested is a component, using a component test function library corresponding to the component to test various test items in the component, and obtaining test results corresponding to the component.

[0135] Based on the above Figure 1 The method shown and Figure 3 The embodiment of the device shown in the figure, the embodiment of the present invention also provides a physical structure diagram of a computer device, such as Figure 5 As shown, the computer device includes: a processor 41, a memory 42, and a computer program stored in the memory 42 and executable on the processor, wherein the memory 42 and the processor 41 are both arranged on a bus 43, and the processor 41 implements the following steps when executing the program: in response to a test signal of the device to be tested, determining the device type to which the device to be tested belongs; if the device type is an Android device, testing various Android test items in the Android device using an Android test function library corresponding to the Android device to obtain a test result corresponding to the Android device; if the device to be tested is a component, testing various component test items in the component using a component test function library corresponding to the component to obtain a test result corresponding to the component.

[0136] According to an embodiment of the present invention, a device testing terminal is provided, and the device testing terminal is equipped with the above-mentioned device testing apparatus.

[0137] According to an embodiment of the present invention, a device testing system is provided, the system comprising a testing server and a plurality of acquisition terminals, each of the acquisition terminals being connected to the testing server respectively; wherein the testing server is deployed with the above-mentioned device testing apparatus;

[0138] The acquisition terminal is used to acquire the test signal and send the test signal to the test server.

[0139] Through the technical solution of the present invention, the present invention determines the device type to which the device to be tested belongs by responding to the test signal of the device to be tested; if the device type is an Android device, then various Android test items in the Android device are tested using the Android test function library corresponding to the Android device to obtain the test result corresponding to the Android device; if the device to be tested is a component, then various component test items in the component are tested using the component test function library corresponding to the component to obtain the test result corresponding to the component, thereby constructing an Android test function library corresponding to the Android device and a component test function library corresponding to the component, the Android test function library covers test functions for testing various test items in various Android devices, and the component test function library covers test functions for testing various test items in various components. If the Android device is to be tested, the test function in the Android test function library is directly called to test the Android device, and if the component is to be tested, the test function in the component test function library is directly called to test the component, thereby avoiding the time wasted by the staff in pre-writing the test code, so that the present invention can improve the testing efficiency of the device, and at the same time, it can also avoid the situation where the staff writes the test code incorrectly, so that the present invention can improve the testing accuracy of the device.

[0140] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0141] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A device testing method, characterized in that: include: In response to a test signal of the device to be tested, when the device to be tested includes an Android device and a component, the following tests are performed: Using an Android test function library corresponding to the Android device to test various Android test items in the Android device, and obtaining a test result corresponding to the Android device, wherein the Android test function library includes Android test functions for testing common functions of various Android devices; Using the component test function library corresponding to the component to test various component test items in the component, and obtaining the test results corresponding to the component, wherein the component test function library includes a component test function for testing the independent function of the component, the component is an independent camera, and the various component test items include: independent camera power on and off function test, independent camera hardware interface function test, and independent camera serial port communication function test; Using the universal test function library corresponding to the Android device and the component to test the universal test items in the Android device, and obtaining the universal test results corresponding to the Android device, wherein the universal test items in the Android device include a camera function test, and a camera function test function is determined in the universal test function library to test the camera function; The universal test items in the component are tested using the universal test function library corresponding to the Android device and the component to obtain the universal test results corresponding to the component, wherein the universal test function library includes universal test functions for performing the same functional tests on the Android device and the component.

2. The method according to claim 1, characterized in that: Before testing various Android test items in the Android device using the Android test function library corresponding to the Android device to obtain the test results corresponding to the Android device, the method further includes: Encapsulate each group of common test logic codes corresponding to different Android devices to obtain each group of Android test functions corresponding to the different Android devices; The groups of Android test functions are stored in the Android test function library.

3. The method according to claim 1, characterized in that: Before testing various component test items in the component using the component test function library corresponding to the component to obtain the test result corresponding to the component, the method further includes: Encapsulate each group of common independent component test logic codes corresponding to different components to obtain each group of component test functions corresponding to the different components; The groups of component test functions are stored in the component test function library.

4. The method according to claim 1, characterized in that: Before testing the universal test items in the Android device using the universal test function library corresponding to both the Android device and the component to obtain the universal test results corresponding to the Android device, the method further includes: Encapsulate the common test logic code corresponding to the Android device and the component to obtain groups of common test functions corresponding to the Android device and the component; The groups of universal test functions are stored in a universal test function library corresponding to the Android device and components.

5. The method according to claim 1, characterized in that The various Android test items in the Android device include: flashing test, power on / off test and basic function test. The various Android test items in the Android device are tested by using the Android test function library corresponding to the Android device to obtain the test results corresponding to the Android device, including: Determine a flashing test function, a power on / off test function, and a basic function test function in the Android test function library; Using the flashing test function to test the system flashing function of the Android device, and obtaining the flashing test result corresponding to the Android device; Using the power on and off test function to test the power on and off function of the Android device, and obtaining a power on and off test result corresponding to the Android device; The basic function test function is used to test various basic functions of the Android device to obtain test results of various basic functions corresponding to the Android device.

6. The method according to claim 5, characterized in that The step of testing the system flashing function of the Android device by using the flashing test function to obtain the flashing test result corresponding to the Android device includes: Obtain a first flash firmware with a first version number and a second flash firmware with a second version number; Determine whether the first version number is consistent with the version number of the Android device before flashing; If the first version number is consistent with the version number before flashing, flashing the Android device with the second flashing firmware to obtain the Android device after the first flashing; Determine a first post-flashing version number corresponding to the first flashed Android device, and if the first post-flashing version number is consistent with the second version number, determine that the system flashing function of the Android device is normal; If the first post-flashing version number is inconsistent with the second version number, it is determined that the system flashing function of the Android device is abnormal.

7. The method according to claim 6, characterized in that After determining whether the first version number is consistent with the pre-flash version number of the Android device, the method further includes: If the first version number is inconsistent with the pre-flashing version number, flashing the Android device using the first flashing firmware to obtain a second flashed Android device; Determine a second post-flashing version number corresponding to the second post-flashing Android device, and if the second post-flashing version number is consistent with the first version number, determine that the system flashing function of the Android device is normal; If the second version number after flashing is inconsistent with the first version number, it is determined that the system flashing function of the Android device is abnormal.

8. The method according to claim 5, characterized in that The step of testing the power on and off function of the Android device by using the power on and off test function to obtain a power on and off test result corresponding to the Android device includes: Establishing a connection between the Android device and the program-controlled relay; Receiving a power supply signal from the program-controlled relay to supply power to the Android device; After receiving the power supply signal for a preset time, determining whether a prompt message indicating that the Android device has been successfully powered on is received; If the prompt message indicating successful startup is received, it is determined that the startup function of the Android device is normal; If the prompt message indicating successful startup is not received, it is determined that the startup function of the Android device is abnormal; After receiving the prompt information of successful startup, in response to the power-off signal of the program-controlled relay to the Android device, determining whether the prompt information of successful shutdown of the Android device is received; If the prompt message indicating the shutdown is successful is received, it is determined that the shutdown function of the Android device is normal; If the prompt information indicating the shutdown success is not received, it is determined that the shutdown function of the Android device is abnormal.

9. The method according to claim 5, characterized in that The basic functions include: the startup functions of each APP in the Android device, and the basic functions of the Android device are tested by using the basic function test function to obtain the test results of the basic functions corresponding to the Android device, including: Get the center point coordinates of each APP icon on the Android device; In response to a click operation on the coordinates of the center point, recording a first time point corresponding to the click operation; After the click operation on the coordinates of the center point, the second time point corresponding to each APP being fully started is recorded; Subtract the second time point from the first time point to obtain the startup time corresponding to each APP; Determining whether each of the startup times is less than a preset time threshold; If each of the startup times is less than a preset time threshold, it is determined that each APP in the Android device is started normally; If each of the startup times is greater than or equal to a preset time threshold, it is determined that startup of each APP in the Android device is abnormal.

10. The method according to claim 5, characterized in that The basic functions also include: the Android device's WiFi function, Bluetooth function, screenshot function, unlock function, sleep function, and installation package installation function.

11. The method according to claim 1, characterized in that: The method further comprises: Determine a serial port communication test function library corresponding to the Android device; The serial communication function of the Android device is tested using the test function in the serial communication test function library to obtain the serial communication test result corresponding to the Android device.

12. The method according to claim 1, characterized in that Before determining the camera function test function in the general test function library to test the camera function, the method further includes: Determine an Android ID corresponding to the Android device; Unlock the Android device based on the Android identifier, and install an installation package corresponding to the camera function plug-in on the unlocked Android device; The installation package is run to obtain the camera function plug-in installed on the Android device.

13. The method according to claim 1, characterized in that The step of determining a camera function test function in the general test function library to test the camera function includes: Using a camera with normal shooting function to take a picture of a first reference object to obtain a first actual picture corresponding to the first reference object; Activate a camera function of the Android device to take a picture of the first reference object to obtain a first test picture corresponding to the first reference object; Calculating a first actual hash value corresponding to the first actual picture and a first test hash value corresponding to the first test picture; Determine whether the first test hash value is equal to the first actual hash value; If the first test hash value is equal to the first actual hash value, it is determined that the camera function of the Android device is normal.

14. The method according to claim 1, characterized in that The method of testing various component test items in the component by using the component test function library corresponding to the component to obtain the test result corresponding to the component includes: Determine in the component test function library an independent camera power on and off test function, an independent camera hardware interface test function, and an independent camera serial port communication test function; Using the independent camera power on and off test function to test the independent camera power on and off function, and obtaining the independent camera power on and off function test result corresponding to the independent camera; Using the independent camera hardware interface test function to test the independent camera hardware interface function, and obtaining the independent camera hardware interface function test result corresponding to the independent camera; The independent camera serial port communication function is tested by using the independent camera serial port communication test function to obtain the independent camera serial port communication function test result corresponding to the independent camera.

15. The method according to claim 14, characterized in that The step of testing the power on and off function of the independent camera by using the independent camera power on and off test function to obtain the independent camera power on and off function test result corresponding to the independent camera includes: Establishing a connection between the programmable relay and the independent camera; In response to a power supply signal from the program-controlled relay to the independent camera, determining whether a prompt message indicating that the independent camera is powered on successfully is received; If the prompt message indicating that the power-on is successful is received, it is determined that the power-on function of the independent camera is normal; If the prompt message indicating successful power-on is not received, determining that the power-on function of the independent camera is abnormal; After receiving the prompt information of successful power-on, in response to the power-off signal of the program-controlled relay to the independent camera, determining whether the prompt information of successful power-off of the independent camera is received; If the prompt message indicating that the power-off is successful is received, it is determined that the power-off function of the independent camera is normal; If the prompt information indicating the power-off success is not received, it is determined that the power-off function of the independent camera is abnormal.

16. The method according to claim 14, characterized in that The step of testing the independent camera hardware interface function by using the independent camera hardware interface test function to obtain the independent camera hardware interface function test result corresponding to the independent camera includes: Establishing a connection between the program-controlled relay and the independent camera hardware interface; In response to a power supply signal from the program-controlled relay to the independent camera hardware interface, input a test parameter into the independent camera hardware interface, and receive a test return value corresponding to the test parameter output by the independent camera hardware interface; Determine the actual return value corresponding to the test parameter; Determine whether the test return value matches the actual return value; If the test return value matches the actual return value, it is determined that the independent camera hardware interface functions normally; If the test return value does not match the actual return value, it is determined that the independent camera hardware interface function is abnormal.

17. The method according to claim 14, characterized in that The using the independent camera serial port communication test function to test the independent camera serial port communication function to obtain the independent camera serial port communication function test result corresponding to the independent camera includes: Determine a serial port communication test function library corresponding to the independent camera; The serial port communication function of the independent camera is tested by using the test function in the serial port communication test function library corresponding to the independent camera to obtain the test result of the serial port communication function of the independent camera.

18. The method according to claim 1, characterized in that The general test items in the component include an independent camera shooting function test, and the general test items in the component are tested by using a general test function library corresponding to the Android device and the component to obtain a general test result corresponding to the component, including: Obtaining a camera function test function in the general test function library; The camera function test function is used to test the shooting function of the independent camera to obtain the camera shooting function test result corresponding to the independent camera.

19. The method according to claim 18, characterized in that The step of testing the shooting function of the independent camera by using the camera function test function to obtain the camera shooting function test result corresponding to the independent camera includes: Using a camera with normal shooting function to take a picture of the second reference object to obtain a second actual picture corresponding to the second reference object; Using the independent camera to take a picture of the second reference object to obtain a second test picture corresponding to the second reference object; Calculating a second actual hash value corresponding to the second actual picture and a second test hash value corresponding to the second test picture; Determine whether the second test hash value is equal to the second actual hash value; If the second test hash value is equal to the second actual hash value, it is determined that the shooting function of the independent camera is normal.

20. The method according to claim 1, characterized in that The method further comprises: Start the log thread corresponding to the Android device; In the process of testing various test items in the Android device, a log thread corresponding to the Android device is called to store test information of the Android device.

21. The method according to claim 1, characterized in that The method further comprises: Start the log thread corresponding to the component; In the process of testing various test items in the component, the log thread corresponding to the component is called to store the test information of the component.

22. A device testing apparatus, characterized in that: include: The determination unit is configured to respond to a test signal of the device to be tested, and when the device to be tested includes an Android device and a component, perform the following test: An Android test unit, used to test various Android test items in the Android device using an Android test function library corresponding to the Android device, and obtain a test result corresponding to the Android device, wherein the Android test function library includes Android test functions for testing common functions of various Android devices; A component testing unit, used for testing various component testing items in the component by using a component testing function library corresponding to the component to obtain a test result corresponding to the component, wherein the component testing function library includes a component testing function for testing independent functions of the component, the component is an independent camera, and the various component testing items include: independent camera power on and off function test, independent camera hardware interface function test, and independent camera serial port communication function test; An Android test unit is used to test the general test items in the Android device by using the general test function library corresponding to the Android device and the component to obtain the general test results corresponding to the Android device, wherein the general test items in the Android device include a camera function test, and a camera function test function is determined in the general test function library to test the camera function; The component testing unit is used to test the common test items in the component using the common test function library corresponding to the Android device and the component to obtain the common test results corresponding to the component, wherein the common test function library includes common test functions for performing the same functional tests on the Android device and the component.

23. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 21 are implemented.

24. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 21 are implemented.