Power-off Testing Method, Device, Electronic Device and Storage Medium of a Device
Through the communication connection between the control equipment and the test equipment, and the test database is used to automatically manage the test equipment, the problem of existing SSD abnormal power-down test relying on manual operations, and an efficient and automated power-down test process is realized, which improves the testing efficiency and effectiveness.
Patent Information
- Application Number
- CN202211640420.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-20
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-12-20
AI Technical Summary
The existing SSD abnormal power-down testing technology relies on manual operations, which consumes a lot of manpower, is inefficient in testing, and is prone to ineffective testing.
By controlling the communication connection between the device and the test device, the current testing phase and standard physical addresses of each test device are automatically obtained using the test database to realize an automated power-down testing process. The specific steps include sending logs to the test equipment in the self-test test stage of the power-on test, receiving the command code identification, controlling the test equipment to enter the system boot test stage, and executing the power-down method based on the diskless operating system.
It realizes automatic management of multiple test equipment, releases on-duty manpower, improves work efficiency, avoids disk consolidation and restart problems, improves the effectiveness of power-down tests, and reduces the error of manual testing, and realizes power-down tests for unattended equipment.
Smart Images

Figure CN115934443B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data testing, and in particular, to a power-off test method for a device, a power-off test device for a device, an electronic device, and a computer-readable storage medium. Background Art
[0002] A solid-state drive (SSD), also known as a solid-state disk, is a hard disk made of an array of solid-state electronic storage chips. An SSD includes flash memory that does not lose data when powered off, as well as RAM (Random Access Memory), SRAM (Static Random-Access Memory), or DRAM (Dynamic Random Access Memory) that loses data when powered off. Generally, there are two types of power-off for an SSD: normal power-off and abnormal power-off. For an SSD with normal power-off, data is not lost. Instead, after power-on again, the SSD only needs to reload data such as mapping data and flash block information saved before power-off. However, for an SSD with abnormal power-off, it means that the power supply is cut off when the SSD does not receive a power-off notification sent by the host, or after receiving the power-off notification sent by the host, the SSD does not have enough time to store data in the flash memory, resulting in data loss.
[0003] In the existing SSD abnormal power-off test technology, the operating system for performing the abnormal power-off test is often installed in the local disk of the server, and it is required that the tester participate in the entire abnormal test process of the SSD in real time, accurately judge the test progress during the test, manually power on the SSD through the server, and perform real-time inspection. Since each abnormal power-off test requires hundreds of cycles of power-on and power-off verification, this manual test-dependent method not only cannot meet the actual needs of testing a large number of test machines in a short period of time, but also consumes a large amount of manpower, resulting in low work efficiency. Moreover, abnormal power-off will cause fragmentation of the operating system. If there is too much fragmentation, the operating system will clean the disk and perform a restart operation when loading, thereby increasing the number of invalid tests and lengthening the test cycle. Summary of the Invention
[0004] Embodiments of the present invention provide a power-off test method, device, electronic device, and computer-readable storage medium for a device, so as to solve the problems in the prior art that due to relying on manual abnormal power-off testing in the local disk of the server, it consumes a large amount of manpower, has low test efficiency, and is prone to invalid tests.
[0005] An embodiment of the present invention discloses a power-off test method for a device, which is applied to a control device. The control device is communicatively connected to at least one test device, and the control device is configured with a test database for the test device. The method includes:
[0006] Obtain the current test stage and standard physical address of each of the test devices from the test database;
[0007] Send a power-on self-test log acquisition instruction to a first test device whose test stage is the power-on self-test stage, and receive an instruction code identifier corresponding to the power-on self-test log acquisition instruction sent by the first test device. Use the first test device with a self-test identifier in the instruction code identifier as the first target test device, and control the first target test device to enter the system boot test stage;
[0008] Simultaneously receive a system request instruction for a diskless operating system sent by a second test device whose test stage is the system boot test stage. The system request instruction includes a target physical address corresponding to the second test device;
[0009] Use the second test device whose target physical address matches the standard physical address in the test database as the second target test device, and control the second target test device to perform a corresponding power-off method based on the diskless operating system.
[0010] Optionally, the test database further includes a standard network interface address. Sending a power-on self-test log acquisition instruction to a first test device whose test stage is the power-on self-test stage and receiving an instruction code identifier corresponding to the power-on self-test log acquisition instruction sent by the first test device includes:
[0011] Send the power-on self-test log acquisition instruction to the first test device whose test stage is the power-on self-test stage through the standard network interface address;
[0012] Receive the power-on self-test log corresponding to the power-on self-test log acquisition instruction sent by the first test device. The power-on self-test log includes the instruction code identifier.
[0013] Optionally, using the first test device with a self-test identifier in the instruction code identifier as the first target test device and controlling the first target test device to enter the system boot test stage includes:
[0014] Use the first test device with the self-test identifier in the instruction code identifier as the first target test device, and update the test stage corresponding to the first target test device in the test database to the system boot test stage;
[0015] Control the first target test device to perform a shutdown operation and a static operation through the standard network port address;
[0016] After a preset time interval of static state, control the first target test device to perform a power-on operation and enter the system boot test phase.
[0017] Optionally, the simultaneously receiving the system request instruction for the diskless operating system sent by the second test device in the system boot test phase includes:
[0018] Control the second test device in the system boot test phase to enter the pre-boot execution environment, and simultaneously receive the system request instruction sent by the second test device to boot the pre-boot execution environment to the diskless operating system.
[0019] Optionally, the using the second test device to which the target physical address that successfully matches the standard physical address in the test database belongs as the second target test device includes:
[0020] Remotely access the diskless operating system corresponding to the target physical address;
[0021] Use the second test device to which the target physical address that successfully matches the standard physical address in the test database belongs as the second target test device, and control the second target test device to enter the diskless operating system.
[0022] Optionally, the test database includes the target test cycle number and the current test cycle number. The controlling the second target test device to perform the corresponding power-off method based on the diskless operating system includes:
[0023] Send a test status check instruction to the second target test device, receive the test status information returned by the second target test device, and upload the test status information to the test database;
[0024] If the test status information is a test pass information, perform an accumulative calculation on the current test cycle number, and control the second target test device with the current test cycle number less than the target test cycle number to perform the corresponding power-off method based on the diskless operating system.
[0025] Optionally, the controlling the target test device with the current test cycle number less than the second target test cycle number to perform the corresponding power-off method based on the diskless operating system includes:
[0026] Update the test phase corresponding to the second target test device in the test database to the power-on self-test phase;
[0027] Controlling a second target test device whose current number of test cycles is less than the target number of test cycles through the standard network port address to perform a shutdown operation and a static operation based on the diskless operating system;
[0028] After a preset time interval of static, controlling the second target test device to perform a power-on operation and enter the power-on self-test stage.
[0029] The present invention also discloses a power-off test device for a device, which is applied to a control device. The control device is communicatively connected to at least one test device, and the control device is configured with a test database for the test device. The device includes:
[0030] A test information acquisition module, configured to acquire the current test stage and the standard physical address of each test device from the test database;
[0031] A power-on self-test stage execution module, configured to send a power-on self-test log acquisition instruction to a first test device whose test stage is the power-on self-test stage, and receive an instruction code identifier corresponding to the power-on self-test log acquisition instruction sent by the first test device. The first test device with a self-test identifier in the instruction code identifier is used as a first target test device, and controlling the first target test device to enter the system boot test stage;
[0032] A target physical address acquisition module, configured to simultaneously receive a system request instruction for the diskless operating system sent by a second test device whose test stage is the system boot test stage. The system request instruction includes a target physical address corresponding to the second test device;
[0033] A power-off execution module, configured to use the second test device whose target physical address matches the standard physical address in the test database as a second target test device, and control the second target test device to perform a corresponding power-off method based on the diskless operating system.
[0034] Optionally, the test database further includes a standard network port address. Specifically, the power-on self-test stage execution module is configured to:
[0035] Send the power-on self-test log acquisition instruction to the first test device whose test stage is the power-on self-test stage through the standard network port address;
[0036] Receive the power-on self-test log corresponding to the power-on self-test log acquisition instruction sent by the first test device. The power-on self-test log includes the instruction code identifier.
[0037] Optionally, the power-on self-test stage execution module is specifically configured to:
[0038] Take the first test device with the self - test identifier in the instruction code identifier as the first target test device, and update the test phase corresponding to the first target test device in the test database to the system boot test phase;
[0039] Control the first target test device to perform a shutdown operation and a static operation through the standard network port address;
[0040] After standing still for a preset time interval, control the first target test device to perform a startup operation and enter the system boot test phase.
[0041] Optionally, the target physical address acquisition module is specifically used for:
[0042] Control the second test device with the test phase being the system boot test phase to enter the pre - startup execution environment, and at the same time receive the system request instruction for guiding the pre - startup execution environment to the diskless operating system sent by the second test device.
[0043] Optionally, the power - off execution module includes:
[0044] The diskless operating system access sub - module is used to remotely access the diskless operating system corresponding to the target physical address;
[0045] The second target test device determination sub - module is used to take the second test device to which the target physical address belongs that successfully matches the standard physical address in the test database as the second target test device, and control the second target test device to enter the diskless operating system.
[0046] Optionally, the test database includes the target test cycle number and the current test cycle number, and the power - off execution module further includes:
[0047] The test status information receiving sub - module is used to send a test status check instruction to the second target test device, receive the test status information returned by the second target test device, and upload the test status information to the test database;
[0048] The power - off execution sub - module is used to, if the test status information is a test - passed information, perform an accumulative calculation on the current test cycle number, and control the second target test device with the current test cycle number less than the target test cycle number to perform the corresponding power - off method based on the diskless operating system.
[0049] Optionally, the power - off execution sub - module is specifically used for:
[0050] Update the test phase corresponding to the second target test device in the test database to the power - on self - test phase;
[0051] Control the second target test device whose current test cycle is less than the target test cycle through the standard network port address to perform a shutdown operation and a static operation based on the diskless operating system;
[0052] After a preset time interval of static state, control the second target test device to perform a startup operation and enter the startup self-test stage.
[0053] An embodiment of the present invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus;
[0054] The memory is used to store a computer program;
[0055] When the processor is used to execute the program stored on the memory, it implements the method described in the embodiment of the present invention.
[0056] An embodiment of the present invention also discloses a computer-readable storage medium, on which instructions are stored. When executed by one or more processors, the instructions cause the processors to execute the method described in the embodiment of the present invention.
[0057] The embodiment of the present invention has the following advantages:
[0058] In an embodiment of the present invention, it is applied to a control device. The control device is communicatively connected to at least one test device. The control device is configured with a test database for the test devices, obtains the current test stage and standard physical address of each test device from the test database, sends a power-on self-test log acquisition instruction to a first test device whose test stage is the power-on self-test stage, and receives an instruction code identifier corresponding to the power-on self-test log acquisition instruction sent by the first test device. The first test device with a self-test identifier in the instruction code identifier is used as a first target test device, and the first target test device is controlled to enter the system boot test stage. At the same time, a system request instruction sent by a second test device whose test stage is the system boot test stage is received. The system request instruction includes the target physical address corresponding to the second test device. The second test device to which the target physical address that successfully matches the standard physical address in the test database belongs is used as a second target test device, and the second target test device is controlled to execute a corresponding power-off method based on a diskless operating system, so as to automatically obtain the current test stage and standard physical address of each test device, send a power-on self-test log acquisition instruction to the first test device whose test stage is the power-on self-test stage, and realize automatic monitoring of the current test process of the batch test for power-off test. On the one hand, by using the first test device with a self-test identifier in the instruction code identifier as the first target test device and controlling the first target test device to enter the system boot test stage, it realizes automatic management of multiple test devices, releases on-duty manpower, and improves work efficiency. On the other hand, by receiving the system request instruction sent by the second test device whose test stage is the system boot test stage, the second target test device can execute the power-off method based on the diskless operating system corresponding to the system request instruction. The diskless operating system method avoids the problems of disk defragmentation and restart, improves the effectiveness of the power-off test, and accurately monitors and executes the test operations corresponding to each test stage, reduces the errors generated by manual testing, and realizes unattended device power-off test. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 is a flowchart of the steps of a method for power-off test of a device provided in an embodiment of the present invention;
[0060] Figure 2 is a schematic diagram of the communication connection between a control device and a test device provided in an embodiment of the present invention;
[0061] Figure 3 is a flowchart of the steps for abnormal power-off test for different test stages provided in an embodiment of the present invention;
[0062] Figure 4 is a block diagram of the structure of a device power-off test device provided in an embodiment of the present invention;
[0063] Figure 5 It is a structural block diagram of an electronic device provided in an embodiment of the present invention. Specific embodiments
[0064] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0065] As an example, the server operating systems currently tested for abnormal power-off are all installed in the local disks of the servers. Usually, it is necessary for test technicians to be on-site to monitor the abnormal power-off test of the SSDs, and manually promote the normal execution of the entire test process in the local disks of the servers. For example, it is required that test technicians manually control the power-off operation and power-on operation at appropriate test times to facilitate smoothly entering the test of the next test stage. If a large number of test machines need to be tested for abnormal power-off in a short period of time, then according to the current technical means, the number of test technicians required and the man-hours spent by the test technicians will increase exponentially, resulting in low test efficiency, greatly increasing the risk of test errors, and there will be problems of disk defragmentation and restart after the server operating system experiences multiple abnormal power-offs, leading to an increase in the number of invalid test times and lengthening the test cycle.
[0066] In response to this, one of the core inventive points of the embodiments of the present invention is to automatically obtain the current test stage and standard physical address of each test device, and send a power-on self-test log acquisition instruction to the first test device whose test stage is the power-on self-test stage, so as to realize batch testing and automatically monitor the current test process of the power-off test. On the one hand, by using the first test device with a self-test identifier in the instruction code identifier as the first target test device, controlling the first target test device to enter the system boot test stage, realizing automatic management of multiple test devices, releasing the on-duty manpower, and improving work efficiency. On the other hand, by receiving the system request instruction sent by the second test device whose test stage is the system boot test stage, enabling the second target test device to execute the power-off method based on the diskless operating system corresponding to the system request instruction. The diskless operating system method avoids the problems of disk defragmentation and restart, improves the effectiveness of the power-off test, and accurately monitors and executes the test operations corresponding to each test stage, reducing the errors generated by manual testing, and realizing unattended device power-off testing.
[0067] Referring to Figure 1 , a step flowchart of a power-off test method for a device provided in an embodiment of the present invention is shown, which is applied to a control device. The control device is communicatively connected to at least one test device, and the control device is configured with a test database for the test device. Specifically, it may include the following steps:
[0068] Step 101: Obtain the current test stage and standard physical address of each of the test devices from the test database.
[0069] In an embodiment of the present invention, refer to Figure 2 FIG. shows a schematic diagram of the communication connection between the control device and the test device. The control device may be a control machine, which includes a DHCP Server (Dynamic Host Configuration Protocol Server) and an NFS Server (Network File System Server). The test device may be a test machine. The control machine communicates with multiple test machines through a switch to achieve data transmission. Since the DHCP Server and the NFS Server are configured in the controller, by supporting the DHCP service and the NFS service, and the controller at least includes a monitoring service module, a power-off service module, a boot service module, a status update module, and a counter module.
[0070] Optionally, the control machine may store a test database for multiple test machines. Referring to Table 1 below, the test database may include pre-set BMC IP addresses (Baseboard Management Controller Internet Protocol addresses) corresponding to each test machine, Mac addresses (Media Access Control Addresses / physical addresses), test stages, such as the POST stage (Power-On Self-Test stage), the OS stage (Operating System, which refers to the stage where the server continues to start and boot into the operating system after completing the POST power-on self-test), and the End stage (end stage), initially the POST stage, the target number of cycles N, the test status, such as Pass (pass status), Fail (fail status), and the current number of cycles (default is 0).
[0071]
[0072] Table 1
[0073] In a specific implementation, the control machine may scan the test stage in the test database every preset time period, and obtain the BMC IP address of the test machine with the test stage being the POST stage, and the Mac address of the test machine with the test stage being the OS stage. The value of the preset time period is based on completing one POST stage. For example, the control machine scans the test database every 60 seconds or 80 seconds, etc., and obtains the current test stage and standard physical address of each test device from the test database.
[0074] Step 102: Send a power-on self-test log acquisition instruction to the first test device whose test phase is the power-on self-test phase, and receive the instruction code identifier corresponding to the power-on self-test log acquisition instruction sent by the first test device. Use the first test device with a self-test identifier in the instruction code identifier as the first target test device, and control the first target test device to enter the system boot test phase.
[0075] Optionally, the power-on self-test phase can be the POST phase, the system boot test phase can be the OS phase, the power-on self-test log acquisition instruction can be an instruction for continuously acquiring the serial port power-on self-test log corresponding to each test machine, the instruction code identifier can be the power-on code digital symbol carried in the power-on self-test log instruction, and the self-test identifier can be a specified and pre-set identifier for identifying the corresponding test machine. The control machine can start the power-off service module for this test machine. For example, the self-test identifier can be a hexadecimal number specified in advance, such as 0x92 or 0xea. The selection requirement for this self-test identifier is any code after the SSD device is powered on after POST is completed.
[0076] In a specific implementation, the test database further includes a standard network port address. The control machine can send a power-on self-test log acquisition instruction to the first test device whose test phase is the power-on self-test phase through the standard network port address, and receive the power-on self-test log corresponding to the power-on self-test log acquisition instruction sent by the first test device. The power-on self-test log includes the instruction code identifier.
[0077] Optionally, the standard network port address can be the BMC IP address of the test machine. The control machine can use the IPMI protocol (Intelligent Platform Management Interface) to send an instruction for continuously acquiring the serial port power-on self-test log to each test machine whose test phase is the power-on self-test phase through the standard network port address (BMC IP address), and continuously monitor and identify for the specified self-test code to remotely and real-time acquire the power-on self-test log corresponding to the power-on self-test log acquisition instruction of the test machine.
[0078] Specifically, the control machine includes a monitoring service module and a power-off service module. Use the first test device with a self-test identifier in the instruction code identifier as the first target test device through the monitoring service module, and update the test phase corresponding to the first target test device in the test database to the system boot test phase through the power-off service module. Control the first target test device to perform a shutdown operation and a static operation through the standard network port address. After a preset time interval of static, control the first target test device to perform a power-on operation and enter the system boot test phase.
[0079] Optionally, the preset time interval can be set according to the actual situation, such as 10 seconds, 20 seconds, 30 seconds, and so on.
[0080] In one example, for a test machine in the power-on self-test stage, the monitoring service module can use the IPMI protocol to send a continuous serial port power-on self-test log instruction to each test machine BMC through the BMC IP address, and continuously monitor and identify the specified power-on self-test code. Once the specified power-on self-test code is identified, the power-off service module of the corresponding test machine is started. After the power-off service module is started, the "POST" test stage of the test machine in the test database can be updated to the "OS" test stage. At the same time, the IPMI protocol is used to control the test machine to perform forced abnormal power-off shutdown through the BMC IP address. At this time, the power supply of the SSD is abnormally cut off. After standing for 10s, the IPMI protocol is used again to control the test machine to execute the power-on instruction through the BMC IP address and enter the "OS" test stage.
[0081] Step 103: Simultaneously receive a system request instruction for a diskless operating system sent by a second test device whose test stage is the system boot test stage. The system request instruction includes a target physical address corresponding to the second test device.
[0082] In the embodiment of the present invention, the POST stage of the second test device in the system boot test stage does not power off abnormally, and the control device can perform further tests on it by receiving the system instruction request sent by the second test device.
[0083] Optionally, the system request instruction can be an instruction for the test machine to send the Mac address to the control machine NFS server and apply to enter the diskless operating system. The diskless operating system can be an operating system that supports the NFS service. By supporting the NFS service, the operating system is remotely shared to replace the operating system of the local disk of the test machine, and the data generated by the operating system is transmitted to the remote NFS server for storage in real time, avoiding the problem that the running cache data of the test machine is not written to the local disk in time due to abnormal power-off.
[0084] In a specific implementation, the control machine can include a boot service module. The boot service module is used to control a second test device whose test stage is the system boot test stage to enter the pre-boot execution environment, and simultaneously receive a system request instruction for guiding the pre-boot execution environment to the diskless operating system sent by the second test device. The pre-boot execution environment can be a PXE environment (Preboot eXecution Environment).
[0085] Specifically, the boot service module can be used when there is no operating system on the local disk of each test machine. After the POST stage is completed, the BIOS (Basic Input Output System) controls it to automatically start through the network card data port and enter the PXE environment. The test machine sends its MAC address to the NFS service of the control machine and applies for the NFS service to share the diskless operating system. The control machine needs to determine whether the MAC address of the test machine applying for the NFS service is in the test database to decide whether to add the test machine to the diskless operating system. If the MAC address of the test machine applying for the NFS service is in the test database (the target physical address matches the standard physical address), the NFS service is provided to enable the test machine to enter the diskless operating system. After the test machine enters the diskless operating system, it will be remotely accessed by the monitoring service module through the ssh (Network Working Group, Secure Shell Protocol) protocol. If the MAC address of the test machine applying for the NFS service is not in the test database (the target physical address does not match the standard physical address), the NFS service is refused to prevent the test machine from entering the diskless operating system, thus excluding servers that do not execute this test from entering the test scope. And since the operating system is stored on the remote NFS server and the shared diskless operating system is in read-only mode, the problem of the test machine restarting due to disk defragmentation is avoided.
[0086] Step 104: Use the second test device to which the target physical address that successfully matches the standard physical address in the test database belongs as the second target test device, and control the second target test device to execute the corresponding power-off method based on the diskless operating system.
[0087] In the implementation of the present invention, the control machine can use the second test device to which the target physical address that successfully matches the standard physical address in the test database belongs as the second target test device, and control the second target test device to execute the corresponding power-off method based on the diskless operating system.
[0088] In a specific implementation, use the second test device to which the target physical address that successfully matches the standard physical address in the test database belongs as the second target test device, and control the second target test device to enter the diskless operating system.
[0089] Specifically, the control machine further includes a status update module and a counter module. The test database includes the target test cycle number and the current test cycle number. The controller sends a test status check instruction to the second target test device, receives the test status information returned by the second target test device, and uploads the test status information to the test database. The status update module updates the test status information in the test database. If the test status information is a pass message, the counter module accumulatively calculates the current test cycle number, and controls the second target test device with the current test cycle number less than the target test cycle number to perform the corresponding power-off method based on the diskless operating system.
[0090] As an example, the status update module can be used for the control machine to remotely access the test machine operating system IP through the ssh protocol to execute the SSD health status check instruction, and upload and update the check result returned by the test machine to the corresponding test status in the test database of the control machine through the ssh protocol, and then start the counter module and the power-off service module in sequence. The counter module can be used to query the Mac address corresponding to the IP address in the address pool allocated by the DHCP service according to the IP address provided by the instruction when receiving the counting instruction, and then locate the corresponding test machine in the test database according to the Mac address, add 1 to the current cycle number of the test machine in the test database. If the value of the current test cycle number is the same as the target test cycle number, the test will end. If the value of the current test cycle number is the same as the target test cycle number, the power-off service module will be started, and the information of the test machine will be passed to the database.
[0091] Optionally, update the test phase corresponding to the second target test device in the test database to the power-on self-test phase, and control the second target test device with the current test cycle number less than the target test cycle number to perform the shutdown operation and the static operation based on the diskless operating system through the standard network port address. After a preset time interval of static, control the second target test device to perform the power-on operation and enter the power-on self-test phase.
[0092] As an example, if the test status information is a pass message (Pass), the current test cycle number is accumulatively calculated, and the second target test device with the current test cycle number less than the target test cycle number is controlled to perform the corresponding power-off method based on the diskless operating system. If the test status information is a fail message (Fail), the cycle number will not be accumulatively calculated.
[0093] Refer to Figure 3The flowchart of the steps for abnormal power-off testing in different test phases is shown. First, the controller scans the test database at a preset time interval to obtain the test phases and other test information of each test machine. For the test machines in the POST phase: If it is monitored that the test machine has a specified power-on self-test code, the test machine is powered off, left static for 10 s, and then powered on. At the same time, the test phase of the test machine in the test database is updated to the OS phase. For the test machines in the OS phase: The test machine is guided to enter the diskless operating system, the test status of the test machine is checked and updated, and the current test cycle count is incremented by a counter. If the current test cycle count is inconsistent with the target test cycle count, the test machine is powered off, left static for 10 s, and then powered on. At the same time, the test phase in the test database is updated to the POST phase in the test database. If the current test cycle count is consistent with the target test cycle count, the test ends.
[0094] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It can be understood that under the guidance of the idea of the embodiments of the present invention, those skilled in the art can make settings according to the actual situation, and the present invention does not limit this.
[0095] In an embodiment of the present invention, it is applied to a control device. The control device is communicatively connected to at least one test device. The control device is configured with a test database for the test devices, obtains the current test stage and the standard physical address of each test device from the test database, sends a power-on self-test log acquisition instruction to a first test device whose test stage is the power-on self-test stage, and receives an instruction code identifier corresponding to the power-on self-test log acquisition instruction sent by the first test device. The first test device with a self-test identifier in the instruction code identifier is taken as the first target test device, and the first target test device is controlled to enter the system boot test stage. At the same time, a system request instruction sent by a second test device whose test stage is the system boot test stage is received. The system request instruction includes the target physical address corresponding to the second test device. The second test device to which the target physical address that successfully matches the standard physical address in the test database belongs is taken as the second target test device, and the second target test device is controlled to execute the corresponding power-off method based on the diskless operating system, so as to automatically obtain the current test stage and the standard physical address of each test device, send a power-on self-test log acquisition instruction to the first test device whose test stage is the power-on self-test stage, and realize the automatic monitoring of the current test process of the batch test power-off test. On the one hand, by taking the first test device with a self-test identifier in the instruction code identifier as the first target test device and controlling the first target test device to enter the system boot test stage, it realizes the automatic management of multiple test devices, releases the on-duty manpower, and improves work efficiency. On the other hand, by receiving the system request instruction sent by the second test device whose test stage is the system boot test stage, the second target test device can execute the power-off method based on the diskless operating system corresponding to the system request instruction. The diskless operating system method avoids the problems of disk defragmentation and restart, improves the effectiveness of the power-off test, and accurately monitors and executes the test operations corresponding to each test stage, reducing the errors generated by manual testing, and realizing unattended device power-off testing.
[0096] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present invention.
[0097] Refer to Figure 4, which shows a structural block diagram of a power-off test device for a device provided in an embodiment of the present invention, is applied to a control device. The control device is communicatively connected to at least one test device, and the control device is configured with a test database for the test device, and specifically may include the following modules:
[0098] A test information acquisition module 401, configured to acquire the current test stage and the standard physical address of each of the test devices from the test database;
[0099] A power-on self-test stage execution module 402, configured to send a power-on self-test log acquisition instruction to a first test device whose test stage is the power-on self-test stage, and receive an instruction code identifier corresponding to the power-on self-test log acquisition instruction sent by the first test device, and use the first test device with a self-test identifier in the instruction code identifier as a first target test device, and control the first target test device to enter the system boot test stage;
[0100] A target physical address acquisition module 403, configured to simultaneously receive a system request instruction for a diskless operating system sent by a second test device whose test stage is the system boot test stage, where the system request instruction includes a target physical address corresponding to the second test device;
[0101] A power-off execution module 404, configured to use the second test device to which the target physical address that successfully matches the standard physical address in the test database belongs as a second target test device, and control the second target test device to execute a corresponding power-off method based on the diskless operating system.
[0102] In an alternative embodiment, the test database further includes a standard network port address, and the power-on self-test stage execution module 402 is specifically configured to:
[0103] Send the power-on self-test log acquisition instruction to the first test device whose test stage is the power-on self-test stage through the standard network port address;
[0104] Receive the power-on self-test log corresponding to the power-on self-test log acquisition instruction sent by the first test device, where the power-on self-test log includes the instruction code identifier.
[0105] In an alternative embodiment, the power-on self-test stage execution module 402 is specifically configured to:
[0106] Use the first test device with the self-test identifier in the instruction code identifier as the first target test device, and update the test stage corresponding to the first target test device in the test database to the system boot test stage;
[0107] Control the first target test device to perform a shutdown operation and a static operation through the standard network port address;
[0108] After a preset time interval of static state, control the first target test device to perform a startup operation and enter the system boot test phase.
[0109] In an optional embodiment, the target physical address acquisition module 403 is specifically configured to:
[0110] Control the second test device whose test phase is the system boot test phase to enter the pre-boot execution environment, and at the same time receive the system request instruction for the diskless operating system sent by the second test device.
[0111] In an optional embodiment, the power-off execution module 404 includes:
[0112] A diskless operating system access sub-module for remotely accessing the diskless operating system corresponding to the target physical address;
[0113] A second target test device determination sub-module for using the second test device to which the target physical address that successfully matches the standard physical address in the test database belongs as the second target test device, and controlling the second target test device to enter the diskless operating system.
[0114] In an optional embodiment, the test database includes the target test number of cycles and the current test number of cycles, and the power-off execution module 404 further includes:
[0115] A test status information receiving sub-module for sending a test status check instruction to the second target test device, receiving the test status information returned by the second target test device, and uploading the test status information to the test database;
[0116] A power-off execution sub-module for, if the test status information is a test pass information, performing an accumulative calculation on the current test number of cycles, and controlling the second target test device whose current test number of cycles is less than the target test number of cycles to perform a corresponding power-off method based on the diskless operating system.
[0117] In an optional embodiment, the power-off execution sub-module is specifically configured to:
[0118] Update the test phase corresponding to the second target test device in the test database to the power-on self-test phase;
[0119] Control the second target test device whose current test number of cycles is less than the target test number of cycles to perform a shutdown operation and a static operation based on the diskless operating system through the standard network port address;
[0120] After a preset time interval of static state, control the second target test device to perform a power-on operation and enter the power-on self-test phase.
[0121] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For the relevant parts, refer to the partial description of the method embodiment.
[0122] In addition, an embodiment of the present invention further provides an electronic device, including: a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, it implements each process of the power-off test method embodiment of the above device and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0123] An embodiment of the present invention further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by the processor, it implements each process of the power-off test method embodiment of the above device and can achieve the same technical effect. To avoid repetition, it will not be elaborated here. Among them, the computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.
[0124] Figure 5 A structural block diagram of an electronic device for implementing each embodiment of the present invention.
[0125] The electronic device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and a power supply 511, etc. Those skilled in the art can understand that Figure 5 the structure of the electronic device shown in does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements. In the embodiment of the present invention, the electronic device includes but is not limited to mobile phones, tablet computers, laptop computers, handheld computers, vehicle-mounted terminals, wearable devices, and pedometers, etc.
[0126] It should be understood that in the embodiments of the present invention, the radio frequency unit 501 can be used for receiving and sending signals during information reception and transmission or call processes. Specifically, after receiving the downlink data from the base station, it is given to the processor 510 for processing; in addition, the uplink data is sent to the base station. Generally, the radio frequency unit 501 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc. In addition, the radio frequency unit 501 can also communicate with the network and other devices through a wireless communication system.
[0127] The electronic device provides the user with wireless broadband Internet access through the network module 502, such as helping the user to send and receive e-mails, browse web pages, and access streaming media, etc.
[0128] The audio output unit 503 can convert the audio data received by the radio frequency unit 501 or the network module 502 or stored in the memory 509 into an audio signal and output it as sound. Moreover, the audio output unit 503 can also provide an audio output related to the specific functions executed by the electronic device 500 (for example, call signal reception sound, message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, etc.
[0129] The input unit 504 is used for receiving audio or video signals. The input unit 504 may include a graphics processing unit (GPU) 5041 and a microphone 5042. The graphics processing unit 5041 processes the image data of the still pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frames can be displayed on the display unit 506. The processed image frames can be stored in the memory 509 (or other storage media) or sent via the radio frequency unit 501 or the network module 502. The microphone 5042 can receive sounds and can process such sounds into audio data. The processed audio data can be output in a format that can be sent to the mobile communication base station via the radio frequency unit 501 in the case of a phone call mode.
[0130] The electronic device 500 further includes at least one sensor 505, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. Among them, the ambient light sensor can adjust the brightness of the display panel 5061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 5061 and / or the backlight when the electronic device 500 is moved to the ear. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 505 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be elaborated here.
[0131] The display unit 506 is used to display information input by the user or information provided to the user. The display unit 506 may include a display panel 5061, and the display panel 5061 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
[0132] The user input unit 507 can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function control of the electronic device. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072. The touch panel 5071, also known as a touch screen, can collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel 5071). The touch panel 5071 can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 510, and receives and executes the commands sent by the processor 510. In addition, the touch panel 5071 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 5071, the user input unit 507 can also include other input devices 5072. Specifically, the other input devices 5072 can include but are not limited to a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, which will not be elaborated here.
[0133] Further, the touch panel 5071 may cover the display panel 5061. After the touch panel 5071 detects a touch operation on or near it, it transmits the operation to the processor 510 to determine the type of touch event. Subsequently, the processor 510 provides a corresponding visual output on the display panel 5061 according to the type of touch event. Although in Figure 5 , the touch panel 5071 and the display panel 5061 are implemented as two independent components to realize the input and output functions of the electronic device, in some embodiments, the touch panel 5071 and the display panel 5061 may be integrated to realize the input and output functions of the electronic device, and the specific implementation is not limited here.
[0134] The interface unit 508 is an interface for connecting an external device to the electronic device 500. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headset port, and so on. The interface unit 508 can be used to receive inputs from an external device (such as data information, power, etc.) and transmit the received inputs to one or more components within the electronic device 500 or can be used to transmit data between the electronic device 500 and the external device.
[0135] The memory 509 can be used to store software programs and various data. The memory 509 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory 509 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
[0136] The processor 510 is the control center of the electronic device. It uses various interfaces and lines to connect all parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 509, and by calling the data stored in the memory 509, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 510 either.
[0137] The electronic device 500 may further include a power source 511 (such as a battery) for powering each component. Preferably, the power source 511 may be logically connected to the processor 510 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system.
[0138] In addition, the electronic device 500 includes some functional modules not shown, which will not be elaborated here.
[0139] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including the element.
[0140] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0141] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the spirit and scope protected by the claims of the present invention, and all of them belong to the protection scope of the present invention.
[0142] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0143] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0144] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, 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 couplings or direct couplings or communication connections shown or discussed with each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0145] 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 can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0146] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0147] If the function 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 such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical discs that can store program codes.
[0148] The above is only the specific implementation manner 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 and should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A power-off test method for a device, characterized in that, Applied to a control device, the control device is communicatively connected to at least one test device, and the control device is configured with a test database for the test device. The method includes: Obtain the current test phase and standard physical address of each of the test devices from the test database; Send a power-on self-test log acquisition instruction to a first test device whose test phase is the power-on self-test phase, and receive an instruction code identifier corresponding to the power-on self-test log acquisition instruction sent by the first test device. Use the first test device with a self-test identifier in the instruction code identifier as the first target test device, and control the first target test device to enter the system boot test phase; Simultaneously receive a system request instruction for a diskless operating system sent by a second test device whose test phase is the system boot test phase. The system request instruction includes a target physical address corresponding to the second test device; Use the second test device to which the target physical address that successfully matches the standard physical address in the test database belongs as the second target test device, and control the second target test device to perform a corresponding power-off method based on the diskless operating system.
2. The method according to claim 1, wherein The test database further includes a standard network interface address. Sending a power-on self-test log acquisition instruction to a first test device whose test phase is the power-on self-test phase and receiving an instruction code identifier corresponding to the power-on self-test log acquisition instruction sent by the first test device includes: Send the power-on self-test log acquisition instruction to the first test device whose test phase is the power-on self-test phase through the standard network interface address; Receive the power-on self-test log corresponding to the power-on self-test log acquisition instruction sent by the first test device. The power-on self-test log includes the instruction code identifier.
3. The method according to claim 2, wherein Using the first test device with a self-test identifier in the instruction code identifier as the first target test device and controlling the first target test device to enter the system boot test phase includes: Use the first test device with the self-test identifier in the instruction code identifier as the first target test device, and update the test phase corresponding to the first target test device in the test database to the system boot test phase; Control the first target test device to perform a shutdown operation and a static operation through the standard network interface address; After a preset time interval of static state, control the first target test device to perform a power-on operation and enter the system boot test phase.
4. The method according to claim 1, wherein Simultaneously receiving a system request instruction for a diskless operating system sent by a second test device whose test phase is the system boot test phase includes: Control the second test device whose test phase is the system boot test phase to enter the pre-boot execution environment, and simultaneously receive the system request instruction for guiding the pre-boot execution environment to the diskless operating system sent by the second test device.
5. The method according to claim 4, characterized in that, Using the second test device to which the target physical address that successfully matches the standard physical address in the test database belongs as the second target test device includes: Remotely access the diskless operating system corresponding to the target physical address; Use the second test device to which the target physical address that successfully matches the standard physical address in the test database belongs as the second target test device, and control the second target test device to enter the diskless operating system.
6. The method according to claim 1, wherein The test database includes the target test cycles and the current test cycles. The controlling the second target test device to perform the corresponding power-off method based on the diskless operating system includes: Send a test status check instruction to the second target test device, receive the test status information returned by the second target test device, and upload the test status information to the test database; If the test status information is a pass information, perform an accumulative calculation on the current test cycles, and control the second target test device whose current test cycles are less than the target test cycles to perform the corresponding power-off method based on the diskless operating system.
7. The method according to claim 6, wherein The controlling the target test device whose current test cycles are less than the second target test cycles to perform the corresponding power-off method based on the diskless operating system includes: Update the test phase corresponding to the second target test device in the test database to the power-on self-test phase; Control the second target test device whose current test cycles are less than the target test cycles to perform a shutdown operation and a static operation based on the diskless operating system through the standard network port address; After a preset time interval of static state, control the second target test device to perform a power-on operation and enter the power-on self-test phase.
8. A power-off test device for a device, characterized in that Applied to a control device, the control device is communicatively connected to at least one test device, and the control device is configured with a test database for the test device. The device includes: A test information acquisition module, configured to acquire the test phase and the standard physical address of each test device currently in the test database; A power-on self-test phase execution module, configured to send a power-on self-test log acquisition instruction to the first test device whose test phase is the power-on self-test phase, and receive the instruction code identifier corresponding to the power-on self-test log acquisition instruction sent by the first test device, use the first test device in which the instruction code identifier has a self-test identifier as the first target test device, and control the first target test device to enter the system boot test phase; A target physical address acquisition module, configured to simultaneously receive a system request instruction for the diskless operating system sent by the second test device whose test phase is the system boot test phase, where the system request instruction includes the target physical address corresponding to the second test device; A power-off execution module, configured to use the second test device to which the target physical address that successfully matches the standard physical address in the test database belongs as the second target test device, and control the second target test device to perform the corresponding power-off method based on the diskless operating system.
9. An electronic device, characterized in that, Includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus; The memory is used to store computer programs; When the processor is used to execute the programs stored on the memory, the method described in any one of claims 1-7 is implemented.
10. A computer-readable storage medium having instructions stored thereon, which when executed by one or more processors, cause the processor to execute the method described in any one of claims 1-7.
Citation Information
Patent Citations
SSD abnormal power failure test method and device, computer device and storage medium
CN109524049A
Server centralized testing method, device and equipment and readable medium
CN113886159A