Automatic test system and method for startup and shutdown
An automated testing system that uses a finger robot to simulate pressing a switch button, combined with image recognition and power consumption detection, solves the problems of low efficiency and false positives/missed detections in power-on/off testing of personal terminal devices, achieving efficient and accurate automated power-on/off testing.
Patent Information
- Application Number
- CN202511200295.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2025-12-09
AI Technical Summary
Existing technologies lack efficient automated power-on/off testing methods for personal terminal devices such as PCs, laptops, and desktops, while manual testing is inefficient and prone to misjudgment or missed detection.
A finger robot is used to simulate manual pressing of the switch button, and a dual verification mechanism of image recognition and real-time power consumption detection is used to automatically perform power-on and power-off tests.
It improves the universality and accuracy of testing, reduces the risk of missed detections and false positives, enhances testing efficiency and stability, supports parallel testing on multiple devices, and reduces manual intervention.
Abstract
Description
Technical Field
[0001] This invention relates to automated testing of equipment, specifically to an automated testing system and method for power-on / off. Background Technology
[0002] During the system-wide compatibility testing phase, power-on / off tests are often required. These typically involve 30 or more power-on / off cycles on multiple machines. Manual testing is currently inefficient. While automated testing uses IPMI commands with BMC (Browser Control Center) for power-on / off, this method only works for servers with built-in BMC. Personal terminals, PCs, laptops, and desktops do not have BMC, and system compatibility testing needs to be performed on a large number of personal terminals, PCs, laptops, desktops, and all-in-ones. Therefore, a more universal and automated method for power-on / off testing is needed.
[0003] Existing testing methods sometimes use image acquisition and comparison to verify the power-on / off screen. This method has the disadvantages of incomplete detection and the possibility of missed detections and false judgments. For example, the power-off screen may appear to be black, but in reality, the power supply is still under load and the screen is black. Judging solely from the screen is not rigorous. This method adds real-time power consumption detection and judgment, and uses a combination of both methods to determine the power-on / off status. Summary of the Invention
[0004] The main objective of this invention is to provide an automated power-on / off testing system and method that can effectively solve the problems of missed detections in automated power-on / off systems and the low efficiency of manual power-on / off systems.
[0005] To achieve the above objectives, the present invention provides an automated power-on / off testing system, comprising: Main control module; The switch action device is electrically connected to the main control module and is used to control the opening and closing of the switch button of the device under test. It can perform short press and long press actions. The image and video acquisition module is connected to the main control module and is used to sequentially acquire the screen images of the device under test at each stage during the power-on and power-off process, and transmit the screen image of the current stage to the test process control module. The test process control module communicates with the main control module and the image and video acquisition module. It has preset reference images for each stage of the power-on and power-off of the device under test. The test process control module compares the image of the current stage with the reference image of the corresponding stage to determine whether there is any abnormality in the image of the current stage. If there is an abnormality, the test is terminated, the scene is preserved, and an abnormality signal is sent to the real-time alarm module. At the same time, the abnormality information is synchronized to the log module. If there is no abnormality, the test process control module sends a signal to continue the test. The real-time power consumption acquisition module communicates with the main control module and is used to collect the real-time power consumption of the device under test at different stages of power-on and power-off. It has preset expected thresholds for power consumption at each stage. The real-time power consumption acquisition module determines whether the real-time power consumption meets the expected thresholds. If it does, it sends a signal to the main control module to continue the test. If it does not, it terminates the test, preserves the current state, sends an abnormal signal to the real-time alarm module, and synchronizes the abnormal information to the log module. The real-time alarm module is connected to the main control module, the test process control module and the real-time power consumption acquisition module. It is used to receive abnormal signals and issue alarms. The log module communicates with the main control module, the test process control module, and the real-time power consumption acquisition module to store test process data and abnormal information.
[0006] Preferably, the device under test is plugged into a smart socket, which is equipped with a power consumption data transmission module. The power consumption data transmission module is communicatively connected to the real-time power consumption acquisition module and is used to transmit the collected power consumption data of the device under test to the real-time power consumption acquisition module.
[0007] Preferably, the switch action device is a finger robot, which is electrically connected to the main control module and can perform short press or long press actions according to the instructions of the main control module.
[0008] In a further preferred embodiment, the finger robot includes a robot control system and a robot drive system; the robot control system is communicatively connected to the main control module and is used to receive control commands from the main control module; the robot drive system is electrically connected to the robot control system and is able to execute corresponding switch button operations under the control of the robot control system.
[0009] Furthermore, the log module stores information including test time, number of tests, comparison results of images at each stage, real-time power consumption data, time of occurrence of an anomaly, and type of anomaly.
[0010] This invention also provides an automated testing method for power on / off, comprising the following steps: S1: Initialize the test system: The main control module completes self-test, presets the number of test cycles, reference images and power consumption thresholds for each stage of the device under test's power-on and power-off, connects the device under test to the smart socket, and puts the device under test into the initial standby state; S2: Execute the power-on test procedure: S21: The main control module sends a power-on control command to the switch action device, controlling the switch action device to perform a preset pressing action on the switch button of the device under test; S22: The image and video acquisition module acquires images of each stage of the power-on process of the device under test in real time and transmits them to the test process control module. S23: The real-time power consumption acquisition module synchronously acquires real-time power consumption data at each stage of the power-on process of the device under test; S24: The test process control module compares the current stage image with the corresponding stage reference image to determine if there are any anomalies; at the same time, the real-time power consumption acquisition module compares the real-time power consumption data with the corresponding stage power consumption threshold to determine if it meets expectations. S25: If the screen image is abnormal or the power consumption does not meet expectations, the abnormal handling mechanism is triggered: terminate the current test, retain the on-site data, the real-time alarm module issues an alarm signal, and the abnormal information is stored in the log module; if all are normal, the power-on test is completed. S3: Execute the shutdown test procedure: S31: The main control module sends a shutdown control command to the switch action device, controlling the switch action device to perform a preset pressing action on the switch button of the device under test; S32: The image and video acquisition module acquires images of each stage of the shutdown process of the device under test in real time and transmits them to the test process control module. S33: The real-time power consumption acquisition module synchronously acquires real-time power consumption data at each stage of the shutdown process of the device under test; S34: The test process control module compares the current stage image with the corresponding stage reference image to determine if there is any anomaly; at the same time, the real-time power consumption acquisition module compares the real-time power consumption data with the corresponding stage power consumption threshold to determine if it meets expectations. S35: If the screen image is abnormal or the power consumption does not meet expectations, the abnormal handling mechanism in step S25 is triggered; if both are normal, the shutdown test is completed. S4: Loop Test Judgment: The main control module counts the current test loop count. If the preset number of loops has not been reached, it returns to step S2 to repeat the power-on / off test. If the preset number of loops has been reached, the test ends and the log module generates a complete test report.
[0011] Preferably, in steps S21 and S31, the switch action device is a finger robot, and the main control module drives the robot drive system to execute a preset pressing action by controlling the robot control system of the finger robot.
[0012] Preferably, in steps S22 and S32, the comparison of the image includes the following sub-steps: a. The test process control module preprocesses the captured images; b. Use an image feature matching algorithm to compare the features of the preprocessed image with the reference image at the corresponding stage; c. If the matching degree is lower than the preset threshold, the image is determined to be abnormal, and the abnormality type is recorded.
[0013] Preferably, in steps S23 and S33, real-time power consumption data is collected through a smart socket connected to the device under test, and the power consumption data transmission module of the smart socket sends the collected power consumption data to the real-time power consumption acquisition module in real time.
[0014] Preferably, the retained field data in step S25 includes: the timestamp of the anomaly occurrence, the original screen image and comparison results of the corresponding stage, the real-time power consumption curve, the current operating parameters of the device under test, and the number of test cycles.
[0015] In step S4, the test report includes: total number of test cycles, number of successes, number of exceptions, frequency of occurrence of each type of exception and corresponding stage distribution, and statistical analysis of power consumption data.
[0016] The beneficial effects of this invention are as follows: 1. Improve the universality of testing to cover multiple types of equipment. Addressing the limitation that traditional IPMI commands relying on BMC are only applicable to servers, this invention uses a finger robot to simulate manually pressing a physical switch. This eliminates the need for devices to have specific interfaces (such as BMC) and can be widely adapted to personal terminals (PCs, laptops, desktops, all-in-ones, etc.). It solves the need for whole-machine adaptation testing of operating systems on a large number of non-server devices and significantly improves the universality of automated testing.
[0017] 2. Resolve issues of missed detections and false positives, and improve testing accuracy. Existing methods that rely solely on image capture to determine power on / off status can lead to false positives due to situations such as a black screen indicating the device is not actually powered off. This invention innovatively employs a dual-dimensional verification mechanism combining image recognition and real-time power consumption detection. The image and video acquisition module ensures that the images displayed at each stage of power-on and power-off meet expectations; The real-time power consumption acquisition module monitors power consumption changes through the smart socket to verify the actual operating status of the device (such as whether the power consumption drops to the standby threshold after the device is turned off).
[0018] Combining the two can effectively avoid the limitations of a single judgment dimension, significantly reduce the risk of missed detections and misjudgments, and improve the reliability of test results.
[0019] 3. Replaces manual operation, improving testing efficiency and stability Traditional manual testing requires repeating power-on / off operations more than 30 times, which is not only inefficient but also prone to poor test consistency due to fatigue and operational differences. This invention automates the entire process through a main control module, achieving fully automated execution of power-on / off actions, image acquisition, power consumption monitoring, anomaly handling, and cyclic testing, reducing manual intervention. The single test cycle is shorter, and multiple devices can be tested in parallel; Test parameters (such as number of cycles and pressing action) are uniformly preset to ensure consistency of testing across different devices and batches, and to improve the comparability of test data.
[0020] 4. Improve the anomaly handling mechanism to facilitate problem tracing and analysis. The system uses a log module to record detailed data throughout the test (including timestamps, image comparison results, power consumption curves, anomaly types, etc.), and triggers a scene-preserving function when an anomaly occurs, completely saving key information at the moment of the anomaly. Simultaneously, a real-time alarm module can promptly alert staff to address issues, facilitating subsequent tracing of the cause of the anomaly (such as abnormal visuals at specific stages, abnormal power consumption fluctuations, etc.), providing precise data for optimizing the equipment or operating system.
[0021] 5. Reduce testing costs and adapt to large-scale testing needs. By replacing manual labor with automation, the system reduces labor costs, making it particularly suitable for scenarios requiring multiple devices and multiple rounds of cyclical testing (such as batch adaptation verification of operating systems). Meanwhile, the modular design of the system (main control module, switch action device, data acquisition module, etc.) facilitates expansion and maintenance, allowing for flexible adjustment of the number of devices according to the testing scale to meet the needs of large-scale testing. Detailed Implementation
[0022] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Many specific details are set forth in the following description to provide a thorough understanding of the present invention; however, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0023] I. System Hardware Configuration Main control module: If the number of devices under test is small, a corresponding control program can be developed, installed on a mobile phone, and remotely controlled via the phone. If the number of devices under test is large, an industrial-grade computer can be used as the core control unit of the system, communicating with each module via a USB interface to run the test control program.
[0024] Switch action device: A finger robot is selected, which is electrically connected to the main control module via remote communication or data cable. Its robotic arm end is adapted to the pressing stroke (0.5-1mm) of the power button of a laptop computer, and can perform short press (0.5s) and long press (5s) actions.
[0025] Image and video acquisition module: It adopts a Hikvision DS-2CD2T47G2-LU high-definition camera (4 megapixels, 30fps), which is connected to the main control module via Ethernet. Alternatively, other models of high-definition cameras can be used to connect to the main control module via wireless network. The lens is aimed at the center area of the laptop screen, and the acquisition range covers the entire display screen.
[0026] Real-time power consumption acquisition module: Xiaomi Smart Socket 2 (supports power consumption measurement, accuracy ±2%). The laptop under test is connected to the mains power through this socket. The socket communicates with the main control module through the wireless network and uploads power consumption data in real time (sampling frequency 1 time / second).
[0027] Real-time alarm module: integrates an email server (based on the SMTP protocol) and an SMS gateway, and is connected to the main control module via Ethernet.
[0028] Log module: Uses a MySQL database (deployed locally on the main control module) to store test data and exception information.
[0029] II. System Software Module Implementation Test process control module: Pre-stored reference images: The laptop was manually powered on and off three times, and the screens at each stage (such as the BIOS interface, operating system logo, and login screen during power-on; the "Shutting down" prompt and black screen state during power-off) were captured. After preprocessing (denoising and normalizing the size to 1920×1080 pixels), the images were used as reference images and stored in a local folder.
[0030] Image comparison algorithm: The ORB feature matching algorithm (implemented through the OpenCV library) is used, and the matching degree threshold is set to 85% (below this value is considered abnormal).
[0031] Real-time power consumption acquisition module: Preset power consumption threshold: Power-on phase: Within 30 seconds after pressing the power button, the real-time power consumption should rise from the standby state (about 1-3W) to ≥10W (normal startup power consumption of a laptop). Shutdown phase: Within 60 seconds after the shutdown operation is performed, the power consumption must be reduced to ≤0.5W (power consumption when the laptop battery is fully charged; the battery must be charged to 100% and the power adapter disconnected before testing).
[0032] Exception handling module: Retain on-site data, including timestamps of abnormal moments, current images captured by the camera, real-time power consumption curves (data from the past 10 seconds), number of test loops, and finger robot action logs.
[0033] III. Test Method Execution Steps (Taking a 30-cycle test as an example) S1: Initialization Phase Main control module self-test: Check the connection status of each hardware (whether the finger robot has been reset, whether the camera is capturing the view normally, and whether the smart socket is online).
[0034] Preset parameters: 30 loops, reference image path loading, power consumption threshold entered into the system.
[0035] Preparation of the device under test: Charge the laptop battery to 100%, disconnect the power adapter, connect it to the mains power through the smart plug, and put it in the initial shutdown state (screen is black, power consumption ≤0.5W).
[0036] S2: Power-on test procedure: S21: The main control module sends a command to the finger robot to control its robotic arm to move above the laptop power button and perform a short press action (0.5s).
[0037] S22: The camera captures screen images in real time (1 frame every 2 seconds) and transmits them to the test process control module. For example, the BIOS interface is captured at the 5th second, and the Windows Logo interface is captured at the 15th second.
[0038] S23: The smart socket synchronously uploads power consumption data, and the main control module records the power consumption changes during the power-on process (such as from 0.3W to 25W).
[0039] S24: The test process control module compares the captured screen with the reference image (e.g., the Windows logo has a 92% matching degree, which meets expectations); the real-time power consumption acquisition module determines that the power consumption is ≥10W (currently 25W, which meets expectations).
[0040] S25: Both are normal, the power-on test passed, and the main control module recorded "power-on successful".
[0041] S3: Shutdown Test Procedure S31: The main control module controls the laptop to perform the "start-shutdown" operation via the Remote Desktop Protocol (RDP).
[0042] S32: The camera captures the shutdown screen (such as a "Shutting down" message box, with a 95% matching accuracy) until the screen goes black.
[0043] S33: The smart socket collects power consumption data (gradually decreasing from 25W to 0.3W).
[0044] S34: The picture quality is normal (100% matching in black screen state), and the power consumption has dropped to ≤0.5W (currently 0.3W, as expected).
[0045] S35: Power-off test passed, main control module recorded "Power-off successful".
[0046] S4: Loops and Exception Handling If the 30 iterations are not reached, return to S2 and repeat the execution; if the required number of iterations is reached, the log module generates a test report (e.g., 30 successful iterations, average boot time 28 seconds, average shutdown time 12 seconds).
[0047] Example of anomaly: During the 15th test, after powering off, the screen went black but the power consumption remained at 15W (not reduced to 0.5W), triggering system exception handling: Terminate the test and save the current screen (black screen), power consumption curve (15W stable value) and timestamp; The real-time alarm module sends emails (with abnormal data attachments) and text messages to testers (content: "Laptop shutdown abnormal, power consumption not decreased, looping 15 times"). The log module records the exception type as "power-off power consumption anomaly".
[0048] Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
Claims
1. An automated test system for power on / off, characterized in that, include: Main control module; A switch action device, which is electrically connected to the main control module, is used to control the opening and closing of the switch button of the device under test, and can perform short press and long press actions. The image and video acquisition module is communicatively connected to the main control module and is used to sequentially acquire screen images of the device under test at each stage during the power-on and power-off process, and transmit the screen image of the current stage to the test process control module. The test process control module is communicatively connected to the main control module and the image and video acquisition module, and has preset reference images for each stage of the power-on and power-off of the device under test; the test process control module is used to compare the image of the current stage with the reference image of the corresponding stage to determine whether there is any abnormality in the image of the current stage. If an anomaly is detected, the test is terminated, the scene is preserved, and an anomaly signal is sent to the real-time alarm module, while the anomaly information is synchronized to the log module; if no anomaly is detected, a signal to continue testing is sent to the main control module. The real-time power consumption acquisition module is communicatively connected to the main control module and is used to collect the real-time power consumption of the device under test at different stages of power-on and power-off. It has preset expected thresholds for power consumption at each stage. The real-time power consumption acquisition module determines whether the real-time power consumption meets the expected thresholds. If it does, it sends a signal to the main control module to continue testing. If it does not, it terminates the test, preserves the current situation, sends an abnormal signal to the real-time alarm module, and synchronizes the abnormal information to the log module. The real-time alarm module is communicatively connected to the main control module, the test process control module and the real-time power consumption acquisition module, and is used to receive abnormal signals and issue alarms. The log module is communicatively connected to the main control module, the test process control module, and the real-time power consumption acquisition module, and is used to store test process data and abnormal information.
2. The automated power-on / off testing system according to claim 1, characterized in that, The device under test is plugged into a smart socket, which is equipped with a power consumption data transmission module. The power consumption data transmission module is communicatively connected to the real-time power consumption acquisition module and is used to transmit the collected power consumption data of the device under test to the real-time power consumption acquisition module.
3. The automated power-on / off testing system according to claim 1, characterized in that, The switch action device is a finger robot, which is electrically connected to the main control module and can perform short press or long press actions according to the instructions of the main control module.
4. The automated power-on / off testing system according to claim 3, characterized in that, The finger robot includes a robot control system and a robot drive system; the robot control system is communicatively connected to the main control module and is used to receive control commands from the main control module; the robot drive system is electrically connected to the robot control system and can execute corresponding switch button operations under the control of the robot control system.
5. The automated power-on / off testing system according to claim 1, characterized in that, The log module stores information including test time, number of tests, comparison results of images at each stage, real-time power consumption data, time of occurrence of an anomaly, and type of anomaly.
6. An automated testing method for power on / off, characterized in that, Includes the following steps: S1: Initialize the test system: The main control module completes self-test, presets the number of test cycles, reference images and power consumption thresholds for each stage of the device under test's power-on and power-off, connects the device under test to the smart socket, and puts the device under test into the initial standby state; S2: Execute the power-on test procedure: S21: The main control module sends a power-on control command to the switch action device, and the control switch action device performs a preset pressing action on the switch button of the device under test; S22: The image and video acquisition module acquires images of each stage of the power-on process of the device under test in real time and transmits them to the test process control module. S23: The real-time power consumption acquisition module synchronously acquires real-time power consumption data at each stage of the power-on process of the device under test; S24: The test process control module compares the current stage image with the corresponding stage reference image to determine if there are any anomalies; at the same time, the real-time power consumption acquisition module compares the real-time power consumption data with the corresponding stage power consumption threshold to determine if it meets expectations. S25: If the screen image is abnormal or the power consumption does not meet expectations, the abnormal handling mechanism is triggered: terminate the current test, retain the on-site data, the real-time alarm module issues an alarm signal, and the abnormal information is stored in the log module; if all are normal, the power-on test is completed. S3: Execute the shutdown test procedure: S31: The main control module sends a power-off control command to the switch action device, and the control switch action device performs a preset pressing action on the switch button of the device under test; S32: The image and video acquisition module acquires images of each stage of the shutdown process of the device under test in real time and transmits them to the test process control module; S33: The real-time power consumption acquisition module synchronously acquires real-time power consumption data at each stage during the shutdown process of the device under test; S34: The test process control module compares the current stage image with the corresponding stage reference image to determine if there is any abnormality; at the same time, the real-time power consumption acquisition module compares the real-time power consumption data with the corresponding stage power consumption threshold to determine if it meets expectations. S35: If the screen image is abnormal or the power consumption does not meet expectations, the abnormal handling mechanism described in step S25 is triggered; if both are normal, the shutdown test is completed. S4: Loop Test Judgment: The main control module counts the current test loop count. If the preset number of loops has not been reached, it returns to step S2 to repeat the power-on / off test. If the preset number of loops has been reached, the test ends and the log module generates a complete test report.
7. The automated power-on / off testing method according to claim 6, characterized in that, In steps S21 and S31, the switch action device is a finger robot, and the main control module drives the robot drive system to perform a preset pressing action by controlling the robot control system of the finger robot.
8. The automated power-on / off testing method according to claim 6, characterized in that, In steps S22 and S32, the comparison of the image includes the following sub-steps: a. The test process control module preprocesses the captured images; b. Use an image feature matching algorithm to compare the features of the preprocessed image with the reference image at the corresponding stage; c. If the matching degree is lower than the preset threshold, the image is determined to be abnormal, and the abnormality type is recorded.
9. The automated power-on / off testing method according to claim 6, characterized in that, In steps S23 and S33, the real-time power consumption data is collected through a smart socket connected to the device under test, and the power consumption data transmission module of the smart socket sends the collected power consumption data to the real-time power consumption acquisition module in real time.
10. An automated testing method for power on / off according to claim 6, characterized in that, The data to be retained in step S25 includes: timestamp of the anomaly occurrence, original images and comparison results of the corresponding stage, real-time power consumption curve, current operating parameters of the device under test and number of test cycles; In step S4, the test report includes: total number of test cycles, number of successes, number of exceptions, frequency of occurrence of each type of exception and corresponding stage distribution, and statistical analysis of power consumption data.
Citation Information
Patent Citations
Test system and test method
CN103294575A
Detection system and method applicable to AC startup and shutdown test of television
CN104394406A
Startup and shutdown impact tester and impact test system and method
CN105306927A
Startup-shutdown testing method and system
CN105868059A
Automatic startup and shutdown test system suitable for self-service terminal equipment
CN110704269A