Device testing method and system

By running the target program and recording relevant information during the test of electronic devices, the problem of the operating system being unable to perceive and record abnormal conditions when the operating system crashes, and the accuracy of the test results is improved.

CN114756411BActive Publication Date: 2025-05-09DONGGUAN RUIHANG DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210226140.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-08
Publication Date
2025-05-09
Estimated Expiration
2042-03-08

AI Technical Summary

Technical Problem

In the prior art, if the operating system crashes during the testing of electronic devices, the abnormal conditions cannot be sensed and recorded, resulting in inaccurate test results.

Method used

By running the target program in the device under test, the target program saves the first preset information when the device enters the test mode, saves the test time information every preset time during the test process, and saves the second preset information when exiting the test mode. After the device exits the test mode, the control device reads the test record file from the device and determines the test result of the device based on its content.

Benefits of technology

Ensure that any abnormalities that occur during the test of the device can be inferred and improve the accuracy of the test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756411B_ABST
    Figure CN114756411B_ABST
Patent Text Reader

Abstract

The present application discloses a device testing method and system, which belongs to the field of computer technology. It includes: the device under test enters the test mode and runs the target program, and the target program is used to save the first preset information in the test record file when the device under test enters the test mode, save the test time information in the test record file at preset time intervals during the test process of the device under test, and save the second preset information in the test record file when the device under test exits the test mode; the control device reads the test record file; the control device determines the test result of the device under test according to the test record file. The present application infers whether the device under test has an abnormality during the test process according to the test record file, and the content in the test record file ensures that all abnormal conditions of the device under test can be inferred, thereby improving the accuracy of the test results of the device under test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] The types and quantity of electronic devices are increasing day by day, and the performance of electronic devices has become a more concerned issue. Generally, after the electronic devices are produced, their stability and functionality will be tested to determine whether the operation of the electronic devices is stable and whether their functions are normal and sound.

[0003] In the related art, when an abnormal condition occurs during the test of an electronic device, the operating system of the electronic device will automatically record an abnormality log. Afterwards, the technician can check the abnormality log in the electronic device to determine whether the electronic device has an abnormal condition during operation.

[0004] However, the implementation of the above method relies on the normal operation of the operating system of the electronic device. If the operating system crashes for a period of time during operation, the operating system will not be able to sense and record any abnormal conditions during this period. In this case, the operating system crash problem itself cannot be sensed and recorded, resulting in inaccurate test results of the electronic device. Summary of the invention

[0005] The present application provides a device testing method and system, which can detect abnormal conditions that occur during the operation of the device. The technical solution is as follows:

[0006] In a first aspect, a device testing method is provided, the method comprising:

[0007] The device under test enters a test mode and runs a stored target program, wherein the target program is used to save first preset information in a test record file when the device under test enters the test mode, save test time information in the test record file at preset time intervals during the test process of the device under test, and save second preset information in the test record file when the device under test exits the test mode;

[0008] The control device reads the test record file from the device under test after the device under test exits the test mode;

[0009] The control device determines the test result of the device under test according to the test record file.

[0010] In the present application, the device under test enters the test mode and runs the stored target program. When the target program is running, it is used to save the first preset information in the test record file when the device under test enters the test mode, save the test time information in the test record file at preset time intervals during the test process of the device under test, and save the second preset information in the test record file when the device under test exits the test mode. That is to say, if the device under test can run the target program normally, the first preset information, multiple test time information and the second preset information will be saved in the test record file. The control device reads the test record file from the device under test after the device under test exits the test mode, and reversely infers whether the device under test runs the target program normally during the test process based on the content saved in the test record file, that is, infers whether the device under test runs normally during the test, so as to obtain the test result of the device under test. The content saved in the test record file ensures that any abnormal situation of the device under test during the test can be inferred, thereby improving the accuracy of the test result of the device under test.

[0011] Optionally, before the device under test enters the test mode and runs the stored target program, the method further includes:

[0012] If the device under test receives the test instruction, it executes the steps of entering the test mode and running the stored target program; or,

[0013] If the device under test detects a preset startup instruction file when it is turned on, the step of entering the test mode and running the stored target program is executed.

[0014] Optionally, before the device under test enters the test mode and runs the stored target program, the method further includes:

[0015] The control device writes the target program into the device under test.

[0016] Optionally, after the device under test exits the test mode and reads the test record file from the device under test, the control device further includes:

[0017] If the control device fails to read the test record file from the device under test, it is determined that the test result of the device under test is that a component failure occurs in the device under test during the test process.

[0018] Optionally, the control device determines the test result of the device under test according to the test record file, including:

[0019] If the control device fails to find the second preset information from the test record file, it determines that the test result of the device under test is that an irrecoverable exception occurs in the device under test before exiting the test mode.

[0020] Optionally, the control device determines the test result of the device under test according to the test record file, including:

