Device testing method, device, computer device and storage medium
By using switches to monitor and identify equipment under test in an online testing environment, and conducting batch testing, the problems of low efficiency and poor accuracy of traditional equipment testing methods are solved, and efficient and accurate batch testing of equipment is achieved.
Patent Information
- Application Number
- CN202410774181.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-06-17
AI Technical Summary
Traditional equipment testing methods require manual operations, resulting in low test efficiency, long time consumption, and error-prone. In particular, factory workers are not familiar with equipment functions, test environments, and operating commands, and the steps are complex, making it difficult to implement batch testing.
By monitoring multiple connected devices under test in an online test environment, using switches to conduct batch testing, identifying initial access devices, performing the first test and updating the identification, uploading device program files, and conducting the second test. Combined with the first and the second test result to obtain the target test results to implement batch testing of equipment.
It improves the efficiency and accuracy of equipment testing, reduces manual errors, simplifies the testing process, enables batch testing of multiple devices at the same time, and reduces testing costs.
Smart Images

Figure CN118337683B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technology, and in particular to a device testing method, apparatus, computer equipment and storage medium. Background Art
[0002] Equipment, such as edge network equipment, needs to be batch tested after production to test the correctness of the equipment's network ports and internal hardware module functions.
[0003] In traditional equipment testing technology, the test environment consists of a computer host, a test program, a device under test, and a network cable. Both the host and the device under test run the Linux operating system. The tester connects the device under test to the host through a network cable, operates on the host, uploads the test program compressed package to the device under test through the File Transfer Protocol (FTP) or the Secure File Transfer Protocol (SFTP), logs in to the device through the Teletype over the Network (Telnet) or the Secure Shell (SSH), decompresses the program package on the device side, starts the test, waits for the test to complete, and collects the test results. Repeat the above operations for each device until all devices under test are tested and the test results are summarized. During the test process of the device under test, each device under test needs to be tested manually and the results observed.
[0004] However, in traditional equipment testing methods, all test operations need to be completed manually, resulting in low testing efficiency and long testing time. In addition, testers are usually factory workers who are unfamiliar with equipment functions, test environments, and operating commands. There are many steps and it is easy to make mistakes, and it is also easy to make mistakes when collecting test results. Summary of the invention
[0005] Based on this, it is necessary to provide a device testing method, apparatus, computer equipment and storage medium that can simultaneously batch test devices and improve the efficiency and accuracy of device testing in response to the above technical problems.
[0006] In a first aspect, the present application provides a device testing method, comprising:
[0007] In the online test environment, multiple connected devices under test are monitored; multiple devices under test are connected through switches;
[0008] For each connected device under test, when it is identified that the device under test is connected for the first time according to the first device identification of the device under test, a first test is performed on the device under test to obtain a first test result, and the first device identification of the device under test is modified to obtain an updated identification of the device under test;
[0009] Uploading the device program file to the device under test according to the update identifier, performing a second test on the device under test according to the device program file, and obtaining a second test result;
[0010] A target test result of the device under test is obtained according to the second test result and the first test result.
[0011] In one embodiment, when it is identified according to the first device identification of the device under test that the device under test is accessed for the first time, performing a first test on the device under test includes:
[0012] Logging in to the device under test through a target protocol according to a first device identifier of the device under test;
[0013] Querying the second device identification of the device under test to detect whether the second device identification of the device under test has been recorded;
[0014] If the second device identification of the device under test has been recorded, it is determined that the device under test is not connected for the first time;
[0015] If the second device identification of the device under test has not been recorded, it is determined that the device under test is connected for the first time, and a first test is performed on the device under test.
[0016] In one embodiment, the method further comprises:
[0017] For each connected device under test, when it is identified according to the first device identification of the device under test that the device under test is not connected for the first time and the first device identification of the device under test has not been modified, the device under test is recorded as an abnormal device;
[0018] Perform abnormal tests on abnormal equipment and obtain abnormal test results.
[0019] In one embodiment, the method further comprises:
[0020] At fixed time intervals, the first test result, the second test result, and the abnormal test result are recorded to obtain a test result set;
[0021] The test result set is integrated.
[0022] In one embodiment, performing a second test on the device under test according to the device program file to obtain a second test result includes:
[0023] Logging into the device under test through a target protocol according to an update identifier of the device under test;
[0024] Decompressing the device program file in the device under test to obtain the device program;
[0025] The device program is started, a second test is performed on the device to be tested, and a second test result is obtained.
[0026] In one embodiment, the method further comprises:
[0027] In an offline test environment, monitor the connected device under test;
[0028] For the connected device under test, when it is identified according to the first device identifier of the device under test that the device under test is connected for the first time, a first test is performed on the device under test to obtain a first test result;
[0029] Uploading the device program file to the device under test, performing a second test on the device under test according to the device program file, and obtaining a second test result;
[0030] A target test result of the device under test is obtained according to the second test result and the first test result.
[0031] In one embodiment, the method further comprises:
[0032] For the connected device under test, when it is identified according to the first device identifier of the device under test that the device under test is not connected for the first time, determining whether there is a program log for the device under test;
[0033] If the device under test has a program log, then record the program log file of the device under test;
[0034] If the device under test does not have a program log, the device under test is recorded as an abnormal device; an abnormal test is performed on the abnormal device to obtain an abnormal test result.
[0035] In a second aspect, the present application also provides a device testing apparatus, comprising:
[0036] The monitoring module is used to monitor multiple connected devices under test in an online test environment; multiple devices under test are connected through switches;
[0037] A first test module is used for, for each connected device under test, when it is identified according to the first device identifier of the device under test that the device under test is connected for the first time, performing a first test on the device under test to obtain a first test result, and modifying the first device identifier of the device under test to obtain an update identifier of the device under test;
[0038] A second test module is used to upload the device program file to the device under test according to the update identifier, perform a second test on the device under test according to the device program file, and obtain a second test result;
[0039] The determination module is used to obtain a target test result of the device under test according to the second test result and the first test result.
[0040] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0041] In the online test environment, multiple connected devices under test are monitored; multiple devices under test are connected through switches;
[0042] For each connected device under test, when it is identified that the device under test is connected for the first time according to the first device identification of the device under test, a first test is performed on the device under test to obtain a first test result, and the first device identification of the device under test is modified to obtain an updated identification of the device under test;
[0043] Uploading the device program file to the device under test according to the update identifier, performing a second test on the device under test according to the device program file, and obtaining a second test result;
[0044] A target test result of the device under test is obtained according to the second test result and the first test result.
[0045] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0046] In the online test environment, multiple connected devices under test are monitored; multiple devices under test are connected through switches;
[0047] For each connected device under test, when it is identified that the device under test is connected for the first time according to the first device identification of the device under test, a first test is performed on the device under test to obtain a first test result, and the first device identification of the device under test is modified to obtain an updated identification of the device under test;
[0048] Uploading the device program file to the device under test according to the update identifier, performing a second test on the device under test according to the device program file, and obtaining a second test result;
[0049] A target test result of the device under test is obtained according to the second test result and the first test result.
[0050] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0051] In the online test environment, multiple connected devices under test are monitored; multiple devices under test are connected through switches;
[0052] For each connected device under test, when it is identified that the device under test is connected for the first time according to the first device identification of the device under test, a first test is performed on the device under test to obtain a first test result, and the first device identification of the device under test is modified to obtain an updated identification of the device under test;
[0053] Uploading the device program file to the device under test according to the update identifier, performing a second test on the device under test according to the device program file, and obtaining a second test result;
[0054] A target test result of the device under test is obtained according to the second test result and the first test result.
[0055] The above-mentioned equipment testing method, device, computer equipment and storage medium can monitor multiple devices under test connected through a switch in an online testing environment; for each connected device under test, when it is identified that the device under test is connected for the first time according to the first device identification of the device under test, a first test is performed on the device under test to obtain a first test result, and the first device identification of the device under test is modified to obtain an updated identification of the device under test; according to the updated identification, a device program file is uploaded to the device under test, and according to the device program file, a second test is performed on the device under test to obtain a second test result; according to the second test result and the first test result, a target test result of the device under test is obtained, and devices can be tested in batches at the same time, thereby improving the efficiency and accuracy of equipment testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 An application environment diagram of a device testing method in an embodiment;
[0058] Figure 2 A schematic diagram of a flow chart of a device testing method in an embodiment;
[0059] Figure 3A schematic diagram of a flow chart of performing a first test step on a device under test in one embodiment;
[0060] Figure 4 is a structural block diagram of a device testing apparatus in one embodiment;
[0061] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0063] The device testing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the device under test 102 communicates with the server 104 through the switch 106. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. After the device under test 102 establishes a connection with the server 104 through the switch 106, the server 104 monitors the multiple devices under test 102 that have been connected; for each device under test 102 that has been connected, when the server 104 identifies that the device under test 102 is connected for the first time according to the first device identification of the device under test 102, the first test is performed on the device under test 102 to obtain a first test result, and the first device identification of the device under test 102 is modified to obtain an update identification of the device under test 102; the server 104 uploads the device program file to the device under test 102 according to the update identification, and performs a second test on the device under test 102 according to the device program file to obtain a second test result. Among them, the device under test 102 can be an edge network device, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0064] In an exemplary embodiment, Figure 2 As shown, a device testing method is provided, which is applied to Figure 1 The server in the example is used to illustrate, including the following steps 202 to 208. Among them:
[0065] Step 202: In an online test environment, multiple connected devices under test are monitored; the multiple devices under test are connected through a switch.
[0066] Optionally, the device testing method includes online testing and offline testing. The server may be a host. The online testing environment includes a host, a device under test, a network cable, and a switch. A host program runs in the host to implement the main control. The switch is used to establish a connection between the host and the device under test. The host can simultaneously establish an electrical connection with multiple devices under test through multiple switches. After the host establishes an electrical connection with multiple devices under test through multiple switches, the host starts the host program to monitor whether the multiple devices under test connected to the host have been successfully connected to the host.
[0067] The host program uses, but is not limited to, Internet Packet Groper (ping), traceroute, Network Mapper (nmap), mtr (network connectivity determination tool), etc. The host program detects the first device identifier of the device under test at fixed intervals to monitor whether the device under test is connected.
[0068] Step 204, for each connected device under test, when it is identified that the device under test is connected for the first time according to the first device identification of the device under test, a first test is performed on the device under test to obtain a first test result, and the first device identification of the device under test is modified to obtain an updated identification of the device under test.
[0069] Among them, the first device identification of the device under test refers to the default Internet Protocol Address (IP address) of the device under test. The first test refers to a network transceiver test for each device under test that is connected for the first time. Exemplarily, the network performance test tool can be run on the host and each device under test that is connected for the first time, respectively, to implement the network transceiver test of the device under test that is connected for the first time. The update identification of the device under test means that for each device under test that is connected for the first time, the default IP address of the device under test is modified to a temporary IP address, and the temporary IP address is the update identification of the device under test. The temporary IP addresses of each device under test that is connected for the first time can be sequentially incremented. Modifying the default IP address of the device under test that is connected for the first time can solve the problem of IP address conflicts when multiple devices under test are connected to the host at the same time.
[0070] Specifically, for each connected device under test, the default IP address of the device under test is used to log in to the device under test, and the second device identification of the device under test is obtained. According to the obtained second device identification, it is identified whether the device under test is accessing the host for the first time. If the device under test is accessing the host for the first time, the device under test performs a network transceiver test, and the default IP address of the device under test is modified to a temporary IP address to obtain an updated identification of the device under test.
[0071] Step 206: upload the device program file to the device under test according to the update identifier, perform a second test on the device under test according to the device program file, and obtain a second test result.
[0072] The device program file refers to a compressed package of the device program, which is a test program running on the device under test and is used to perform a second test on the device under test. The second test on the device under test may include testing the central processing unit (CPU), memory, flash (storage chip), hard disk, video codec, image codec, artificial intelligence module, encryption and decryption module, etc. of the device under test.
[0073] Exemplarily, for each device under test that is connected for the first time, the update identifier of the device under test is determined, and the host uses the update identifier of the device under test to transmit the compressed package of the device program to the device under test, and starts the device program to perform a second test on the device under test.
[0074] Step 208: Obtain a target test result of the device under test according to the second test result and the first test result.
[0075] Specifically, for each device under test that is connected for the first time, the host summarizes the first test result and the second test result to obtain the target test result of the device under test.
[0076] In the above device testing method, multiple connected devices to be tested are monitored in an online test environment; multiple devices to be tested are connected through a switch; for each connected device to be tested, when the device to be tested is identified as being connected for the first time based on the first device identification of the device to be tested, a first test is performed on the device to be tested to obtain a first test result, and the first device identification of the device to be tested is modified to obtain an updated identification of the device to be tested, which can solve the first device identification conflict problem when multiple devices to be tested are connected to the host at the same time. The device program file is uploaded to the device to be tested based on the updated identification, and a second test is performed on the device to be tested based on the device program file to obtain a second test result. The target test result of the device to be tested is obtained based on the second test result and the first test result, which can simultaneously test the devices to be tested in batches and improve the testing efficiency and accuracy of the devices to be tested.
[0077] In an exemplary embodiment, Figure 3 As shown, for each connected device under test, when the device under test is identified as being connected for the first time according to the first device identification of the device under test, performing a first test on the device under test includes steps 302 to 308. Among them:
[0078] Step 302: For each connected device under test, log in to the device under test through a target protocol according to the first device identification of the device under test.
[0079] Step 304, query the second device identification of the device under test to detect whether the second device identification of the device under test has been recorded. If it has been recorded, execute step 306; if it has not been recorded, execute step 308.
[0080] Step 306: Determine whether the device under test is connected for the first time.
[0081] Step 308: determine that the device under test is connected for the first time, and perform a first test on the device under test.
[0082] The target protocol refers to a remote login protocol, and the target protocol may be telnet, ssh, rlogin (remote login) or mosh (lightweight ssh terminal), etc. The second device identifier of the device under test refers to a Media Access Control Address (MAC address) of the device under test.
[0083] Specifically, for each connected device under test, the host uses the first device identification of the device under test (i.e., the default IP address of the device under test) to log in to the device under test through protocols such as telnet, ssh, rlogin, or mosh, and queries the MAC address of the device under test. The host detects whether the MAC address of the device under test has been recorded on the host based on the MAC address of the device under test. If the MAC address of the device under test has been recorded on the host, it means that the device under test has been connected to the host before, and an abnormality judgment is made on the device under test. Since the MAC address of each device under test is different, if the MAC address of the device under test has not been recorded on the host, it means that the device under test is connected to the host for the first time. When the device under test is connected to the host for the first time, the client mode of the network performance test tool is started on the device under test, and the first test, i.e., the network transceiver test, is performed on the host using the network performance test tool.
[0084] In this embodiment, for each connected device under test, the device under test is logged in through the target protocol according to the first device identification of the device under test, the second device identification of the device under test (i.e., the MAC address of the device under test) is queried, and it is detected whether the MAC address of the device under test has been recorded, so that devices under test that may have problems or abnormalities can be screened out, thereby reducing the testing cost. If the MAC address of the device under test has been recorded, it is determined that the device under test is not connected for the first time. If the MAC address of the device under test has not been recorded, it is determined that the device under test is connected for the first time, and the first test is performed on the device under test, which can improve the testing efficiency of the device under test.
[0085] In an exemplary embodiment, the method further includes: for each connected device under test, when it is identified based on the first device identification of the device under test that the device under test is not connected for the first time and the first device identification of the device under test has not been modified, recording the device under test as an abnormal device; performing an abnormal test on the abnormal device to obtain an abnormal test result.
[0086] For each connected device under test, if the MAC address of the device under test has been recorded on the host, that is, the device under test has been connected to the host before, and the first device identification of the device under test has not been modified, the IP address of the device under test is still the default IP address. Since the default IP address will only be restored when the device under test is restarted, if the device under test has been connected to the host before and the IP address of the device under test is still the default IP address, it means that the device under test has abnormally restarted during the device test. The host records the device under test that has abnormally restarted as an abnormal device, performs further abnormal tests on the abnormal device, and obtains abnormal test results.
[0087] In this embodiment, for each connected device under test, when it is identified that the device under test is not connected for the first time and the first device identification of the device under test has not been modified, the device under test is recorded as an abnormal device; an abnormal test is performed on the abnormal device to obtain an abnormal test result, and abnormal devices under test can be screened, and further abnormal tests are performed on the abnormal devices, which can simplify the test process and improve test efficiency.
[0088] In an exemplary embodiment, performing a second test on the device under test according to the device program file to obtain a second test result includes: logging into the device under test through a target protocol according to an update identifier of the device under test; decompressing the device program file in the device under test to obtain a device program; starting the device program, performing a second test on the device under test, and obtaining a second test result.
[0089] For each device under test that is connected to the host for the first time, the first device identifier (default IP address) of the device under test is modified to an updated identifier (temporary IP address), and the host records the temporary IP address of the device under test and the MAC address of the device under test.
[0090] The host uses the temporary IP address of the device under test to upload the device program compressed package to the device under test through ftp or sftp, and logs in to the device under test through protocols such as telnet, ssh, rlogin or mosh. The host decompresses the device program compressed package in the device under test to obtain the device program. Start the device program, perform a second test on the device under test, and obtain a second test result. The device program contains multiple test items such as the CPU, memory, flash, hard disk, video codec, image codec, artificial intelligence module, encryption and decryption module of the device under test. The device program has two modes, including single test and aging test. A single test is run only once to complete the complete test of each module, which is used to verify the basic functions of the device under test. The aging test is a cycle of a single test, and the number of cycles is set by the host program to verify the stability of the device under test for a long time. The result file of the second test can be placed in the temporary directory of the device under test, and the file will be automatically discarded after the device under test is restarted, which will not affect subsequent tests and the use of the device under test.
[0091] In this embodiment, for each device under test after the first device identification is modified, the device under test is logged in through the target protocol according to the updated identification of the device under test, which can avoid the first device identification conflict problem when multiple devices under test are connected to the host at the same time. The host decompresses the device program file in the device under test to obtain the device program; starts the device program, performs a second test on the device under test, and obtains a second test result. The second test includes multiple test items, which can improve the test efficiency of the device under test and save the labor cost of the test.
[0092] In an exemplary embodiment, the method further includes: recording the first test result, the second test result, and the abnormal test result at fixed time intervals to obtain a test result set; and integrating the test result set.
[0093] The host program downloads the test result file of the device under test to the host through ftp or sftp at fixed intervals for each recorded temporary IP address of the device under test. The test result file includes the first test result, the second test result and the MAC address of the device under test, and the test result file is sorted and summarized and output to the log file of the host. For each abnormal device under test, further abnormal test or processing is performed on the abnormal device under test, and the abnormal test result is recorded to the host.
[0094] In this embodiment, the first test result, the second test result and the abnormal test result are recorded at fixed time intervals to obtain a test result set; the test result set is integrated, and common problems of the device under test can be quickly identified based on the integration results, thereby optimizing resource allocation in subsequent device tests and improving test efficiency.
[0095] In an exemplary embodiment, the method also includes: in an offline test environment, monitoring an already connected device under test; for the already connected device under test, when it is identified that the device under test is connected for the first time based on a first device identifier of the device under test, performing a first test on the device under test to obtain a first test result; uploading a device program file to the device under test, performing a second test on the device under test based on the device program file to obtain a second test result; and obtaining a target test result of the device under test based on the second test result and the first test result.
[0096] The offline test environment includes a host, a device under test, and a network cable. The host is directly connected to the device under test through a network cable, and the host can only be connected to one device under test at a time. A host program is running in the host to realize the main control. The host program uses, including but not limited to, ping, traceroute, nmap, mtr, etc., to detect the first device identifier (default IP address) of the device under test at fixed intervals to monitor whether there is access to the device under test. When it is detected that the device under test is connected to the host, the default IP address is used to log in to the device through protocols such as telnet, ssh, rlogin or mosh, query and record the MAC address of the device under test, and check whether the MAC address has been recorded in the host. If the MAC address of the device under test has not been recorded in the host, that is, the device under test is connected to the host for the first time, the network performance test tool client mode is started on the device, and the network performance test tool is used on the host to perform the first test (network transceiver test) on the device under test to obtain the first test result. The device program file is uploaded to the device under test through ftp or sftp, the device under test is logged in through protocols such as telnet, ssh, rlogin or mosh, the device program file is decompressed, the device program is started, and the device program performs a second test on the device under test to obtain a second test result. The second test result is recorded in the log file of the device under test, and the log file is placed in the temporary directory of the device under test. When the device under test is restarted, the log file is automatically discarded, so it does not affect the subsequent testing of the device under test and the use of the device under test.
[0097] In the previous exemplary embodiment, the method also includes: for the connected device under test, when it is identified that the device under test is not connected for the first time based on the first device identification of the device under test, determining whether the device under test has a program log; if the device under test has a program log, recording the program log file of the device under test; if the device under test does not have a program log, recording the device under test as an abnormal device; performing an abnormal test on the abnormal device to obtain an abnormal test result.
[0098] If the MAC address of the device under test has been recorded in the host, that is, the device under test is not connected to the host for the first time, then determine whether the device under test has a device program log file. If the device under test has a device program log file, it means that the device under test is under test, then the program log file of the device under test is downloaded to the host via ftp or sftp. The program log file contains the MAC address of the device under test, test results, etc. If the current test result of the device under test is failure, then the MAC address of the device under test is recorded, and further testing or processing is performed on the device under test.
[0099] If the device under test does not store a device program log file, it indicates that the device under test has abnormally restarted. The host program records the MAC address of the device under test and performs further testing or processing on the device under test.
[0100] In this embodiment, in an offline test environment, automated testing of multiple devices under test can be achieved without a switch, which can save testing costs, increase the number of devices tested simultaneously, and improve the accuracy of device testing.
[0101] In another embodiment, a device testing method is provided, the method comprising:
[0102] In an online test environment, multiple connected devices under test are monitored; multiple devices under test are connected through switches.
[0103] For each connected device under test, log in to the device under test through the target protocol according to the first device identification of the device under test; query the second device identification of the device under test, and detect whether the second device identification of the device under test has been recorded; if the second device identification of the device under test has been recorded, it is determined that the device under test is not connected for the first time; if the second device identification of the device under test has not been recorded, it is determined that the device under test is connected for the first time, perform a first test on the device under test, obtain a first test result, and modify the first device identification of the device under test to obtain an updated identification of the device under test.
[0104] For each connected device under test, when it is identified based on the first device identification of the device under test that the device under test is not connected for the first time and the first device identification of the device under test has not been modified, the device under test is recorded as an abnormal device; an abnormal test is performed on the abnormal device to obtain an abnormal test result.
[0105] Uploading the device program file to the device under test according to the update identifier, performing a second test on the device under test according to the device program file, and obtaining a second test result;
[0106] For each device under test after the first device identification is modified, the device under test is logged in through the target protocol according to the updated identification of the device under test; the device program file in the device under test is decompressed to obtain the device program; the device program is started, and a second test is performed on the device under test to obtain a second test result.
[0107] At fixed time intervals, the first test result, the second test result, and the abnormal test result are recorded to obtain a test result set; and the test result set is integrated.
[0108] The device testing method also includes: in an offline test environment, monitoring the connected device to be tested; for the connected device to be tested, when it is identified that the device to be tested is connected for the first time according to the first device identification of the device to be tested, performing a first test on the device to be tested to obtain a first test result; uploading a device program file to the device to be tested, performing a second test on the device to be tested according to the device program file to obtain a second test result; and obtaining a target test result of the device to be tested according to the second test result and the first test result.
[0109] For a connected device under test, when it is identified according to the first device identification of the device under test that the device under test is not connected for the first time, it is determined whether the device under test has a program log; if the device under test has a program log, the program log file of the device under test is recorded; if the device under test does not have a program log, the device under test is recorded as an abnormal device; an abnormal test is performed on the abnormal device to obtain an abnormal test result.
[0110] In this embodiment, for each connected device to be tested, the device to be tested is logged in through the target protocol according to the first device identification of the device to be tested, the second device identification of the device to be tested is queried, and it is detected whether the second device identification of the device to be tested has been recorded, so that the devices to be tested that may have problems or abnormalities can be screened out, thereby reducing the testing cost. If the second device identification of the device to be tested has been recorded, it is determined that the device to be tested is not connected for the first time, and when the first device identification of the device to be tested has not been modified, the device to be tested is recorded as an abnormal device, and further abnormal tests are performed on the abnormal device, which can simplify the testing process and improve the testing efficiency. If the second device identification of the device to be tested has not been recorded, it is determined that the device to be tested is connected for the first time, a first test is performed on the device to be tested, and the first device identification of the device to be tested is modified to obtain the updated identification of the device to be tested. The device to be tested is logged in through the target protocol according to the updated identification of the device to be tested, which can avoid the conflict problem of the first device identification when multiple devices to be tested are connected to the host at the same time. The host starts the device program and performs a second test on the device under test. The second test includes multiple test items, which can improve the test efficiency of the device under test and save the labor cost of the test. At fixed time intervals, the first test results, the second test results, and the abnormal test results are recorded to obtain a test result set; the test result set is integrated, and the common problems of the device under test can be quickly identified based on the integration results, thereby optimizing resource allocation in subsequent device tests and improving test efficiency. In an offline test environment, automated testing of multiple devices under test can be achieved without a switch, which can save test costs, increase the number of devices tested simultaneously, and improve the accuracy of device testing.
[0111] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0112] Based on the same inventive concept, the embodiment of the present application also provides a device testing apparatus for implementing the device testing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more device testing apparatus embodiments provided below can refer to the limitations on the device testing method above, and will not be repeated here.
[0113] In an exemplary embodiment, Figure 4 As shown, a device testing apparatus is provided, including: a monitoring module 402, a first testing module 404, a second testing module 406 and a determining module 408, wherein:
[0114] The monitoring module 402 is used to monitor multiple connected devices under test in an online test environment; the multiple devices under test are connected through a switch.
[0115] The first test module 404 is used for performing a first test on each connected device under test to obtain a first test result, and modifying the first device identification of the device under test to obtain an updated identification of the device under test when it is identified that the device under test is connected for the first time according to the first device identification of the device under test.
[0116] The second test module 406 is used to upload the device program file to the device under test according to the update identifier, perform a second test on the device under test according to the device program file, and obtain a second test result.
[0117] The determination module 408 is used to obtain a target test result of the device under test according to the second test result and the first test result.
[0118] In an exemplary embodiment, the first test module 404 is also used to log in to each connected device under test through the target protocol according to the first device identification of the device under test; query the second device identification of the device under test to detect whether the second device identification of the device under test has been recorded; if the second device identification of the device under test has been recorded, it is determined that the device under test is not connected for the first time; if the second device identification of the device under test has not been recorded, it is determined that the device under test is connected for the first time, and the first test is performed on the device under test.
[0119] In an exemplary embodiment, the device testing apparatus further includes:
[0120] The abnormality detection module is used for recording each connected device under test as an abnormal device when it is identified that the device under test is not connected for the first time and the first device identification of the device under test has not been modified according to the first device identification of the device under test; performing an abnormal test on the abnormal device to obtain an abnormal test result.
[0121] In an exemplary embodiment, the second test module 406 is also used to log in to the device under test through the target protocol according to the updated identification of the device under test for each device under test after the first device identification is modified; decompress the device program file in the device under test to obtain the device program; start the device program, perform a second test on the device under test, and obtain a second test result.
[0122] In an exemplary embodiment, the device testing apparatus further includes:
[0123] The integration module is used to record the first test result, the second test result and the abnormal test result at fixed time intervals to obtain a test result set; and integrate the test result set.
[0124] In an exemplary embodiment, the device testing apparatus further includes:
[0125] The offline test module is used to monitor the connected device under test in an offline test environment; for the connected device under test, when it is identified that the device under test is connected for the first time according to the first device identification of the device under test, a first test is performed on the device under test to obtain a first test result; a device program file is uploaded to the device under test, and a second test is performed on the device under test according to the device program file to obtain a second test result; a target test result of the device under test is obtained according to the second test result and the first test result.
[0126] In an exemplary embodiment, the offline test module is also used to determine whether there is a program log for the connected device under test when it is identified that the device under test is not connected for the first time based on the first device identification of the device under test; if there is a program log for the device under test, the program log file of the device under test is recorded; if there is no program log for the device under test, the device under test is recorded as an abnormal device; and an abnormal test is performed on the abnormal device to obtain an abnormal test result.
[0127] Each module in the above-mentioned device testing apparatus can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0128] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store test result data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a device testing method is implemented.
[0129] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0130] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0131] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0132] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0133] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0134] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0135] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0136] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A device testing method, characterized in that: The method comprises: In the online test environment, multiple connected devices under test are monitored; multiple devices under test are connected through switches; For each connected device under test, when it is identified that the device under test is connected for the first time according to the first device identification of the device under test, a first test is performed on the device under test to obtain a first test result, and the first device identification of the device under test is modified to obtain an updated identification of the device under test; the first test refers to performing a network receiving and sending test on each device under test that is connected for the first time; Uploading the device program file to the device under test according to the update identifier, performing a second test on the device under test according to the device program file, and obtaining a second test result; the second test on the device under test includes: testing the central processing unit, memory, storage chip, hard disk, video codec, picture codec, artificial intelligence module and encryption and decryption module of the device under test; A target test result of the device under test is obtained according to the second test result and the first test result.
2. The method according to claim 1, characterized in that When it is identified according to the first device identification of the device under test that the device under test is accessed for the first time, performing a first test on the device under test includes: Logging in to the device under test through a target protocol according to a first device identifier of the device under test; Querying the second device identification of the device under test to detect whether the second device identification of the device under test has been recorded; If the second device identification of the device under test has been recorded, it is determined that the device under test is not connected for the first time; If the second device identification of the device under test has not been recorded, it is determined that the device under test is connected for the first time, and a first test is performed on the device under test.
3. The method according to claim 1, characterized in that The method further comprises: For each connected device under test, when it is identified according to the first device identification of the device under test that the device under test is not connected for the first time and the first device identification of the device under test has not been modified, the device under test is recorded as an abnormal device; An abnormal test is performed on the abnormal device to obtain an abnormal test result.
4. The method according to claim 3, characterized in that The method further comprises: At fixed time intervals, the first test result, the second test result, and the abnormal test result are recorded to obtain a test result set; The test result sets are integrated.
5. The method according to claim 1, characterized in that The performing a second test on the device under test according to the device program file to obtain a second test result comprises: Logging into the device under test through a target protocol according to an update identifier of the device under test; Decompressing the device program file in the device under test to obtain the device program; The device program is started, a second test is performed on the device to be tested, and a second test result is obtained.
6. The method according to claim 1, characterized in that The method further comprises: In an offline test environment, monitor the connected device under test; For the connected device under test, when it is identified according to the first device identifier of the device under test that the device under test is connected for the first time, a first test is performed on the device under test to obtain a first test result; Uploading the device program file to the device under test, performing a second test on the device under test according to the device program file, and obtaining a second test result; A target test result of the device under test is obtained according to the second test result and the first test result.
7. The method according to claim 6, characterized in that The method further comprises: For the connected device under test, when it is identified according to the first device identifier of the device under test that the device under test is not connected for the first time, determining whether there is a program log for the device under test; If the device under test has a program log, then record the program log file of the device under test; If the device under test does not have a program log, the device under test is recorded as an abnormal device; an abnormal test is performed on the abnormal device to obtain an abnormal test result.
8. A device testing apparatus, characterized in that: The device comprises: The monitoring module is used to monitor multiple connected devices under test in an online test environment; multiple devices under test are connected through switches; The first test module is used for, for each connected device under test, when it is identified that the device under test is connected for the first time according to the first device identification of the device under test, performing a first test on the device under test to obtain a first test result, and modifying the first device identification of the device under test to obtain an updated identification of the device under test; the first test refers to performing a network receiving and sending test on each device under test that is connected for the first time; A second test module is used to upload the device program file to the device under test according to the update identifier, and perform a second test on the device under test according to the device program file to obtain a second test result; the second test on the device under test includes: testing the central processing unit, memory, storage chip, hard disk, video codec, picture codec, artificial intelligence module and encryption and decryption module of the device under test; A determination module is used to obtain a target test result of the device under test according to the second test result and the first test result.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. 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 7 are implemented.
Citation Information
Patent Citations
Test report generation method and device, computer equipment and storage medium
CN116048962A
Equipment testing method and device, computer equipment and storage medium
CN117331772A
Test method and device, computer equipment and storage medium
CN117827554A
Method and apparatus for batch testing of devices, and computer device and medium
WO2022179009A1
