Equipment testing method and device, electronic equipment and readable storage medium
By sending automated control signals to the start pin of the device to be tested and combining network testing, the problem of high labor and time cost of equipment stability testing is solved, and the automation and equipment protection of equipment testing is realized.
Patent Information
- Application Number
- CN202510061040.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-05-02
AI Technical Summary
Existing equipment stability testing requires frequent manual control of power switches, resulting in higher labor and time costs.
Automatic restart control is achieved by sending shutdown and power-on signals to the start pin of the device to be tested, and stability testing is carried out in an automated manner in combination with network testing.
The labor and time cost of equipment testing is reduced, the equipment stability testing is automated, and the equipment to be tested is protected by setting a preset time.
Smart Images

Figure CN119917415A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a device testing method, device, electronic equipment and readable storage medium. Background Art
[0002] With the development of computer technology, more and more computer products and equipment have emerged. In order to ensure the stability of the equipment, stability testing is required after the equipment is produced. Stability testing requires frequent startup and shutdown of the equipment.
[0003] Currently, the stability test of equipment is usually carried out by manually controlling the power switch of the equipment, which has high manpower and time costs. Summary of the invention
[0004] The present invention provides a device testing method, an apparatus, an electronic device and a readable storage medium, so as to solve the problem of how to reduce the cost of device testing.
[0005] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:
[0006] In a first aspect, the present invention provides a device testing method, characterized in that the method comprises:
[0007] In response to starting a test operation on the device to be tested, sending a shutdown signal to a start pin of the device to be tested, and sending a startup signal to the start pin when a duration of sending the shutdown signal reaches a first preset duration;
[0008] Performing a network test on the device to be tested;
[0009] When the network test result meets the requirement, the operation of sending a shutdown signal to the start pin of the device to be tested is performed again.
[0010] Optionally, the method further comprises: creating test parameters in response to starting a test operation on the device to be tested;
[0011] When the network test result meets the requirement, re-performing the operation of sending a shutdown signal to the device to be tested includes:
[0012] When the network test result meets the requirement, the test parameter is increased by 1, and the operation of sending a shutdown signal to the device to be tested is performed again.
[0013] Optionally, performing a network test on the device to be tested includes:
[0014] Detecting whether the current parameter value of the test parameter is less than a preset test threshold;
[0015] When the current parameter value is less than the preset test threshold, performing a network test on the device to be tested;
[0016] When the current parameter value is not less than the preset test threshold, a first prompt message is generated and printed, and a shutdown signal is sent to the start pin of the device to be tested; the first prompt message is used to indicate that the device to be tested meets the test requirements.
[0017] Optionally, detecting whether the current parameter value of the test parameter is less than a preset test threshold value includes:
[0018] When the duration of sending the power-on signal reaches a second preset duration, it is detected whether the current parameter value of the test parameter is less than a preset test threshold.
[0019] Optionally, performing a network test on the device to be tested includes:
[0020] Sending a test message to the network address of the device to be tested;
[0021] A return value corresponding to the test message is received, and when the return value is consistent with a reference value, it is determined that the network test result meets the requirement.
[0022] Optionally, the method further comprises:
[0023] When the network test result does not meet the requirements, a second prompt information is generated and printed; the second prompt information is used to indicate that a fault exists in the device to be tested.
[0024] In a second aspect, the present invention provides a device testing apparatus, the apparatus comprising:
[0025] A sending module, configured to send a shutdown signal to a start pin of the device to be tested in response to a start test operation of the device to be tested, and to send a startup signal to the start pin when a duration of sending the shutdown signal reaches a first preset duration;
[0026] A testing module, used for performing a network test on the device to be tested;
[0027] The execution module is used for re-executing the operation of sending a shutdown signal to the start pin of the device to be tested when the network test result meets the requirement.
[0028] Optionally, the device further comprises:
[0029] The creation module is used to create test parameters in response to starting a test operation on the device to be tested.
[0030] The execution module is specifically used to: when the network test result meets the requirements, add 1 to the test parameter and re-execute the operation of sending a shutdown signal to the device to be tested.
[0031] Optionally, the test module includes:
[0032] A detection submodule, used to detect whether the current parameter value of the test parameter is less than a preset test threshold;
[0033] A network test submodule, configured to perform a network test on the device to be tested when the current parameter value is less than the preset test threshold;
[0034] The first generation submodule is used to generate and print a first prompt message when the current parameter value is not less than the preset test threshold, and to send a shutdown signal to the start pin of the device to be tested; the first prompt message is used to indicate that the device to be tested meets the test requirements.
[0035] Optionally, the detection submodule is specifically used to:
[0036] When the duration of sending the power-on signal reaches a second preset duration, it is detected whether the current parameter value of the test parameter is less than a preset test threshold.
[0037] Optionally, the network test submodule is specifically used to:
[0038] Sending a test message to the network address of the device to be tested;
[0039] A return value corresponding to the test message is received, and when the return value is consistent with a reference value, it is determined that the network test result meets the requirement.
[0040] Optionally, the device further comprises:
[0041] The second generating module is used to generate and print second prompt information when the network test result does not meet the requirements; the second prompt information is used to indicate that the device to be tested has a fault.
[0042] In a third aspect, the present invention provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned device testing method when executing the program.
[0043] In a fourth aspect, the present invention provides a readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the above-mentioned device testing method.
[0044] The device testing method provided in the embodiment of the present invention can realize automatic restart control of the device to be tested by sending a shutdown signal and a power-on signal to the start pin of the device to be tested, without manually controlling the power switch of the device to be tested, thereby reducing the manpower cost and time cost of the device testing. After sending a power-on signal to the start pin of the device to be tested, by performing a network test on the device to be tested, it can be tested whether the device to be tested has a network fault, and then it can be determined whether the device to be tested has a startup fault through the network test result. By executing the operation of sending a shutdown signal to the start pin of the device to be tested again when the network test result meets the requirements, the stability test of the device to be tested can be automated. At the same time, by setting a first preset time length, when the time length of sending the shutdown signal reaches the first preset time length, sending the power-on signal again can ensure that the device voltage becomes 0V before starting, which can protect the device to be tested to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 is a flowchart of a device testing method provided by an embodiment of the present invention;
[0047] Figure 2 is a connection diagram of a device test provided by an embodiment of the present invention;
[0048] Figure 3 is a structural diagram of a device testing apparatus provided by an embodiment of the present invention;
[0049] Figure 4 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] Figure 1 is a flow chart of the steps of a device testing method provided by an embodiment of the present invention, such as Figure 1 As shown, the method may include the following steps:
[0052] Step 101: In response to starting a test operation on a device to be tested, sending a shutdown signal to a start pin of the device to be tested, and sending a startup signal to the start pin when a duration of sending the shutdown signal reaches a first preset duration.
[0053] Step 102: Perform a network test on the device to be tested.
[0054] Step 103: When the network test result meets the requirement, the operation of sending a shutdown signal to the start pin of the device to be tested is performed again.
[0055] The embodiment of the present invention can be applied to any computer device that can issue control commands, and can be a control terminal such as a host computer. The above-mentioned device to be tested can be a board or other computer product device with test requirements, and the embodiment of the present invention does not limit this. Among them, the above-mentioned start test operation can be triggered by the tester clicking a preset test control, or the above-mentioned start test operation can also be triggered by the tester sending a test instruction, which can be set according to actual needs, and the embodiment of the present invention does not limit this.
[0056] Specifically, a start pin (PS_ON) is usually provided in the device to provide a power supply for starting the device. Then, the embodiment of the present invention can connect the control terminal to PS_ON, and control the shutdown or start of the device to be tested by sending a shutdown signal or a power-on signal to PS_ON. Among them, the above-mentioned shutdown signal refers to a signal that shuts down the device to be tested, and correspondingly, the above-mentioned power-on signal refers to a signal that turns on the device to be tested. Further, the startup logic of the start pin of different devices is different. In one case, if the device to be tested is turned on when PS_ON is high and shuts down when PS_ON is low, then the above-mentioned shutdown signal can be a low-level signal, and correspondingly, the above-mentioned power-on signal can be a high-level signal. In another case, if the device to be tested is turned on when PS_ON is low and shuts down when PS_ON is high, then the above-mentioned shutdown signal can be a high-level signal, and correspondingly, the above-mentioned power-on signal can be a low-level signal.
[0057] Optionally, Figure 2 is a connection diagram of a device test provided by an embodiment of the present invention, such as Figure 2As shown, the embodiment of the present invention can also realize the control of the device to be tested through the Joint Test Action Group (JTAG). Among them, JTAG is a debugging tool for the processor, which can realize the single-step debugging program at the processor register level, and can access the processor register, memory unit, coprocessor register, etc. It is also possible to connect the JTAG interface, capture the processor log, analyze the processor execution status and other functions. The embodiment of the present invention can use the Loongson 1C JTAG. Specifically, the host computer can be connected to the JTAG through a serial port, and the JTAG can be connected to the device to be tested. Specifically, JTAG usually has an output pin PWR_ST, a ground pin GND and a network controller interface (Gigabit Media Access Controller, GMAC), so that the embodiment of the present invention can use a DuPont line to connect the PWR_ST of JTAG to the PS_ON of the device to be tested, and use a DuPont line to connect the GND of JTAG to the GAD of the device to be tested so that the two are in common, avoiding electromagnetic interference, and using an Ethernet cable to connect the GMAC network port of JTAG to the GMAC network port of the device to be tested. Furthermore, in the embodiment of the present invention, the host computer may send a shutdown signal or a startup signal to JTAG, and JTAG may output a low level or a high level to PS_ON of the device under test through PWR_ST.
[0058] Among them, the above-mentioned first preset duration can be pre-set, and different first preset durations can be set according to the type of the device to be tested or the manufacturer, and the embodiment of the present invention does not limit this. Exemplarily, the first preset duration can be set to 10s, 16s or 20s, etc. Specifically, due to the different shutdown times of the devices, that is, the time for the device voltage to become 0V after the power is turned off is different, and the device often needs to be powered on from 0V when it is started, the embodiment of the present invention can send a power-on signal to the start pin when the duration of sending the shutdown signal reaches the first preset duration, which can ensure that the device voltage becomes 0V before turning on, and can protect the device to be tested to a certain extent. Specifically, the judgment operation that the duration of sending the shutdown signal reaches the first preset duration can be implemented by a delay instruction (sleep), and the power-on signal can be sent after the shutdown signal is sent, after the first preset duration is delayed.
[0059] Furthermore, in the process of testing the stability of the device to be tested, if the device has a startup failure during the boot process, the device to be tested often cannot start the network. In this case, the embodiment of the present invention can determine whether the device to be tested has a startup failure through a network test. Specifically, the above network test can be implemented through a network test command (ping). A test message can be sent to the device to be tested through the ping command, and the return value of the ping command can be obtained. If the return value is consistent with the reference value (0), the network test result is that the network is normal. Correspondingly, if the return value is inconsistent with the reference value, the network test result is a network failure.
[0060] Furthermore, when the network test result indicates that the network is normal, it can be determined that the network test result meets the requirements. At this time, the embodiment of the present invention can again perform the above operation of sending a shutdown signal to the start pin of the device to be tested, thereby realizing automated stability testing.
[0061] Furthermore, the embodiment of the present invention may also stop the test when the test duration reaches a preset duration threshold or the number of network tests reaches a preset number threshold.
[0062] In summary, in the embodiment of the present invention, by sending a shutdown signal and a power-on signal to the start pin of the device to be tested, the device to be tested can be automatically restarted and controlled, without manually controlling the power switch of the device to be tested, thereby reducing the manpower cost and time cost of the device test. After sending a power-on signal to the start pin of the device to be tested, by performing a network test on the device to be tested, it can be tested whether the device to be tested has a network fault, and then it can be determined whether the device to be tested has a startup fault through the network test result. By executing the operation of sending a shutdown signal to the start pin of the device to be tested again when the network test result meets the requirements, the stability test of the device to be tested can be automated. At the same time, by setting a first preset duration, when the duration of sending the shutdown signal reaches the first preset duration, sending the power-on signal again can ensure that the device voltage becomes 0V before turning on, which can protect the device to be tested to a certain extent.
[0063] Optionally, the embodiment of the present invention may further include:
[0064] S21. In response to starting a test operation on the device to be tested, create test parameters.
[0065] The test parameter refers to a parameter used to characterize the number of tests. Before sending the shutdown signal, a variable can be created as the test parameter. Further, after creating the test parameter, the initial value can be set to 0. Specifically, the test parameter can be an integer variable, or a floating point variable, which is not limited in the embodiment of the present invention.
[0066] Furthermore, when the network test result meets the requirement, the operation of sending a shutdown signal to the device to be tested is re-executed. The embodiment of the present invention may specifically include:
[0067] S22: When the network test result meets the requirement, the test parameter is increased by 1, and the operation of sending a shutdown signal to the device to be tested is re-executed.
[0068] Specifically, when the network test result meets the requirements, a stability test is completed. At this time, the test parameter can be increased by 1 to realize automatic recording of the number of tests.
[0069] The embodiment of the present invention can realize automatic recording of the number of tests by creating test parameters and adding 1 to the test parameters when the network test results meet the requirements, thereby further improving the automation effect of device testing.
[0070] Optionally, the operation of performing a network test on the device to be tested may specifically include:
[0071] S31. Detect whether the current parameter value of the test parameter is less than a preset test threshold.
[0072] S32: When the current parameter value is less than the preset test threshold, perform a network test on the device to be tested.
[0073] S33. When the current parameter value is not less than the preset test threshold, generate and print a first prompt message, and send a shutdown signal to the start pin of the device to be tested; the first prompt message is used to indicate that the device to be tested meets the test requirements.
[0074] The preset test threshold may be pre-set, and the upper limit of the number of tests may be set as the preset test threshold according to the actual test requirements of the device to be tested. For example, the number of tests of a computer product device is usually less than 2000 times, so the preset test threshold may be set to 2000. Of course, it may also be set to 1500, 2500, etc., which is not limited in the embodiment of the present invention.
[0075] Specifically, before performing a network test, the embodiment of the present invention can first determine the current parameter value of the test parameter to determine whether it is less than a preset test threshold. When the current parameter value is not less than the preset test threshold, it indicates that the number of tests on the device to be tested has not reached the upper limit, and the network test can be performed on the device to be tested at this time. Correspondingly, when the current parameter value is not less than the preset test threshold, it indicates that the number of tests on the device to be tested has reached the upper limit, and the network test results in the previous test process meet the requirements, then the first prompt information indicating that the device to be tested meets the test requirements can be generated and printed, and a shutdown signal is sent to the start pin at the same time to shut down the device to be tested, and the device test is completed at this time.
[0076] The printing operation refers to displaying the first prompt information on the display terminal, and the printing operation can be implemented through a printing instruction (eg, echo).
[0077] Optionally, the first prompt information may also indicate that the number of tests has reached a preset test threshold.
[0078] In an embodiment of the present invention, by detecting whether the current parameter value of the test parameter is less than a preset test threshold; when the current parameter value is less than the preset test threshold, a network test is performed on the device to be tested; when the current parameter value is not less than the preset test threshold, a first prompt message is generated and printed, and a shutdown signal is sent to the start pin of the device to be tested; the first prompt message is used to indicate that the device to be tested meets the test requirements. In this way, by setting a preset test threshold and comparing the current parameter value of the test parameter with the preset test threshold, it is possible to continuously perform automated testing within the preset test threshold. At the same time, by setting the test parameters and the preset test threshold, different preset test thresholds can be set according to actual test requirements, thereby improving the flexibility of device testing.
[0079] Optionally, the above operation of detecting whether the current parameter value of the test parameter is less than a preset test threshold value may specifically include:
[0080] S41. When the duration of sending the power-on signal reaches a second preset duration, detecting whether the current parameter value of the test parameter is less than a preset test threshold.
[0081] Specifically, since different devices have different time lengths from power-on to normal network operation, in order to ensure the effectiveness of the network test, the embodiment of the present invention can set the second preset time length according to the actual situation of the device to be tested, and when the time length of sending the second power-on signal reaches the second preset time length, it is determined whether the current parameter value of the test parameter is less than the preset test threshold.
[0082] Specifically, the above-mentioned judgment operation of whether the duration of sending the power-on signal reaches the second preset duration can also be implemented through a delay instruction (sleep). After sending the power-on signal, the second preset duration can be delayed to determine whether the current parameter value of the test parameter is less than the preset test threshold.
[0083] In the embodiment of the present invention, by detecting whether the current parameter value of the test parameter is less than the preset test threshold value when the duration of sending the power-on signal reaches the second preset duration, it is possible to determine whether the current parameter value of the test parameter is less than the preset test threshold value when the duration of sending the power-on signal reaches the second preset duration, thereby ensuring the validity of the network test and avoiding test errors caused by the device to be tested not being fully started.
[0084] Optionally, the operation of performing a network test on the device to be tested may specifically include:
[0085] S51. Send a test message to the network address of the device to be tested.
[0086] S52: Receive a return value corresponding to the test message, and if the return value is consistent with a reference value, determine that the network test result meets the requirement.
[0087] Wherein, the above-mentioned network address refers to the Internet Protocol Address (IP address) of the device to be tested, which may be pre-allocated for the device to be tested according to the IP protocol. Wherein, the above-mentioned test message may be pre-set, which may include a specified identifier and sequence number. When the device to be tested receives the test message, the device to be tested may output a return value according to the test message. If the network of the device to be tested is normal, its return value is often consistent with the pre-set reference value. Correspondingly, if the network of the device to be tested fails, its return value is often inconsistent with the reference value. At this time, it can be determined that the network test result meets the requirements. Alternatively, when the device to be tested does not respond within the specified response time, it can also be determined that the network test result does not meet the requirements.
[0088] Specifically, the operation of sending the test message can be implemented by a ping command. Optionally, the ping command can also set the number of times the test message is sent and the interval time, thereby avoiding network test errors caused by network fluctuations and the like to a certain extent.
[0089] In the embodiment of the present invention, a test message is sent to the network address of the device to be tested; a return value corresponding to the test message is received, and when the return value is consistent with a reference value, it is determined that the network test result meets the requirements. In this way, the network test of the device to be tested can be implemented.
[0090] Optionally, the embodiment of the present invention may further include:
[0091] S61. When the network test result does not meet the requirement, generate second prompt information and print the second prompt information; the second prompt information is used to indicate that the device to be tested has a fault.
[0092] If the network test result does not meet the requirements, it indicates that there is a fault in the network of the device to be tested. In this case, the device to be tested often has a startup failure, so a second prompt message indicating that there is a fault in the device to be tested can be generated and printed.
[0093] Furthermore, at this time, no shutdown signal is sent to the device to be tested, so that the current state of the device to be tested can be maintained, which is convenient for the tester to locate the cause of the failure of the device to be tested based on the second prompt information.
[0094] In the embodiment of the present invention, when the network test result does not meet the requirements, second prompt information is generated and printed; the second prompt information is used to indicate that the device to be tested has a fault. In this way, by generating the second prompt information, it is convenient for the tester to locate the cause of the fault of the device to be tested based on the second prompt information.
[0095] Optionally, the embodiment of the present invention also provides a script program for device testing, as shown below:
[0096] #! / bin / sh / / shell script opening syntax, telling the system that it needs parser parsing;
[0097] count_nu=0 / / define variables as test parameters and initialize them to 0;
[0098] . / off.sh / / Execute shutdown and startup scripts;
[0099] sleep 16 / / delay for 16 seconds;
[0100] while true / / loop;
[0101] do
[0102] if[[$count_nu == 2000]]; then / / whether the number of tests is equal to 2000;
[0103] echo "reboot$count_nu times succeed" / / If yes, the print test is completed;
[0104] echo low> / sys / class / gpio / gpio71 / direction / / If yes, turn off the power;
[0105] break; / / If yes, exit the loop;
[0106] fi / / Judge the end character;
[0107] ping -c 8 -w (IP address) / / ping to test the network;
[0108] if[[$? ! = 0]]; then / / Judge the return value of the ping command. If it is 0, the network test result meets the requirements. If it is not 0, the network test result does not meet the requirements.
[0109] echo "ping fail" / / If the network test result does not meet the requirements, a ping error will be printed;
[0110] echo "system start err!!" / / If the network test result does not meet the requirements, the printing device startup failure will occur;
[0111] break; / / Keep the machine powered on, save the fault scene, and exit the loop;
[0112] else
[0113] echo "ping ok" / / If the network test result meets the requirements, print "ping success";
[0114] let "count_nu+=1" / / If the network test result meets the requirements, the test parameter will increase by 1;
[0115] echo$count_nu / / If the network test result meets the requirements, the test parameters will be printed;
[0116] . / off.sh / / Execute shutdown and startup scripts;
[0117] sleep 30 / / Delay for 30 seconds to wait for the test device to boot successfully;
[0118] fi determines the end character;
[0119] done The loop ends.
[0120] The shutdown and startup script off.sh can be as follows:
[0121] #! / bin / sh shell / / Script beginning syntax, telling the system that it needs parser parsing;
[0122] echo "Power off" / / Print shutdown prompt information;
[0123] echo low> / sys / class / gpio / gpio71 / direction / / Pull down the PWR_ST of JTAG. Specifically, since there is an inverting device inside JTAG, after pulling down PWR_ST, the actual level given to PS_ON is high (greater than 4.5V), so the shutdown is achieved;
[0124] sleep 10s / / delay 10s;
[0125] echo high> / sys / class / gpio / gpio71 / direction / / Pull up the PWR_ST of JTAG. Specifically, since there is an inverting device inside JTAG, after the PWR_ST of JTAG is pulled high, the actual level given to PS_ON is low (less than 1V), so the power-on is achieved.
[0126] Figure 3 is a structural diagram of a device testing apparatus provided by an embodiment of the present invention, such as Figure 3 As shown, the device 20 comprises:
[0127] The sending module 201 is used for sending a shutdown signal to the start pin of the device to be tested in response to the start test operation of the device to be tested, and sending a power-on signal to the start pin when the duration of sending the shutdown signal reaches a first preset duration;
[0128] The testing module 202 is used to perform a network test on the device to be tested;
[0129] The execution module 203 is used to re-execute the operation of sending a shutdown signal to the start pin of the device to be tested when the network test result meets the requirement.
[0130] Optionally, the device further comprises:
[0131] The creation module is used to create test parameters in response to starting a test operation on the device to be tested.
[0132] Optionally, the execution module 203 is specifically configured to: if the network test result meets the requirement, add 1 to the test parameter, and re-execute the operation of sending a shutdown signal to the device to be tested.
[0133] Optionally, the testing module 202 includes:
[0134] A detection submodule, used to detect whether the current parameter value of the test parameter is less than a preset test threshold;
[0135] A network test submodule, configured to perform a network test on the device to be tested when the current parameter value is less than the preset test threshold;
[0136] The first generation submodule is used to generate and print a first prompt message when the current parameter value is not less than the preset test threshold, and to send a shutdown signal to the start pin of the device to be tested; the first prompt message is used to indicate that the device to be tested meets the test requirements.
[0137] Optionally, the detection submodule is specifically used for:
[0138] When the duration of sending the power-on signal reaches a second preset duration, it is detected whether the current parameter value of the test parameter is less than a preset test threshold.
[0139] Optionally, the network test submodule is specifically used to:
[0140] Sending a test message to the network address of the device to be tested;
[0141] A return value corresponding to the test message is received, and when the return value is consistent with a reference value, it is determined that the network test result meets the requirement.
[0142] Optionally, the device further comprises:
[0143] The second generating module is used to generate and print second prompt information when the network test result does not meet the requirements; the second prompt information is used to indicate that the device to be tested has a fault.
[0144] In summary, the equipment testing device provided by the embodiment of the present invention can realize automatic restart control of the equipment to be tested by sending a shutdown signal and a power-on signal to the start pin of the equipment to be tested, without manually controlling the power switch of the equipment to be tested, thereby reducing the manpower cost and time cost of equipment testing. After sending a power-on signal to the start pin of the equipment to be tested, by performing a network test on the equipment to be tested, it can be tested whether there is a network fault in the equipment to be tested, and then it can be determined whether there is a startup fault in the equipment to be tested by the network test result. By executing the operation of sending a shutdown signal to the start pin of the equipment to be tested again when the network test result meets the requirements, the automation of the stability test of the equipment to be tested can be realized. At the same time, by setting a first preset time length, when the time length of sending the shutdown signal reaches the first preset time length, sending the power-on signal again, it can be ensured that the equipment voltage becomes 0V before turning on, which can protect the equipment to be tested to a certain extent.
[0145] The present invention also provides an electronic device, see Figure 4 , including: a processor 301, a memory 302, and a computer program 3021 stored in the memory and executable on the processor, wherein the processor implements the device testing method of the aforementioned embodiment when executing the program.
[0146] The present invention also provides a readable storage medium, when the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the device testing method of the aforementioned embodiment.
[0147] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0148] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0149] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0150] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0151] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0152] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0153] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
[0154] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0155] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0156] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A device testing method, characterized in that: The method comprises: In response to starting a test operation on the device to be tested, sending a shutdown signal to a start pin of the device to be tested, and sending a startup signal to the start pin when a duration of sending the shutdown signal reaches a first preset duration; Performing a network test on the device to be tested; When the network test result meets the requirement, the operation of sending a shutdown signal to the start pin of the device to be tested is performed again.
2. The method according to claim 1, characterized in that The method further includes: in response to initiating a test operation of the device to be tested, creating test parameters; When the network test result meets the requirement, re-performing the operation of sending a shutdown signal to the device to be tested includes: When the network test result meets the requirement, the test parameter is increased by 1, and the operation of sending a shutdown signal to the device to be tested is performed again.
3. The method according to claim 2, characterized in that The performing a network test on the device to be tested includes: Detecting whether the current parameter value of the test parameter is less than a preset test threshold; When the current parameter value is less than the preset test threshold, performing a network test on the device to be tested; When the current parameter value is not less than the preset test threshold, a first prompt message is generated and printed, and a shutdown signal is sent to the start pin of the device to be tested; the first prompt message is used to indicate that the device to be tested meets the test requirements.
4. The method according to claim 3, characterized in that The detecting whether the current parameter value of the test parameter is less than a preset test threshold value includes: When the duration of sending the power-on signal reaches a second preset duration, it is detected whether the current parameter value of the test parameter is less than a preset test threshold.
5. The method according to claim 3, characterized in that: The performing a network test on the device to be tested includes: Sending a test message to the network address of the device to be tested; A return value corresponding to the test message is received, and when the return value is consistent with a reference value, it is determined that the network test result meets the requirement.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: When the network test result does not meet the requirements, a second prompt information is generated and printed; the second prompt information is used to indicate that a fault exists in the device to be tested.
7. A device testing apparatus, characterized in that: The device comprises: A sending module, configured to send a shutdown signal to a start pin of the device to be tested in response to a start test operation of the device to be tested, and to send a startup signal to the start pin when a duration of sending the shutdown signal reaches a first preset duration; A testing module, used for performing a network test on the device to be tested; The execution module is used for re-executing the operation of sending a shutdown signal to the start pin of the device to be tested when the network test result meets the requirement.
8. The device according to claim 7, characterized in that: The device also includes: The creation module is used to create test parameters in response to starting a test operation on the device to be tested. The execution module is specifically used to: when the network test result meets the requirements, add 1 to the test parameter and re-execute the operation of sending a shutdown signal to the device to be tested.
9. The device according to claim 8, characterized in that: The test module comprises: A detection submodule, used to detect whether the current parameter value of the test parameter is less than a preset test threshold; A network test submodule, configured to perform a network test on the device to be tested when the current parameter value is less than the preset test threshold; The first generation submodule is used to generate and print a first prompt message when the current parameter value is not less than the preset test threshold, and to send a shutdown signal to the start pin of the device to be tested; the first prompt message is used to indicate that the device to be tested meets the test requirements.
10. The device according to claim 9, characterized in that: The detection submodule is specifically used for: When the duration of sending the power-on signal reaches a second preset duration, it is detected whether the current parameter value of the test parameter is less than a preset test threshold.
11. The device according to claim 9, characterized in that: The network test submodule is specifically used for: Sending a test message to the network address of the device to be tested; A return value corresponding to the test message is received, and when the return value is consistent with a reference value, it is determined that the network test result meets the requirement.
12. The device according to any one of claims 7 to 11, characterized in that: The device also includes: The second generating module is used to generate and print second prompt information when the network test result does not meet the requirements; the second prompt information is used to indicate that the device to be tested has a fault.
13. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 6 when executing the program.
14. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 6.