[0021] If the control device finds the first preset information and the second preset information from the test record file, the control device determines the time difference between each two adjacent test time information in the multiple test time information in the test record file;

[0022] The control device determines the test result of the device under test according to the time difference between each two adjacent test time information in the multiple test time information in the test record file.

[0023] Optionally, the control device determines the test result of the device under test according to the time difference between each two adjacent test time information in the multiple test time information in the test record file, including:

[0024] If the time difference between each two adjacent test time information in the multiple test time information in the test record file is greater than the preset time length, the control device determines that the test result of the device under test is that the device under test has a transient abnormality during the test process;

[0025] If the time difference between each two adjacent test time information in the multiple test time information in the test record file is equal to the preset duration, the control device determines that the test result of the device under test is that the device under test operates normally.

[0026] In a second aspect, a device testing system is provided, the device testing system comprising a control device and a device under test;

[0027] The device under test is used to enter a test mode and run a stored target program, wherein the target program is used to save first preset information in a test record file when the device under test enters the test mode, save test time information in the test record file at preset time intervals during the test process of the device under test, and save second preset information in the test record file when the device under test exits the test mode;

[0028] The control device is used to read the test record file from the device under test after the device under test exits the test mode;

[0029] The control device is used to determine the test result of the device under test according to the test record file.

[0030] Optionally, the device under test is used for:

[0031] If a test instruction is received, the step of entering the test mode and running the stored target program is executed; or,

[0032] If the preset startup instruction file is detected when the computer is turned on, the steps of entering the test mode and running the stored target program are executed.

[0033] Optionally, the control device is used to:

[0034] Writing the target program into the device under test.

[0035] Optionally, the control device is used to:

[0036] If reading the test record file from the device under test fails, it is determined that the test result of the device under test is that a component failure occurs in the device under test during the test process.

[0037] Optionally, the control device is used to:

[0038] If the second preset information is not found in the test record file, it is determined that the test result of the device under test is that an irrecoverable exception occurs in the device under test before exiting the test mode.

[0039] Optionally, the control device is used to:

[0040] If the first preset information and the second preset information are found in the test record file, then determining the time difference between each two adjacent test time information in the plurality of test time information in the test record file;

[0041] The test result of the device under test is determined according to the time difference between each two adjacent test time information in the multiple test time information in the test record file.

[0042] Optionally, the control device is used to:

[0043] If the time difference between each two adjacent test time information in the multiple test time information in the test record file is greater than the preset time length, it is determined that the test result of the device under test is that the device under test has a transient abnormality during the test process;

[0044] If the time difference between each two adjacent test time information in the multiple test time information in the test record file is equal to the preset duration, it is determined that the test result of the device under test is that the device under test operates normally.

[0045] It can be understood that the beneficial effects of the second aspect mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be 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 creative work.

[0047] Figure 1 is a schematic diagram of a device testing system provided in an embodiment of the present application;

[0048] Figure 2 is a flow chart of a device testing method provided in an embodiment of the present application;

[0049] Figure 3 It is a scene diagram of a device testing method provided in an embodiment of the present application;

[0050] Figure 4 is a flow chart of another device testing method provided in an embodiment of the present application;

[0051] Figure 5 is a flow chart of another device testing method provided in an embodiment of the present application;

[0052] Figure 6 is a structural schematic diagram of a device testing device provided in an embodiment of the present application;

[0053] Figure 7 is a structural schematic diagram of another device testing device provided in an embodiment of the present application;

[0054] Figure 8 is a structural schematic diagram of a computer device provided in an embodiment of the present application;

[0055] Fig. 9 It is a structural diagram of another computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0057] It should be understood that the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, the words "first" and "second" are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not limit them to be different.

[0058] Before explaining the embodiments of the present application in detail, the application scenarios of the embodiments of the present application are first described.

[0059] In order to ensure that users can use the equipment normally, the equipment is generally tested before leaving the factory to evaluate whether there are any abnormal conditions during operation.

[0060] The device testing method provided in the embodiment of the present application is applied to the scenario of testing the device. Specifically, the built-in target program can be run when testing the device, and the operation status of the device can be determined according to the operation status of the target program.

[0061] The device testing method provided in the embodiment of the present application is that the control device reads the test record file obtained after the device under test runs the target program during the test process from the device under test, and the control device can reversely infer whether the device under test runs the target program normally during the test process based on the content stored in the test record file. Specifically, if the content in the test record file is normal, it can be determined that the device under test runs the target program normally. If the content in the test record file is abnormal, it can be determined that the device under test does not run the target program normally, so that the abnormal conditions that occurred in the device under test during the test process can be inferred. The content stored in the test record file ensures that any abnormal conditions that occurred in the device under test during the test process can be inferred, thereby improving the accuracy of the test results of the device under test.

[0062] The system architecture involved in the embodiments of the present application is described below.

[0063] Figure 1 Schematic diagram of a device testing system provided in an embodiment of the present application. Figure 1 The device testing system includes: a device under test 101 and a control device 102.

[0064] The device under test 101 is used to run the stored target program when entering the test mode. For example, the device under test 101 can be a desktop computer, a portable computer, a handheld computer, a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device, or can be other devices that can enter the test mode and run the stored target program, which is not limited in the embodiments of the present application.

[0065] The control device 102 is used to read the test record file from the device under test 101 after the test of the device under test 101 is completed, and determine the test result of the device under test 101 according to the test record file. For example, the control device 102 can be a desktop computer, a portable computer, a handheld computer, etc., or can be other devices that can read the test record file and determine the test result according to the test record file, which is not limited in the embodiment of the present application.

[0066] The device under test 101 can communicate with the control device 102 via a wired connection or a wireless connection. Specifically, the device under test 101 enters a test mode and runs a stored target program. After the device under test 101 exits the test mode, the control device 102 reads a test record file from the device under test 101 and determines the test result of the device under test 101 according to the test record file.

[0067] The device under test 101 and the control device 102 may execute the following Figure 2 The device testing method described in the embodiment is used to determine abnormal conditions that occur during the testing of the device under test 101, thereby improving the accuracy of the test results of the device under test 101.

[0068] The device testing method provided in the embodiment of the present application is explained in detail below.

[0069] Figure 2 is a flow chart of a device testing method provided by an embodiment of the present application. Figure 2 , the method comprises the following steps.

[0070] Step 201: The device under test enters a test mode and runs a stored target program. When the target program is running, it is used to save first preset information in the test record file when the device under test enters the test mode, save test time information in the test record file at preset time intervals during the test process of the device under test, and save second preset information in the test record file when the device under test exits the test mode.

[0071] The test mode is a mode used for testing. After the device under test enters the test mode, it starts to perform relevant test operations to test the stability, functionality, etc. of the device under test.

[0072] The test record file is a file specifically used to store the first preset information, the test time information, and the second preset information. The test record file can be a file originally existing in the device under test, or a new file created when the device under test enters the test mode. The test record file can be stored in a storage device (such as a memory) of the device under test, and of course, can also be stored in other devices of the device under test, which is not limited in the embodiments of the present application.

[0073] The first preset information is a start test flag, which is used to indicate that the device under test enters the test mode and starts testing. The first preset information can be set in advance, for example, the first preset information can be set to a string, such as "start up".

[0074] The preset duration can be set in advance, and the preset duration can be set to be relatively small to ensure that the time intervals of the multiple test time information stored in the test record file are relatively small. For example, the preset duration can be set to 100 ms (milliseconds).

[0075] The test time information is a timestamp, that is, the test time information is the current time at which the test time information is saved. For example, the timestamp can be the current system time of the device under test, and the system time is accurate to milliseconds, such as the timestamp can be 08:30:30:100. Alternatively, the timestamp can also be the CPU (central processing unit) clock value of the device under test, such as the timestamp can be 100ms, 200ms, etc. If the test time information is normally saved every preset time length, the time interval between two adjacent test time information saved is the preset time length.

[0076] The second preset information is an end test flag, which is used to indicate that the device under test exits the test mode and ends the test. The second preset information can be set in advance. For example, the second preset information can be set to a string, such as "endup".

[0077] The target program is a program that runs when the device under test is tested. Optionally, before the device under test enters the test mode and runs the stored target program, the target program is written into the device under test so that the device under test runs the target program when entering the test mode.

[0078] Optionally, the device that writes the target program into the device under test may be a control device, or may be other devices that can write a program into another device, which is not limited in the embodiments of the present application.

[0079] The device under test enters the test mode and runs the target program written in advance, that is, the device under test saves the first preset information in the test record file when entering the test mode, the device under test saves the test time information in the test record file at preset intervals during the test process, and the device under test saves the second preset information in the test record file when exiting the test mode. In this way, if the device under test can run the target program normally, the first preset information, multiple test time information and the second preset information will be saved in the test record file, and the multiple test time information is saved at each preset interval. If the device under test does not run the target program normally, the content saved in the test record file will be abnormal.

[0080] Optionally, the device under test can enter the test mode in a variety of possible ways, two of which are described below:

[0081] In the first way, if the device under test receives a test instruction, it executes the steps of entering a test mode and running a stored target program, that is, executing step 201 .

[0082] The test instruction is used to instruct the device under test to start testing, that is, to instruct the device under test to enter a test mode. The test instruction received by the device under test may be sent by a control device to the device under test, or may be sent by a technician to the device under test.

[0083] Optionally, the control device may send the test instruction to the device under test in the following manner: the control device and the device under test are connected via a serial port, and the control device sends the test instruction to the device under test via the serial port.

[0084] Optionally, the technician may send the test instruction to the device under test by clicking a test button on a remote controller to trigger the remote controller to send the test instruction to the device under test.

[0085] In this case, the method of starting the test after the device under test receives the test instruction can improve the test flexibility of the device under test, that is, the test can be performed at any time after the device under test is turned on.

[0086] In the second mode, if the device under test detects a preset startup instruction file when it is turned on, it executes the steps of entering the test mode and running the stored target program, that is, executing step 201 .

[0087] The preset startup instruction file is a preset file, which can be pre-stored in a USB flash drive, and is used to instruct the device under test to enter the test mode. For example, the name of the preset startup instruction file can be "TEST.START.CTV".

[0088] Before testing the device under test, the technician will connect the USB flash drive that stores the preset startup instruction file to the device under test and place the device under test on the test line. When the device under test is turned on, it will automatically detect the preset startup instruction file in the USB flash drive, so that the device under test can enter the test mode and start testing.

[0089] In this case, the device under test automatically detects the preset startup instruction file when it is powered on to enter the test mode, which is simple to operate, thereby reducing equipment investment and saving equipment resources.

[0090] Step 202: After the device under test exits the test mode, the control device reads the test record file from the device under test.

[0091] Optionally, after the device under test exits the test mode, the control device reads the test record file from the device under test by reading through a USB (Universal Serial Bus), reading through a serial port, or reading through a network cable, etc., which is not limited to the embodiments of the present application.

[0092] Optionally, if the control device fails to read the test record file from the device under test, it is determined that the test result of the device under test is that a component failure occurs in the device under test during the test process.

[0093] This device failure refers to the failure of the device under test caused by device damage in the hardware system of the device under test.

[0094] Generally speaking, when a device has a component failure, it is very likely that the device system will not be able to start, that is, the device cannot be turned on. In this case, the control device and the device under test will not be able to communicate normally. Then, when the control device reads the test record file from the device under test, a reading failure will occur.

[0095] In this case, if the control device fails to read the test record file from the device under test, it means that the control device and the device under test cannot communicate normally, indicating that a device failure occurs in the device under test after the test is completed.

[0096] Optionally, if the control device successfully reads the test record file from the device under test, the control device may continue to execute the following step 203 according to the test record file to determine whether an abnormal situation occurs in the device under test during the test process.

[0097] Step 203: The control device determines the test result of the device under test according to the test record file.

[0098] The test result is used to indicate whether the device under test operates normally during the test process, and if the device under test operates abnormally, what abnormal conditions have occurred.

[0099] Since the device under test runs the target program during the test process, and the target program runs normally, the first preset information will be saved in the test record file when entering the test mode, the test time information will be saved in the test record file at preset time intervals during the test process, and the second preset information will be saved in the test record file when exiting the test mode. Therefore, if the device under test can run the target program normally, the first preset information, multiple test time information and the second preset information will be saved in the test record file, and the multiple test time information are saved at each preset time interval. Then the control device can determine the test result of the device under test based on the content saved in the test record file.

[0100] In this case, the control device can infer whether the device under test runs the target program normally during the test process based on the content saved in the test record file, that is, it can infer whether the device under test runs normally during the test. The content saved in the test record file ensures that any abnormal situation that occurs in the device under test during the test can be inferred, thereby improving the accuracy of the test results of the device under test.

[0101] Specifically, the operation of step 203 may include the following two situations.

[0102] In the first case, if the control device fails to find the second preset information from the test record file, it determines that the test result of the device under test is that an irrecoverable abnormality occurs in the device under test before exiting the test mode.

[0103] The irrecoverable exception refers to the situation that the system of the device under test freezes and cannot automatically recover after the freeze.

[0104] In this case, if the control device fails to find the second preset information from the test record file, it means that the device under test did not save the second preset information in the test record file when exiting the test mode, and the device under test did not operate normally when exiting the test mode. It can be inferred that the device under test crashed before exiting the test mode and did not automatically resume operation when exiting the test mode. In this way, it can be determined that the test result of the device under test is that an irrecoverable abnormality occurred in the device under test before exiting the test mode.

[0105] In the second case, if the control device finds the first preset information and the second preset information from the test record file, it determines the time difference between each adjacent two test time information in the multiple test time information in the test record file; and determines the test result of the device under test based on the time difference between each adjacent two test time information in the multiple test time information in the test record file.

[0106] In this case, if the control device finds the first preset information and the second preset information from the test record file, indicating that the device under test can operate normally when entering the test mode and exiting the test mode, it is only necessary to determine whether the device under test has an abnormal situation during the test process based on the multiple test time information. In this way, the time difference between each adjacent two test time information in the multiple test time information in the test record file is determined, and based on the time difference between each adjacent two test time information in the multiple test time information in the test record file, a relatively minor abnormal situation that occurred in the device under test during the test process can be determined.

[0107] Among them, the operation of determining the test result of the device under test based on the time difference between each two adjacent test time information in the multiple test time information in the test record file can be: if the time difference between each two adjacent test time information in the multiple test time information in the test record file is greater than the preset time length, the control device determines that the test result of the device under test is that the device under test has a transient abnormality during the test process; if the time difference between each two adjacent test time information in the multiple test time information in the test record file is equal to the preset time length, the control device determines that the test result of the device under test is that the device under test is operating normally.

[0108] This transient anomaly refers to an abnormal situation in which the device under test freezes during the test or can automatically resume operation after a crash.

[0109] In this case, if the time difference between each two adjacent test time information in the multiple test time information in the test record file is greater than the preset time length, it means that the device under test did not normally save the test time information to the test record file at intervals of the preset time length during the test process, thereby indicating that the device under test was temporarily unable to operate normally during the test process, and may have been stuck or frozen. However, the presence of the second preset information in the test record file indicates that even if the device under test was frozen, it automatically resumed operation after the freeze, so that it can be determined that the test result of the device under test is that the device under test had a temporary abnormality during the test process. If the time difference between each two adjacent test time information in the multiple test time information in the test record file is equal to the preset time length, it means that each of the multiple test time information is saved to the test record file at intervals of the preset time length, so that it can be determined that the test result of the device under test is that the device under test is operating normally.

[0110] Optionally, when the control device determines the test result of the device under test according to the test record file, a prompt window can be displayed on the screen of the control device to prompt the technician of the test result of the device under test. For example, the control device first traverses the test record file, and after the traversal, a prompt message is displayed in the prompt window, and the prompt message includes the first preset information found, multiple test time information, and the second preset information, or is used to prompt that the first preset information, multiple test time information, and the second preset information have been found. After that, the control device determines whether there is a time difference greater than the preset time length in the time difference between each adjacent two test time information in the multiple test time information. If it does not exist after calculation, a pass mark is displayed in the prompt window to indicate that the device under test is operating normally. After that, the technician can select the OK button in the prompt window to complete the test of the device under test.

[0111] Furthermore, after the control device determines the test result of the device under test according to the test record file, the test result of the device under test may be uploaded to the server for storage, so as to facilitate the technicians to view the test result of the device under test.

[0112] It is worth noting that the device testing method provided in the embodiment of the present application does not require a technician to monitor the entire testing process of the device under test, and does not require a monitoring device to be placed on the test line to collect and analyze the status of the device under test, thereby solving the fatigue problem of the technician monitoring the testing process of the device under test for a long time and reducing the cost of investing in monitoring equipment, thereby making the entire testing process simple to implement and low in investment cost. In addition, the device testing method provided in the embodiment of the present application solves the problem that when the operating system of the device under test crashes and freezes, the operating system cannot perceive the abnormal condition of the crash and cannot obtain any abnormal condition, thereby improving the accuracy of the test results of the device under test.

[0113] For ease of understanding, the following takes the device under test as an example, combined with Figure 3 Let's take an example to illustrate the above equipment testing method.

[0114] See also Figure 3 The scene graph of the device test method shown, Figure 3 The device testing method includes a mobile phone 301 to be tested, a control device 302 and a server 303. The mobile phone 301 to be tested communicates with the control device 302, and the control device 302 communicates with the server 303. The process of the device testing method is as follows:

[0115] (1) After the mobile phone 301 to be tested is assembled, the technician places the mobile phone 301 to be tested on the test assembly line and powers on the mobile phone 301 to be tested.

[0116] (2) After receiving the test instruction or detecting the preset startup instruction file, the mobile phone 301 under test enters the test mode and runs the stored target program, that is, the mobile phone 301 under test saves the first preset information in the test log file when entering the test mode, the mobile phone 301 under test saves the test time information in the test log file at preset time intervals during the test process, and the mobile phone 301 under test saves the second preset information in the test log file when exiting the test mode.

[0117] (3) After the mobile phone 301 under test finishes the test, the control device 302 reads the test record file from the mobile phone 301 under test.

[0118] (4) The control device 302 determines the test result of the mobile phone 301 to be tested according to the test record file.

[0119] (5) The control device 302 uploads the test result of the mobile phone 301 to the server 303 for storage, so that the technicians can view it easily.

[0120] In an embodiment of the present application, the device under test enters a test mode and runs a stored target program. When the target program is running, it is used to save the first preset information in the test record file when the device under test enters the test mode, save the test time information in the test record file at preset time intervals during the test process of the device under test, and save the second preset information in the test record file when the device under test exits the test mode. That is, if the device under test can run the target program normally, the first preset information, multiple test time information and the second preset information will be saved in the test record file. The control device reads the test record file from the device under test after the device under test exits the test mode, and reversely infers whether the device under test runs the target program normally during the test process based on the content saved in the test record file, that is, infers whether the device under test runs normally during the test, so as to obtain the test result of the device under test. The content saved in the test record file ensures that any abnormal situation of the device under test during the test can be inferred, thereby improving the accuracy of the test result of the device under test.

[0121] Figure 4 is a flow chart of a device testing method provided in an embodiment of the present application. The method is applied to control the device. Figure 4 , the method comprises the following steps:

[0122] Step 401: After the device under test exits the test mode, a test record file is read from the device under test, the test record file being obtained after the device under test enters the test mode and runs a stored target program, and the target program is used to save first preset information in the test record file when the device under test enters the test mode, save test time information in the test record file at preset time intervals during the test process of the device under test, and save second preset information in the test record file when the device under test exits the test mode.

[0123] The relevant contents of step 401 have been described in detail in steps 201 and 202, and will not be repeated in the embodiment of the present application.

[0124] Step 402: Determine the test result of the device under test according to the test record file.

[0125] The relevant contents of step 402 have been described in detail in step 203 and will not be repeated in this embodiment of the present application.

[0126] In an embodiment of the present application, the device under test enters a test mode and runs a stored target program. When the target program is running, it is used to save the first preset information in the test record file when the device under test enters the test mode, save the test time information in the test record file at preset time intervals during the test process of the device under test, and save the second preset information in the test record file when the device under test exits the test mode. That is, if the device under test can run the target program normally, the first preset information, multiple test time information and the second preset information will be saved in the test record file. The control device reads the test record file from the device under test after the device under test exits the test mode, and reversely infers whether the device under test runs the target program normally during the test process based on the content saved in the test record file, that is, infers whether the device under test runs normally during the test, so as to obtain the test result of the device under test. The content saved in the test record file ensures that any abnormal situation of the device under test during the test can be inferred, thereby improving the accuracy of the test result of the device under test.

[0127] Figure 5 is a flow chart of a device testing method provided in an embodiment of the present application. The method is applied to the device under test. Figure 5 , the method comprises the following steps:

[0128] Step 501: The device under test enters a test mode.

[0129] The relevant contents of step 501 have been described in detail in step 201 and will not be repeated in this embodiment of the present application.

[0130] Step 502: The device under test runs a target program. When the target program is running, it is used to save first preset information in a test record file when the device under test enters the test mode, save test time information in the test record file at preset time intervals during the test process of the device under test, and save second preset information in the test record file when the device under test exits the test mode. The test record file is used to determine the test result of the device under test after the device under test exits the test mode.

[0131] The relevant contents of step 502 have been described in detail in steps 201, 202 and 203, and will not be repeated in the embodiments of the present application.

[0132] In an embodiment of the present application, the device under test enters a test mode and runs a stored target program. When the target program is running, it is used to save the first preset information in the test record file when the device under test enters the test mode, save the test time information in the test record file at preset intervals during the test process of the device under test, and save the second preset information in the test record file when the device under test exits the test mode. In other words, if the device under test can run the target program normally, the first preset information, multiple test time information, and the second preset information will be saved in the test record file. After the device under test exits the test mode, it can be reversely inferred whether the device under test runs the target program normally during the test process based on the content saved in the test record file, that is, it can be inferred whether the device under test runs normally during the test, so as to obtain the test result of the device under test. The content saved in the test record file ensures that any abnormal situation of the device under test during the test can be inferred, thereby improving the accuracy of the test result of the device under test.

[0133] Figure 6 1 is a schematic diagram of a device testing apparatus provided in an embodiment of the present application. The device testing apparatus is applied to control equipment. The device testing apparatus can be implemented as part or all of a computer device by software, hardware, or a combination of both. The computer device can be as follows: Figure 8 Computer equipment shown. Figure 6 The device includes: a reading module 601 and a first determining module 602.

[0134] A reading module 601 is used to read a test record file from the device under test after the device under test exits the test mode, wherein the test record file is obtained after the device under test enters the test mode and runs a stored target program, and when the target program is running, it is used to save first preset information in the test record file when the device under test enters the test mode, save test time information in the test record file at preset time intervals during the test process of the device under test, and save second preset information in the test record file when the device under test exits the test mode;

[0135] The first determining module 602 is used to determine the test result of the device under test according to the test record file.

[0136] Optionally, the device further comprises:

[0137] The writing module is used to write the target program into the device under test.

[0138] Optionally, the device further comprises:

[0139] The second determination module is used to determine, if reading the test record file from the device under test fails, that the test result of the device under test is a component failure of the device under test during the test process.

[0140] Optionally, the first determining module 602 is used to:

[0141] If the second preset information is not found in the test record file, it is determined that the test result of the device under test is that an irrecoverable abnormality occurs in the device under test before exiting the test mode.

[0142] Optionally, the first determining module 602 includes:

[0143] A first determining unit, configured to determine a time difference between each two adjacent test time information in a plurality of test time information in the test record file if the first preset information and the second preset information are found in the test record file;

[0144] The second determining unit is used to determine the test result of the device under test according to the time difference between each two adjacent test time information in the multiple test time information in the test record file.

[0145] Optionally, the second determining unit is used to:

[0146] If the time difference between each two adjacent test time information in the multiple test time information in the test record file is greater than the preset time length, the control device determines that the test result of the device under test is that the device under test has a transient abnormality during the test process;

[0147] If the time difference between each two adjacent test time information in the multiple test time information in the test record file is equal to the preset time length, the control device determines that the test result of the device under test is that the device under test operates normally.

[0148] In an embodiment of the present application, the device under test enters a test mode and runs a stored target program. When the target program is running, it is used to save the first preset information in the test record file when the device under test enters the test mode, save the test time information in the test record file at preset time intervals during the test process of the device under test, and save the second preset information in the test record file when the device under test exits the test mode. That is, if the device under test can run the target program normally, the first preset information, multiple test time information and the second preset information will be saved in the test record file. The control device reads the test record file from the device under test after the device under test exits the test mode, and reversely infers whether the device under test runs the target program normally during the test process based on the content saved in the test record file, that is, infers whether the device under test runs normally during the test, so as to obtain the test result of the device under test. The content saved in the test record file ensures that any abnormal situation of the device under test during the test can be inferred, thereby improving the accuracy of the test result of the device under test.

[0149] Figure 7 1 is a schematic diagram of a device testing apparatus provided in an embodiment of the present application. The device testing apparatus is applied to a device under test. The device testing apparatus can be implemented as part or all of a computer device by software, hardware, or a combination of both. The computer device can be Fig. 9 Computer equipment shown. Figure 7 The device includes: an entry module 701 and an operation module 702.

[0150] Enter module 701, used to enter the test mode.

[0151] The running module 702 is used to run the target program. When the target program is running, it is used to save the first preset information in the test record file when the device under test enters the test mode, save the test time information in the test record file at preset time intervals during the test process of the device under test, and save the second preset information in the test record file when the device under test exits the test mode. The test record file is used to determine the test result of the device under test after the device under test exits the test mode.

[0152] Optionally, the device further comprises:

[0153] A first trigger module is configured to trigger the entry module 701 to execute a step of entering a test mode if a test instruction is received; or

[0154] The second trigger module is used to trigger the entry module 701 to execute the step of entering the test mode if a preset startup instruction file is detected when the computer is turned on.

[0155] In an embodiment of the present application, the device under test enters a test mode and runs a stored target program. When the target program is running, it is used to save the first preset information in the test record file when the device under test enters the test mode, save the test time information in the test record file at preset intervals during the test process of the device under test, and save the second preset information in the test record file when the device under test exits the test mode. In other words, if the device under test can run the target program normally, the first preset information, multiple test time information, and the second preset information will be saved in the test record file. After the device under test exits the test mode, it can be reversely inferred whether the device under test runs the target program normally during the test process based on the content saved in the test record file, that is, it can be inferred whether the device under test runs normally during the test, so as to obtain the test result of the device under test. The content saved in the test record file ensures that any abnormal situation of the device under test during the test can be inferred, thereby improving the accuracy of the test result of the device under test.

[0156] It should be noted that: when the equipment testing device provided in the above embodiment tests the equipment, it only uses the division of the above-mentioned functional modules as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0157] The functional units and modules in the above embodiments may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the above integrated units may be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.

[0158] The equipment testing device and equipment testing method embodiments provided in the above embodiments belong to the same concept. The specific working process of the units and modules in the above embodiments and the technical effects brought about can be found in the method embodiment part and will not be repeated here.

[0159] Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 8 As shown, the computer device 8 includes: a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and executable on the processor 80. When the processor 80 executes the computer program 82, the steps executed by the control device in the device testing method in the above embodiment are implemented.

[0160] The computer device 8 may be a general-purpose computer device or a dedicated computer device. In a specific implementation, the computer device 8 may be a desktop computer, a portable computer, a handheld computer, etc. The embodiment of the present application does not limit the type of the computer device 8. Those skilled in the art will understand that Figure 8 It is only an example of the computer device 8 and does not constitute a limitation on the computer device 8. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, etc.

[0161] The processor 80 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0162] In some embodiments, the memory 81 may be an internal storage unit of the computer device 8, such as a hard disk or memory of the computer device 8. In other embodiments, the memory 81 may also be an external storage device of the computer device 8, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 8. Further, the memory 81 may also include both an internal storage unit and an external storage device of the computer device 8. The memory 81 is used to store an operating system, an application program, a boot loader, data, and other programs. The memory 81 may also be used to temporarily store data that has been output or is to be output.

[0163] Fig. 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig. 9 As shown, the computer device 9 includes: a processor 90, a memory 91, and a computer program 92 stored in the memory 91 and executable on the processor 90. When the processor 90 executes the computer program 92, the steps executed by the device under test in the device testing method in the above embodiment are implemented.

[0164] The computer device 9 may be a general-purpose computer device or a dedicated computer device. In a specific implementation, the computer device 9 may be a desktop computer, a portable computer, a handheld computer, a mobile phone, a tablet computer, etc. The embodiment of the present application does not limit the type of the computer device 9. Those skilled in the art will understand that Fig. 9 It is only an example of the computer device 9 and does not constitute a limitation on the computer device 9. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, etc.

[0165] The processor 90 may be a central processing unit, or may be other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0166] In some embodiments, the memory 91 may be an internal storage unit of the computer device 9, such as a hard disk or memory of the computer device 9. In other embodiments, the memory 91 may also be an external storage device of the computer device 9, such as a plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, etc. equipped on the computer device 9. Further, the memory 91 may also include both an internal storage unit of the computer device 9 and an external storage device. The memory 91 is used to store an operating system, an application program, a boot loader, data, and other programs. The memory 91 may also be used to temporarily store data that has been output or is to be output.

[0167] An embodiment of the present application also provides a computer device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, and when the processor executes the computer program, the steps in any of the above-mentioned method embodiments are implemented.

[0168] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0169] An embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the steps in the above-mentioned method embodiments.

[0170] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above method embodiments, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk and optical data storage device. The computer-readable storage medium mentioned in the present application can be a non-volatile storage medium, in other words, it can be a non-transient storage medium.

[0171] It should be understood that all or part of the steps to implement the above embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions can be stored in the above-mentioned computer readable storage medium.

[0172] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0173] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0174] In the embodiments provided in the present application, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0175] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0176] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A device testing method, characterized in that: The method comprises: The device under test enters a test mode and runs a stored target program, wherein the target program is used to save first preset information in a test record file when the device under test enters the test mode, save test time information in the test record file at preset time intervals during the test process of the device under test, and save second preset information in the test record file when the device under test exits the test mode; The control device reads the test record file from the device under test after the device under test exits the test mode; The control device determines the test result of the device under test according to the test record file; The control device determines the test result of the device under test according to the test record file, including: If the control device finds the first preset information and the second preset information from the test record file, the control device determines the time difference between each two adjacent test time information in the multiple test time information in the test record file; The control device determines the test result of the device under test according to the time difference between each two adjacent test time information in the multiple test time information in the test record file.

2. The method according to claim 1, characterized in that Before the device under test enters the test mode and runs the stored target program, the method further includes: If the device under test receives the test instruction, it executes the steps of entering the test mode and running the stored target program; or, If the device under test detects a preset startup instruction file when it is turned on, the step of entering the test mode and running the stored target program is executed.

3. The method according to claim 1, characterized in that Before the device under test enters the test mode and runs the stored target program, the method further includes: The control device writes the target program into the device under test.

4. The method according to any one of claims 1 to 3, characterized in that: After the device under test exits the test mode, the control device reads the test record file from the device under test, further comprising: If the control device fails to read the test record file from the device under test, it is determined that the test result of the device under test is that a component failure occurs in the device under test during the test process.

5. The method according to any one of claims 1 to 3, characterized in that: The control device determines the test result of the device under test according to the test record file, including: If the control device fails to find the second preset information from the test record file, it determines that the test result of the device under test is that an irrecoverable exception occurs in the device under test before exiting the test mode.

6. The method according to claim 1, characterized in that The control device determines the test result of the device under test according to the time difference between each two adjacent test time information in the plurality of test time information in the test record file, including: If the time difference between each two adjacent test time information in the multiple test time information in the test record file is greater than the preset time length, the control device determines that the test result of the device under test is that the device under test has a transient abnormality during the test process; If the time difference between each two adjacent test time information in the multiple test time information in the test record file is equal to the preset duration, the control device determines that the test result of the device under test is that the device under test operates normally.

7. A device testing system, characterized in that: The device testing system comprises a control device and a device under test; The device under test is used to enter a test mode and run a stored target program, wherein the target program is used to save first preset information in a test record file when the device under test enters the test mode, save test time information in the test record file at preset time intervals during the test process of the device under test, and save second preset information in the test record file when the device under test exits the test mode; The control device is used to read the test record file from the device under test after the device under test exits the test mode; The control device is used to determine the test result of the device under test according to the test record file; The control device is further configured to determine a time difference between each two adjacent test time information in a plurality of test time information in the test record file if the first preset information and the second preset information are found in the test record file; The test result of the device under test is determined according to the time difference between each two adjacent test time information in the multiple test time information in the test record file.

8. The device testing system according to claim 7, characterized in that: The control device is used to determine that the test result of the device under test is that a component failure occurs in the device under test during the test process if reading the test record file from the device under test fails.

9. The device testing system according to claim 7 or 8, characterized in that: The control device is used to determine that the test result of the device under test is that an irrecoverable exception occurs in the device under test before exiting the test mode if the second preset information is not found in the test record file.

Citation Information

Patent Citations

  • Method and device for detecting performance of network equipment

    CN107342917A

  • Test method and electronic equipment

    CN111208363A